-
Notifications
You must be signed in to change notification settings - Fork 0
Implementation Plan: Move smoke-test recipe from bundled to project-local #612
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
2881d92
be176b0
fc84162
77f4363
0724f26
df264ed
bfa209a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,7 +11,6 @@ | |
| "remediation", | ||
| "implementation-groups", | ||
| "merge-prs", | ||
| "smoke-test", | ||
| ] | ||
|
|
||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,7 +36,7 @@ | |
| test_check.__test__ = False # type: ignore[attr-defined] | ||
|
|
||
| PROJECT_ROOT = Path(__file__).resolve().parent.parent.parent | ||
| SMOKE_SCRIPT = builtin_recipes_dir() / "smoke-test.yaml" | ||
| SMOKE_SCRIPT = PROJECT_ROOT / ".autoskillit" / "recipes" / "smoke-test.yaml" | ||
|
|
||
| _TOOL_MAP = { | ||
| "run_cmd": run_cmd, | ||
|
|
@@ -194,7 +194,7 @@ def _is_success(self, step_def: dict, result: dict) -> bool: | |
| def smoke_recipe(): | ||
| from autoskillit.recipe.io import load_recipe as _load_recipe | ||
|
|
||
| return _load_recipe(builtin_recipes_dir() / "smoke-test.yaml") | ||
| return _load_recipe(SMOKE_SCRIPT) | ||
|
|
||
|
|
||
| @pytest.fixture() | ||
|
|
@@ -204,11 +204,16 @@ def smoke_script_path() -> Path: | |
|
|
||
| @pytest.fixture() | ||
| def smoke_project(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> Path: | ||
| """Create a temp project dir for smoke tests. | ||
| """Create a temp project dir with smoke-test as a project-local recipe. | ||
|
|
||
| Bundled recipes (including smoke-test) are discovered via recipe_parser, | ||
| so no recipe files need to be copied into the project dir. | ||
| smoke-test is a project-local recipe (not bundled), so it must be copied | ||
| into the temp dir's .autoskillit/recipes/ for discovery via list_recipes(). | ||
| """ | ||
| import shutil | ||
|
|
||
| recipes_dir = tmp_path / ".autoskillit" / "recipes" | ||
| recipes_dir.mkdir(parents=True) | ||
| shutil.copy2(SMOKE_SCRIPT, recipes_dir / "smoke-test.yaml") | ||
| monkeypatch.chdir(tmp_path) | ||
| return tmp_path | ||
|
|
||
|
|
@@ -404,6 +409,32 @@ async def test_assess_step_references_bug_report(self) -> None: | |
| assess_cmd = pipeline["steps"]["assess"]["with"]["skill_command"] | ||
| assert "bug_report.json" in assess_cmd | ||
|
|
||
| def test_smoke_test_not_in_bundled_dir(self) -> None: | ||
| """smoke-test.yaml must not exist in the bundled recipes directory.""" | ||
| assert not (builtin_recipes_dir() / "smoke-test.yaml").exists() | ||
|
|
||
| def test_smoke_test_exists_in_project_local(self) -> None: | ||
Trecek marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| """smoke-test.yaml must exist in the project-local recipes directory.""" | ||
| assert SMOKE_SCRIPT.exists(), f"Expected smoke-test at {SMOKE_SCRIPT}" | ||
|
|
||
| async def test_smoke_test_source_is_project(self, smoke_project: Path) -> None: | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [warning] arch:
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Investigated — this is intentional. list_recipes() calls Path.cwd() at runtime (tools_recipe.py:50: tool_ctx.recipes.list_all(Path.cwd())), so no module-level caching occurs. The smoke_project fixture's monkeypatch.chdir(tmp_path) correctly sets the CWD used when list_recipes() is called. This pattern is already validated bidirectionally by test_smoke_test_invisible_from_external_project (lines 426-435) which confirms CWD-awareness in both directions. |
||
| """smoke-test must be listed with source PROJECT, not BUILTIN.""" | ||
| result = json.loads(await list_recipes()) | ||
| smoke = next((r for r in result["recipes"] if r["name"] == "smoke-test"), None) | ||
| assert smoke is not None, "smoke-test not found in list_recipes output" | ||
| assert smoke["source"] == "project" | ||
|
|
||
| async def test_smoke_test_invisible_from_external_project( | ||
| self, tmp_path: Path, monkeypatch: pytest.MonkeyPatch | ||
| ) -> None: | ||
| """smoke-test must NOT appear in list_recipes from a project without it.""" | ||
| bare_dir = tmp_path / "external" | ||
| bare_dir.mkdir() | ||
| monkeypatch.chdir(bare_dir) | ||
| result = json.loads(await list_recipes()) | ||
| names = [r["name"] for r in result["recipes"]] | ||
| assert "smoke-test" not in names | ||
|
|
||
|
|
||
| def test_smoke_commit_dirty_step_exists(smoke_recipe) -> None: | ||
| """commit_dirty step must exist and route back to merge.""" | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.