Skip to content

Commit c7ea606

Browse files
frankbriaTest User
andauthored
fix(ci): unblock Full Lifecycle Tests workflow (#592)
* fix(ci): unblock Full Lifecycle Tests workflow Weekly scheduled run failed with `pytest: error: unrecognized arguments: --timeout=1800` because pytest-timeout was passed to pytest but never declared as a dev dependency. - Add pytest-timeout>=2.3.0 to [project.optional-dependencies].dev - Scope lifecycle job to `environment: staging` so it can resolve ANTHROPIC_API_KEY (currently only present on the staging env, not at repo level), otherwise conftest skips the entire suite. - Capture pytest stdout/stderr to artifacts/pytest.log via tee and use --basetemp inside the workspace, so failure artifacts upload even when pytest fails to start. * fix(test): drop invalid --execute flag from cf work batch run calls The lifecycle CLI test passed `--execute` to `cf work batch run`, but that flag only exists on `cf work start` (single task). Batch always executes (use `--dry-run` to preview). The flag was silently broken since the test was added (bdb6686) because the lifecycle suite was never green in CI — the pytest-timeout dep error masked it. Fixes the AssertionError surfaced by the first non-skipped lifecycle run after the dep fix: Error: No such option: --execute * fix(test): promote BACKLOG→READY in lifecycle fixture `cf tasks generate` creates tasks in BACKLOG status by design (the CLI prints next-step hints suggesting `cf tasks set status READY --all` to promote them). The lifecycle fixture skipped this step, so `cf work batch run --all-ready` returned "No READY tasks found" and exited 0 — the test passed the batch-run assertion but the agent never actually built anything, and acceptance checks correctly flagged the missing csv_stats.py. Add the promotion step to initialized_workspace and update the docstring (which still referenced the no-longer-valid --execute flag). --------- Co-authored-by: Test User <test@example.com>
1 parent ac19311 commit c7ea606

5 files changed

Lines changed: 31 additions & 6 deletions

File tree

.github/workflows/lifecycle.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ jobs:
3030
lifecycle:
3131
name: Lifecycle (${{ inputs.mode || 'cli' }} / ${{ inputs.model || 'haiku' }})
3232
runs-on: ubuntu-latest
33+
environment: staging
3334
timeout-minutes: 60
3435

3536
steps:
@@ -73,19 +74,24 @@ jobs:
7374
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
7475
CODEFRAME_LIFECYCLE_MODEL: ${{ inputs.model || 'haiku' }}
7576
run: |
77+
mkdir -p artifacts
7678
uv run pytest ${{ steps.tests.outputs.path }} \
7779
-m lifecycle \
7880
-v \
7981
--tb=long \
8082
--no-header \
8183
-p no:warnings \
82-
--timeout=1800
84+
--timeout=1800 \
85+
--basetemp=artifacts/pytest \
86+
2>&1 | tee artifacts/pytest.log
87+
exit "${PIPESTATUS[0]}"
8388
8489
- name: Upload test artifacts on failure
8590
if: failure()
8691
uses: actions/upload-artifact@v4
8792
with:
8893
name: lifecycle-failure-${{ github.run_id }}
8994
path: |
90-
/tmp/pytest-*/
95+
artifacts/
9196
retention-days: 7
97+
if-no-files-found: warn

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ dev = [
7070
"pytest-asyncio>=0.23.0",
7171
"pytest-cov>=4.1.0",
7272
"pytest-json-report>=1.5.0",
73+
"pytest-timeout>=2.3.0",
7374
"black>=24.1.0",
7475
"ruff>=0.2.0",
7576
"mypy>=1.8.0",

tests/lifecycle/conftest.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ def initialized_workspace(target_project_dir, cf, sample_prd_path):
9494
A workspace with:
9595
- cf init complete
9696
- PRD added
97-
- Tasks generated
98-
Ready for `cf work batch run --all-ready --execute`.
97+
- Tasks generated and promoted from BACKLOG → READY
98+
Ready for `cf work batch run --all-ready`.
9999
"""
100100
result = cf("init", str(target_project_dir), "--tech-stack", "Python with uv")
101101
assert result.returncode == 0, f"cf init failed:\n{result.stderr}"
@@ -110,4 +110,9 @@ def initialized_workspace(target_project_dir, cf, sample_prd_path):
110110
result = cf("tasks", "generate")
111111
assert result.returncode == 0, f"cf tasks generate failed:\n{result.stderr}"
112112

113+
# `cf tasks generate` creates BACKLOG tasks; promote to READY so the
114+
# batch runner picks them up via --all-ready.
115+
result = cf("tasks", "set", "status", "READY", "--all", "--from", "BACKLOG")
116+
assert result.returncode == 0, f"cf tasks set status READY failed:\n{result.stderr}"
117+
113118
return target_project_dir

tests/lifecycle/test_cli_lifecycle.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ def test_agent_builds_csv_stats_project(self, initialized_workspace, cf):
3939
result = cf(
4040
"work", "batch", "run",
4141
"--all-ready",
42-
"--execute",
4342
"--engine", "react",
4443
"--retry", "1",
4544
timeout=1800, # 30 min ceiling
@@ -68,7 +67,7 @@ def test_agent_task_status_after_execution(self, initialized_workspace, cf):
6867
"""All tasks reach DONE or BLOCKED status — none stuck in IN_PROGRESS."""
6968
cf(
7069
"work", "batch", "run",
71-
"--all-ready", "--execute", "--engine", "react",
70+
"--all-ready", "--engine", "react",
7271
timeout=1800,
7372
)
7473

uv.lock

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)