@@ -45,13 +45,50 @@ func TestServerDeployment_MountsGithubAppSecret(t *testing.T) {
45
45
require .Truef (t , foundMount , "failed to find expected volume mount %q on server container" , githubAppCertSecret )
46
46
}
47
47
48
+ func TestServerDeployment_UsesTracingConfig (t * testing.T ) {
49
+ ctx := renderContext (t )
50
+
51
+ objects , err := deployment (ctx )
52
+ require .NoError (t , err )
53
+
54
+ require .Len (t , objects , 1 , "must render only one object" )
55
+
56
+ deployment := objects [0 ].(* appsv1.Deployment )
57
+
58
+ serverContainer := deployment .Spec .Template .Spec .Containers [0 ]
59
+
60
+ var envVars = make (map [string ]string , len (serverContainer .Env ))
61
+ for _ , envVar := range serverContainer .Env {
62
+ envVars [envVar .Name ] = envVar .Value
63
+ }
64
+
65
+ actualSamplerType := envVars ["JAEGER_SAMPLER_TYPE" ]
66
+ actualSamplerParam := envVars ["JAEGER_SAMPLER_PARAM" ]
67
+
68
+ require .Equal (t , "probabilistic" , actualSamplerType )
69
+ require .Equal (t , "12.5" , actualSamplerParam )
70
+ }
71
+
48
72
func renderContext (t * testing.T ) * common.RenderContext {
73
+ var samplerType experimental.TracingSampleType = "probabilistic"
74
+
49
75
ctx , err := common .NewRenderContext (config.Config {
50
76
Database : config.Database {
51
77
InCluster : pointer .Bool (true ),
52
78
},
79
+ Observability : config.Observability {
80
+ LogLevel : config .LogLevelInfo ,
81
+ Tracing : & config.Tracing {
82
+ Endpoint : pointer .String ("some-endpoint" ),
83
+ AgentHost : pointer .String ("some-agent-host" ),
84
+ },
85
+ },
53
86
Experimental : & experimental.Config {
54
87
WebApp : & experimental.WebAppConfig {
88
+ Tracing : & experimental.Tracing {
89
+ SamplerType : & samplerType ,
90
+ SamplerParam : pointer .Float64 (12.5 ),
91
+ },
55
92
Server : & experimental.ServerConfig {
56
93
GithubApp : & experimental.GithubApp {
57
94
AppId : 0 ,
0 commit comments