Skip to content

Commit 618e37f

Browse files
authored
Enable and update endpoint for telemetry for longevity tests (#2824)
Enable and update endpoint for telemetry for longevity tests Problem: Users want to get telemetry reports when running longevity tests to simulate a live environment. Solution: To provide live telemetry reports when running longevity tests, we have enabled telemetry for the test when label is longevity and updated the workflow that creates the binary for release to update the TELEMETRY_ENDPOINT to the dev endpoint.
1 parent 73afa15 commit 618e37f

File tree

3 files changed

+21
-3
lines changed

3 files changed

+21
-3
lines changed

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ jobs:
180180
AZURE_STORAGE_KEY: ${{ secrets.AZURE_STORAGE_KEY }}
181181
AZURE_BUCKET_NAME: ${{ secrets.AZURE_BUCKET_NAME }}
182182
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_COMMUNITY }}
183-
TELEMETRY_ENDPOINT: oss.edge.df.f5.com:443
183+
TELEMETRY_ENDPOINT: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/heads/release-') && 'oss-dev.edge.df.f5.com:443' || 'oss.edge.df.f5.com:443' }}
184184
TELEMETRY_ENDPOINT_INSECURE: "false"
185185

186186
- name: Cache Artifacts

tests/framework/ngf.go

+14-2
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ type InstallationConfig struct {
3535
ServiceType string
3636
IsGKEInternalLB bool
3737
Plus bool
38+
Telemetry bool
3839
}
3940

4041
// InstallGatewayAPI installs the specified version of the Gateway API resources.
@@ -70,14 +71,14 @@ func InstallNGF(cfg InstallationConfig, extraArgs ...string) ([]byte, error) {
7071
"--create-namespace",
7172
"--namespace", cfg.Namespace,
7273
"--wait",
73-
"--set", "nginxGateway.productTelemetry.enable=false",
7474
"--set", "nginxGateway.snippetsFilters.enable=true",
7575
}
7676
if cfg.ChartVersion != "" {
7777
args = append(args, "--version", cfg.ChartVersion)
7878
}
7979

8080
args = append(args, setImageArgs(cfg)...)
81+
args = append(args, setTelemetryArgs(cfg)...)
8182
fullArgs := append(args, extraArgs...) //nolint:gocritic
8283

8384
GinkgoWriter.Printf("Installing NGF with command: helm %v\n", strings.Join(fullArgs, " "))
@@ -136,7 +137,6 @@ func UpgradeNGF(cfg InstallationConfig, extraArgs ...string) ([]byte, error) {
136137
cfg.ChartPath,
137138
"--namespace", cfg.Namespace,
138139
"--wait",
139-
"--set", "nginxGateway.productTelemetry.enable=false",
140140
"--set", "nginxGateway.config.logging.level=debug",
141141
"--set", "nginxGateway.snippetsFilter.enable=true",
142142
}
@@ -145,6 +145,7 @@ func UpgradeNGF(cfg InstallationConfig, extraArgs ...string) ([]byte, error) {
145145
}
146146

147147
args = append(args, setImageArgs(cfg)...)
148+
args = append(args, setTelemetryArgs(cfg)...)
148149
fullArgs := append(args, extraArgs...) //nolint:gocritic
149150

150151
GinkgoWriter.Printf("Upgrading NGF with command: helm %v\n", strings.Join(fullArgs, " "))
@@ -188,6 +189,17 @@ func UninstallNGF(cfg InstallationConfig, k8sClient client.Client) ([]byte, erro
188189
return nil, nil
189190
}
190191

192+
func setTelemetryArgs(cfg InstallationConfig) []string {
193+
var args []string
194+
195+
if cfg.Telemetry {
196+
args = append(args, formatValueSet("nginxGateway.productTelemetry.enable", "true")...)
197+
} else {
198+
args = append(args, formatValueSet("nginxGateway.productTelemetry.enable", "false")...)
199+
}
200+
return args
201+
}
202+
191203
func setImageArgs(cfg InstallationConfig) []string {
192204
var args []string
193205

tests/suite/system_suite_test.go

+6
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ type setupConfig struct {
9999
deploy bool
100100
nfr bool
101101
debugLogLevel bool
102+
telemetry bool
102103
}
103104

104105
func setup(cfg setupConfig, extraInstallArgs ...string) {
@@ -151,6 +152,10 @@ func setup(cfg setupConfig, extraInstallArgs ...string) {
151152
Skip("Graceful Recovery test must be run on Kind")
152153
}
153154

155+
if clusterInfo.IsGKE && strings.Contains(GinkgoLabelFilter(), "longevity") {
156+
cfg.telemetry = true
157+
}
158+
154159
switch {
155160
case *versionUnderTest != "":
156161
version = *versionUnderTest
@@ -196,6 +201,7 @@ func createNGFInstallConfig(cfg setupConfig, extraInstallArgs ...string) framewo
196201
ServiceType: *serviceType,
197202
IsGKEInternalLB: *isGKEInternalLB,
198203
Plus: *plusEnabled,
204+
Telemetry: cfg.telemetry,
199205
}
200206

201207
// if we aren't installing from the public charts, then set the custom images

0 commit comments

Comments
 (0)