test(e2e): prefix all API test resource names with cli-e2e-#841
Merged
Conversation
kobajagi
approved these changes
Jun 8, 2026
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.
Description
The CLI's API e2e tests share an Exoscale test organisation with other repos (terraform-provider-exoscale, csi-driver, ...). Two scenarios creating a resource with the same name would race and one would fail with
already existsor worse, leak.This PR makes the CLI's e2e tests use a namespaced prefix for every resource they create. The prefix
cli-e2e-is now baked into the injectedTEST_RUN_IDby the runner, and existing literalcli-e2e-segments in scenario files have been removed so the convention lives in exactly one place.Result: a resource like an NLB is now created as
cli-e2e-1717000000-abc123-nlb-ainstead of the previous mix (e2e-...-nlb-a,cli-e2e-rdns-...,cli-e2e-pg-...).Related issue
N/A, came out of a chat about shared test org resource collisions.
Changes
tests/e2e/testscript_api_test.go:RunIDis now formatted ascli-e2e-<unix>-<rand6>instead ofe2e-<unix>-<rand6>. One line, plus a short comment.tests/e2e/scenarios/with-api/compute/instance_reboot.txtar: dropped literalcli-e2e-, nowreboot-$TEST_RUN_ID.tests/e2e/scenarios/with-api/compute/instance_create_reverse_dns.txtar: same, nowrdns-$TEST_RUN_ID.tests/e2e/scenarios/with-api/dbaas/pg_config_lifecycle.txtar: same, nowpg-$TEST_RUN_ID(6 occurrences).tests/e2e/README.md: new quick reference, documents thecli-e2e-prefix rule with good and bad naming examples.CHANGELOG.md: entry under Unreleased.The NLB scenario already used
$TEST_RUN_IDin its resource names, so no change was needed there. Thenonexistent-e2e-instanceplaceholder in the not-found error scenarios is intentionally not a real resource and is unchanged.Checklist
Testing
go vet ./...andgo build ./...fromtests/e2e/pass on the default build tag.go vet -tags=api ./...andgo build -tags=api ./...fromtests/e2e/also pass.I have not been able to run the actual
-tags=apiscenarios here because they needEXOSCALE_API_KEYandEXOSCALE_API_SECRET. CI on this PR should be the source of truth for the full run.Notes for reviewers
The single source of truth for the prefix is the
runIDline intestscript_api_test.go. Anyone adding a new with-api scenario should use<descriptor>-$TEST_RUN_IDand let the runner addcli-e2e-. Thetests/e2e/README.mdquick reference calls this out.