Skip to content

Commit bf191d9

Browse files
committed
fix(tests): align gen-test-tasks assertions with v4.1 calc-tasks floor
Follow-up to bb269b5 (context-aware task count formula). v4.1 dropped the calc-tasks floor from 10 to 3 and added the [3, 25] clamp, which broke two test assumptions: - test_user_e2e: replace `>= 10` with `3 <= recommended <= 25` - both files: `gen-test-tasks` needs >=5 tasks to emit a USER-TEST checkpoint; use max(5, recommended) so small PRDs still exercise the checkpoint path. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 851a8c1 commit bf191d9

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

tests/test_edge_cases.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,9 +296,12 @@ def test_full_workflow_preflight_to_validate(self, tmp_project, sample_prd, samp
296296
rc, calc = run_script(SCRIPT_PY, ["calc-tasks", "--requirements", "6"])
297297
assert rc == 0
298298

299-
# Step 4: Generate test tasks
299+
# Step 4: Generate test tasks — gen-test-tasks inserts a checkpoint
300+
# every 5 tasks, so we need >= 5. v4.1 calc-tasks may recommend
301+
# fewer than 5 for small PRDs (floor is 3, not 10), so use max.
302+
total_for_checkpoints = max(5, calc["recommended"])
300303
rc, test_tasks = run_script(SCRIPT_PY, [
301-
"gen-test-tasks", "--total", str(calc["recommended"])
304+
"gen-test-tasks", "--total", str(total_for_checkpoints)
302305
])
303306
assert rc == 0
304307
assert test_tasks["test_tasks_generated"] > 0

tests/test_user_e2e.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,17 @@ def test_step3_full_workflow_end_to_end(self, user_project):
8484
num_reqs = int(num_match.group(1)) if num_match else 5
8585
rc, calc = run_script(SCRIPT_PY, ["calc-tasks", "--requirements", str(num_reqs)])
8686
assert rc == 0
87-
assert calc["recommended"] >= 10
88-
89-
# Step 9: Generate test checkpoints
87+
# v4.1 calc-tasks floor is 3 (was 10). Recommended is context-aware
88+
# and clamped to [3, 25]. For an e2e test that doesn't pin team/scope,
89+
# assert the value is within the clamp window.
90+
assert 3 <= calc["recommended"] <= 25
91+
92+
# gen-test-tasks needs at least 5 tasks to produce a checkpoint
93+
# (inserts a USER-TEST every 5 tasks). Use max(5, recommended) so
94+
# the downstream step still has something to assert on.
95+
total_for_checkpoints = max(5, calc["recommended"])
9096
rc, checkpoints = run_script(SCRIPT_PY, [
91-
"gen-test-tasks", "--total", str(calc["recommended"])
97+
"gen-test-tasks", "--total", str(total_for_checkpoints)
9298
])
9399
assert rc == 0
94100
assert checkpoints["test_tasks_generated"] >= 1

0 commit comments

Comments
 (0)