Skip to content

Run the template-switch test only in the template repo - #2

Open
kaarthi19 wants to merge 1 commit into
mainfrom
fix/template-switch-test-only-in-template
Open

kaarthi19 wants to merge 1 commit into
mainfrom
fix/template-switch-test-only-in-template

Conversation

@kaarthi19

Copy link
Copy Markdown
Collaborator

What this changes

  • test_shipped_config_has_the_switch_off_for_the_template now skips unless ARGUS_IS_TEMPLATE=true.
  • ci.yml sets ARGUS_IS_TEMPLATE from github.event.repository.is_template. That is true only in Power-Lab/argus, so the template keeps its guard.
  • CHANGELOG entry under [Unreleased].

Why

That test is inherited by every repository created from the template. README step 5 tells users to set enabled: true, and doing so makes their CI fail. This happened in east-winds/argus: the PI enabled the sweep, CI failed, and a Copilot PR "fixed" it by switching the sweep back off. Since then their scheduled runs have been green but have collected nothing.

Testing

Ran pytest locally in four cases:

Config ARGUS_IS_TEMPLATE Result
enabled: false true 40 passed
enabled: false unset 39 passed, 1 skipped
enabled: true false 39 passed, 1 skipped
enabled: true true 1 failed (the guard still catches it in the template)

Checklist

  • make test passes locally
  • Added or updated a test — and it fails without this change (case 3 fails before this change)
  • Any dates in test fixtures are relative
  • Still works with no API key present
  • A failure introduced here stays contained and doesn't kill a run
  • No new dependency
  • CHANGELOG.md updated under ## [Unreleased]

Anything reviewers should look at closely

Run locally, make test now skips this check unless you export ARGUS_IS_TEMPLATE=true. CI in the template still enforces it.

🤖 Generated with Claude Code

test_shipped_config_has_the_switch_off_for_the_template is inherited by
every repository created from the template, so following README step 5
(enabled: true) turned that copy's CI red. Gate it on GitHub's
is_template flag, passed to pytest as ARGUS_IS_TEMPLATE.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

1 participant