CP-21164: fix cyberark validation tests picking up ambient ARK_USERNAME/ARK_SECRET secrets - #825
Closed
roeezis wants to merge 2 commits into
Closed
Conversation
…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.
Empty commit to retrigger the test suite now that the test-e2e label was added, per Mladen's request.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Post-merge CI on
masterfailed after #818-824 merged: https://github.com/jetstack/jetstack-secure/actions/runs/33077373972/job/98535010580Three
TestConfig_CyberArk_Validationsubtests inpkg/agent/config_test.goassumedARK_USERNAME/ARK_SECRETwere empty in the ambient environment. That holds locally, but this repo'stests.yamlworkflow sets both from real repo secrets at the job level (for the separateARK_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
setEnvhelper in that test now clearsARK_USERNAME/ARK_SECRETunconditionally before each subtest; subtests that need non-empty values still set them explicitly afterward via their ownt.Setenvcalls.Test plan
ARK_SUBDOMAIN/ARK_USERNAME/ARK_SECRETenv vars before runninggo test ./pkg/agent/..., matching CI's failure output exactly (including the fallback/cluster_name assertion).go build ./...,go test ./..., andgolangci-lint run ./...pass (one pre-existing, unrelatedpkg/clientfailure from a local Go-toolchain stdlib message difference, confirmed present atmasterbefore this change too).