Skip to content

Commit a634697

Browse files
committed
ci: unset hosted env in test step
1 parent 8ecd246 commit a634697

2 files changed

Lines changed: 3 additions & 8 deletions

File tree

.buildkite/hooks/pre-command

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,3 @@ mkdir -p \
1212
export GOCACHE="${cache_root}/go/build"
1313
export GOMODCACHE="${cache_root}/go/pkg/mod"
1414
export GOLANGCI_LINT_CACHE="${cache_root}/golangci-lint"
15-
16-
if [[ "${BUILDKITE_STEP_KEY:-}" == "test" ]]; then
17-
# Hosted agents inject the pipeline org and API token into the step
18-
# environment. A subset of CLI tests exercise config precedence and must not
19-
# inherit those ambient overrides, or they resolve the live Buildkite org
20-
# instead of the fixture-backed test config.
21-
unset BUILDKITE_API_TOKEN BUILDKITE_ORGANIZATION_SLUG
22-
fi

.buildkite/pipeline.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ steps:
1717
artifact_paths:
1818
- cover-tree.svg
1919
commands:
20+
# Hosted agents inject org/token env that breaks config-precedence tests,
21+
# so clear those variables in the command shell right before go test.
22+
- unset BUILDKITE_ORGANIZATION_SLUG BUILDKITE_API_TOKEN
2023
- go test -coverprofile cover.out ./...
2124
- go run github.com/nikolaydubina/go-cover-treemap@v1.5.1 -coverprofile cover.out > cover-tree.svg
2225
- echo '<details><summary>Coverage tree map</summary><img src="artifact://cover-tree.svg" alt="Test coverage tree map" width="70%"></details>' | buildkite-agent annotate --style "info"

0 commit comments

Comments
 (0)