Skip to content

Commit 3838f2b

Browse files
committed
enable and update endpoint for telemetry for longevity tests
1 parent cafbd5c commit 3838f2b

File tree

5 files changed

+24
-4
lines changed

5 files changed

+24
-4
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
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.ref_type == 'branch' && startsWith(github.ref, 'refs/heads/tests/') && 'oss-dev.edge.df.f5.com:443' || 'oss.edge.df.f5.com:443' }}
184184
TELEMETRY_ENDPOINT_INSECURE: "false"
185185

186186
- name: Cache Artifacts

cmd/gateway/commands.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,8 @@ func createStaticModeCommand() *cobra.Command {
190190
}
191191
}
192192

193+
fmt.Println("telemetry endpoint set to ", telemetryEndpoint)
194+
193195
telemetryEndpointInsecure, err := strconv.ParseBool(telemetryEndpointInsecure)
194196
if err != nil {
195197
return fmt.Errorf("error parsing telemetry endpoint insecure: %w", err)

tests/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ stop-longevity-test: nfr-test ## Stop the longevity test and collects results
123123

124124
.PHONY: .vm-nfr-test
125125
.vm-nfr-test: ## Runs the NFR tests on the GCP VM (called by `nfr-test`)
126-
go run github.com/onsi/ginkgo/v2/ginkgo --randomize-all --randomize-suites --keep-going --fail-on-pending \
126+
go run github.com/onsi/ginkgo/v2/ginkgo -v --randomize-all --randomize-suites --keep-going --fail-on-pending \
127127
--trace -r -v --buildvcs --force-newlines $(GITHUB_OUTPUT) \
128128
--label-filter "nfr" $(GINKGO_FLAGS) --timeout 5h ./suite -- --gateway-api-version=$(GW_API_VERSION) \
129129
--gateway-api-prev-version=$(GW_API_PREV_VERSION) --image-tag=$(TAG) --version-under-test=$(NGF_VERSION) \

tests/framework/ngf.go

Lines changed: 14 additions & 2 deletions
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+
args = append(args, formatValueSet("nginxGateway.productTelemetry.enable", "false")...)
196+
if cfg.Telemetry {
197+
GinkgoWriter.Printf("Telemetry set to %v\n", cfg.Telemetry)
198+
args = append(args, formatValueSet("nginxGateway.productTelemetry.enable", "true")...)
199+
}
200+
return args
201+
}
202+
191203
func setImageArgs(cfg InstallationConfig) []string {
192204
var args []string
193205

tests/suite/system_suite_test.go

Lines changed: 6 additions & 0 deletions
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)