fix(tests): the trigger backfill assumed keyword calls; three fixtures pass positionally (#4099)
CI & Build / Python lint (push) Successful in 3s
CI & Build / Plugin hooks (push) Successful in 9s
CI & Build / integration (push) Successful in 43s
CI & Build / TypeScript typecheck (push) Successful in 53s
CI & Build / Python tests (push) Successful in 1m33s
CI & Build / Build & push image (push) Successful in 21s
CI & Build / Python lint (push) Successful in 3s
CI & Build / Plugin hooks (push) Successful in 9s
CI & Build / integration (push) Successful in 43s
CI & Build / TypeScript typecheck (push) Successful in 53s
CI & Build / Python tests (push) Successful in 1m33s
CI & Build / Build & push image (push) Successful in 21s
CI run 6937 red — 3 collection errors, `positional argument follows keyword argument`, in the three integration fixtures that call the service positionally (`create_rule(topic.id, uid, "title", "statement")`). The script that added `when_to_apply=` to 15 fixtures inserted it as the FIRST argument, which is valid only where every other argument is already a keyword. Moved to the last argument in every call, which is legal in both styles, and the continuation indent now matches the surrounding arguments. Also repairs self-inflicted damage: the same script added a trigger to the two tests in test_rule_trigger_required.py whose whole purpose is to call the creators WITHOUT one. They would have stopped raising and the guard's own proof would have inverted — a test that passes for the opposite reason than the one it names, which is worse than a failing one. Caught by ast.parse across tests/ rather than by the next CI round trip. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01821k5B3Ysecp9fNYs92Kuy
This commit is contained in:
@@ -44,11 +44,11 @@ async def constraint():
|
||||
book = await rulebooks_svc.create_rulebook(uid, "Environment facts")
|
||||
topic = await rulebooks_svc.create_topic(book.id, uid, "ci")
|
||||
rule = await rulebooks_svc.create_rule(
|
||||
when_to_apply="when the moment this fixture stands in for arises",
|
||||
topic.id, uid, "The runner has no bash",
|
||||
"Write every `run:` step in POSIX sh.",
|
||||
verify_with="read the workflow's shell setting",
|
||||
expires_when="the runner can be given a bash shell",
|
||||
when_to_apply="when the moment this fixture stands in for arises",
|
||||
)
|
||||
async with async_session() as s:
|
||||
row = await s.get(Rule, rule.id)
|
||||
@@ -154,18 +154,18 @@ async def rulebook_of_three():
|
||||
book = await rulebooks_svc.create_rulebook(uid, "Sweep fixture")
|
||||
topic = await rulebooks_svc.create_topic(book.id, uid, "mixed")
|
||||
decision = await rulebooks_svc.create_rule(
|
||||
when_to_apply="when the moment this fixture stands in for arises",
|
||||
topic.id, uid, "dev is home", "Work directly on dev.",
|
||||
when_to_apply="when the moment this fixture stands in for arises",
|
||||
)
|
||||
never = await rulebooks_svc.create_rule(
|
||||
when_to_apply="when the moment this fixture stands in for arises",
|
||||
topic.id, uid, "The runner has no bash", "Use POSIX sh.",
|
||||
verify_with="read the workflow's shell setting",
|
||||
when_to_apply="when the moment this fixture stands in for arises",
|
||||
)
|
||||
stale = await rulebooks_svc.create_rule(
|
||||
when_to_apply="when the moment this fixture stands in for arises",
|
||||
topic.id, uid, "Bumps need a dashboard tick", "Tick it first.",
|
||||
verify_with="cat CI-runner/renovate/config.js",
|
||||
when_to_apply="when the moment this fixture stands in for arises",
|
||||
)
|
||||
async with async_session() as s:
|
||||
row = await s.get(Rule, stale.id)
|
||||
|
||||
Reference in New Issue
Block a user