Skip to content

CP-21164: fix cyberark validation tests picking up ambient ARK_USERNAME/ARK_SECRET secrets - #825

Closed
roeezis wants to merge 2 commits into
jetstack:masterfrom
roeezis:conjur-jwt-auth/fix-cyberark-validation-test-ambient-secrets
Closed

CP-21164: fix cyberark validation tests picking up ambient ARK_USERNAME/ARK_SECRET secrets#825
roeezis wants to merge 2 commits into
jetstack:masterfrom
roeezis:conjur-jwt-auth/fix-cyberark-validation-test-ambient-secrets

Conversation

@roeezis

@roeezis roeezis commented Aug 27, 2026

Copy link
Copy Markdown

Summary

Post-merge CI on master failed after #818-824 merged: https://github.com/jetstack/jetstack-secure/actions/runs/33077373972/job/98535010580

Three TestConfig_CyberArk_Validation subtests in pkg/agent/config_test.go assumed ARK_USERNAME/ARK_SECRET were empty in the ambient environment. That holds locally, but this repo's tests.yaml workflow sets both from real repo secrets at the job level (for the separate ARK_LIVE_TEST-gated live test), so the subtests picked up real credentials instead of an empty baseline — causing assertions like "neither service_id nor ARK_USERNAME is an error" to unexpectedly pass with no error.

Fix

The shared setEnv helper in that test now clears ARK_USERNAME/ARK_SECRET unconditionally before each subtest; subtests that need non-empty values still set them explicitly afterward via their own t.Setenv calls.

Test plan

  • Reproduced the exact 3 failures locally by setting ARK_SUBDOMAIN/ARK_USERNAME/ARK_SECRET env vars before running go test ./pkg/agent/..., matching CI's failure output exactly (including the fallback/cluster_name assertion).
  • Confirmed the fix passes under the same simulated ambient-secret condition.
  • Full go build ./..., go test ./..., and golangci-lint run ./... pass (one pre-existing, unrelated pkg/client failure from a local Go-toolchain stdlib message difference, confirmed present at master before this change too).

…tion tests

CI sets both from real secrets at the job level (for the separate
ARK_LIVE_TEST-gated live test), so three subtests asserting on an
empty username/secret picked up real ambient values instead of the
empty baseline they assumed locally.
@mladen-rusev-cyberark mladen-rusev-cyberark added the test-e2e To signal e2e test job to be run label Aug 27, 2026
Empty commit to retrigger the test suite now that the test-e2e label was added, per Mladen's request.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test-ark test-e2e To signal e2e test job to be run test-ngts

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants