Skip to content

test(e2e): prefix all API test resource names with cli-e2e-#841

Merged
natalie-o-perret merged 4 commits into
masterfrom
test/e2e-prefix-runid
Jun 8, 2026
Merged

test(e2e): prefix all API test resource names with cli-e2e-#841
natalie-o-perret merged 4 commits into
masterfrom
test/e2e-prefix-runid

Conversation

@natalie-o-perret

@natalie-o-perret natalie-o-perret commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

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 exists or 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 injected TEST_RUN_ID by the runner, and existing literal cli-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-a instead 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: RunID is now formatted as cli-e2e-<unix>-<rand6> instead of e2e-<unix>-<rand6>. One line, plus a short comment.
  • tests/e2e/scenarios/with-api/compute/instance_reboot.txtar: dropped literal cli-e2e-, now reboot-$TEST_RUN_ID.
  • tests/e2e/scenarios/with-api/compute/instance_create_reverse_dns.txtar: same, now rdns-$TEST_RUN_ID.
  • tests/e2e/scenarios/with-api/dbaas/pg_config_lifecycle.txtar: same, now pg-$TEST_RUN_ID (6 occurrences).
  • tests/e2e/README.md: new quick reference, documents the cli-e2e- prefix rule with good and bad naming examples.
  • CHANGELOG.md: entry under Unreleased.

The NLB scenario already used $TEST_RUN_ID in its resource names, so no change was needed there. The nonexistent-e2e-instance placeholder in the not-found error scenarios is intentionally not a real resource and is unchanged.

Checklist

  • Changelog updated (Unreleased block)
  • Testing

Testing

  • go vet ./... and go build ./... from tests/e2e/ pass on the default build tag.
  • go vet -tags=api ./... and go build -tags=api ./... from tests/e2e/ also pass.

I have not been able to run the actual -tags=api scenarios here because they need EXOSCALE_API_KEY and EXOSCALE_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 runID line in testscript_api_test.go. Anyone adding a new with-api scenario should use <descriptor>-$TEST_RUN_ID and let the runner add cli-e2e-. The tests/e2e/README.md quick reference calls this out.

@natalie-o-perret natalie-o-perret changed the title test(e2e): prefix API test run IDs with cli-e2e- test(e2e): prefix all API test resource names with cli-e2e- Jun 8, 2026
@natalie-o-perret natalie-o-perret marked this pull request as ready for review June 8, 2026 12:51
@natalie-o-perret natalie-o-perret merged commit 80194a9 into master Jun 8, 2026
7 checks passed
@natalie-o-perret natalie-o-perret deleted the test/e2e-prefix-runid branch June 8, 2026 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants