Fix scorecard acceptance test CQL + run acceptance tests on PRs#102
Merged
Conversation
The scorecard filter fixtures used "owners_is_set", which the Cortex backend's CQL grammar no longer accepts: 400 BAD_REQUEST: The [COMPOUND_FILTER] filter is not valid: "Invalid expression: owners_is_set" Replace it with the current equivalent "ownership != null" in the fixtures and the corresponding TestCheckResourceAttr assertions. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Acceptance tests previously ran only on push to main (main-test.yml), so breakages against the live Cortex tenant surfaced only after merge. Consolidate everything into test.yml and add an acceptance-test job that runs on pushes to main and on same-repo PRs. Guards: - Skipped for forked PRs, where secrets.CORTEX_API_TOKEN is unavailable; those are still verified after merge to main. - Serialized repo-wide via a 'cortex-acceptance-tenant' concurrency group (cancel-in-progress: false) since the tests share one live tenant and use static resource tags, so concurrent runs would collide. Delete the now-redundant main-test.yml. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
AdmTal
approved these changes
Jun 29, 2026
The provider defaults to https://api.getcortexapp.com when CORTEX_API_URL is unset (which CI does not set), so acceptance tests create and destroy real resources in the production tenant owned by CORTEX_API_TOKEN. "live" was ambiguous about whether this meant production. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
Author
|
Deferring the CI-gap change (running acceptance tests on PRs) to a follow-up. The test-only fix has been split out to #103 for today's release. Branch |
mmaikel
added a commit
that referenced
this pull request
Jun 29, 2026
…er (#103) ## Problem `TestAccScorecardResourceComplete` fails because the scorecard filter fixtures hardcode `query = "owners_is_set"`, which the Cortex backend's CQL grammar no longer accepts: ``` 400 BAD_REQUEST: The [COMPOUND_FILTER] filter is not valid: "Invalid expression: owners_is_set" ``` Pre-existing breakage — the acceptance job last passed 2026-04-14 and hadn't run since; the grammar changed in between. Failing run: https://github.com/cortexapps/terraform-provider-cortex/actions/runs/28393079773/job/84125068576 ## Fix Replace `owners_is_set` with the current equivalent `ownership != null` across the fixtures and corresponding `TestCheckResourceAttr` assertions (8 occurrences). ## Verification Verified green by running the acceptance job against the production API on the sibling branch in #102 — `--- PASS: TestAccScorecardResourceComplete (9.53s)`. Note: the broader fix to run acceptance tests on PRs (currently main-only) is deferred to a follow-up. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
akwirick
approved these changes
Jun 29, 2026
keithfz
approved these changes
Jun 29, 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.
Two changes
Run acceptance tests on PRs (close the CI gap)
Acceptance tests previously ran only on push to
main, so live-tenant breakages surfaced only post-merge. Consolidatedmain-test.ymlintotest.ymlwith anacceptance-testjob that runs on push to main and same-repo PRs.Guards:
secrets.CORTEX_API_TOKENis never exposed to fork-triggered workflows; those remain verified after merge.cortex-acceptance-tenantconcurrency group (cancel-in-progress: false) because the tests share one live tenant with static resource tags, so concurrent runs would collide.Verification
gofmtclean,go vetpasses locally.🤖 Generated with Claude Code