Skip to content

ci: add support to test all cassettes - #4483

Open
remyleone wants to merge 6 commits into
scaleway:mainfrom
remyleone:test_cassettes
Open

ci: add support to test all cassettes#4483
remyleone wants to merge 6 commits into
scaleway:mainfrom
remyleone:test_cassettes

Conversation

@remyleone

Copy link
Copy Markdown
Member

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Relates OR Closes #0000

Release note for CHANGELOG:


@remyleone remyleone self-assigned this Feb 14, 2025
@remyleone remyleone added the priority:high New features label Feb 14, 2025
@yfodil
yfodil changed the base branch from master to main February 27, 2026 10:33
Copilot AI lite review requested due to automatic review settings August 10, 2026 14:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Adds a nightly CI validation that scans and loads all recorded VCR cassettes and fails if unexpected HTTP error responses are present.

Changes:

  • Introduces a Go test that walks ../namespaces to load cassette files and validate response codes.
  • Adds a nightly workflow step to run only the cassette validator test.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
internal/testhelpers/cassette_validators_test.go New test that enumerates cassette files and validates recorded HTTP interactions.
.github/workflows/nightly.yml Runs the new cassette validation test during nightly CI.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +45 to +53
err := filepath.WalkDir("../namespaces", func(path string, _ fs.DirEntry, _ error) error {
isCassette := strings.Contains(path, "cassette")
_, isException := exceptions[path]
if isCassette && !isException {
filesMap[fileNameWithoutExtSuffix(path)] = struct{}{}
}

return nil
})
Comment on lines +44 to +50
exceptions := exceptionsCassettesCases()
err := filepath.WalkDir("../namespaces", func(path string, _ fs.DirEntry, _ error) error {
isCassette := strings.Contains(path, "cassette")
_, isException := exceptions[path]
if isCassette && !isException {
filesMap[fileNameWithoutExtSuffix(path)] = struct{}{}
}
Comment on lines +133 to +137
for path := range paths {
c, err := cassette.Load(path)
require.NoError(t, err)
require.NoError(t, checkErrorCode(c))
}
Comment on lines +73 to +75
- name: Run acceptance test for cassettes
if: success() || failure() # If the job is not cancelled, run it regardless of the result of the previous step
run: go test -v github.com/scaleway/scaleway-cli/v2/internal/testhelpers -run TestAccCassettes_Validator
}

// isTransientStateError checks if the interaction response is a transient state error
// Transient state error are expected when creating resource linked to each other
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority:high New features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants