mirror of
https://github.com/github/spec-kit.git
synced 2026-07-03 12:28:06 +08:00
* Initial plan * feat!: remove legacy --ai, --ai-commands-dir, and --ai-skills flags at 0.10.0 * refactor(tests): rename stale test_ai_help_* methods to test_agent_config_* * fix: address review — derive agent folder for generic integration and remove redundant test - Security notice now falls back to integration_parsed_options['commands_dir'] when AGENT_CONFIG folder is None (generic integration). - Remove test_agent_config_includes_kiro_cli which duplicates the assertion in test_runtime_config_uses_kiro_cli_and_removes_q. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * docs: scrub all remaining --ai flag references from source and tests - Remove dead AI_ASSISTANT_ALIASES, AI_ASSISTANT_HELP, and _build_ai_assistant_help() from _agent_config.py - Update comments/docstrings in extensions.py, presets.py, and integration subpackages to reference 'skills mode' or '--integration' instead of the removed flags - Fix catalog.json generic integration description - Update test docstrings/comments in test_extension_skills.py, test_extensions.py, and test_presets.py Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * test: remove legacy --ai flag rejection tests The flags are fully removed from the CLI; typer handles unknown options generically. No custom rejection logic exists to test. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * revert: remove manual CHANGELOG.md entry CHANGELOG is generated automatically; manual edits should not be made. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix: make generic catalog description self-explanatory Include the required --commands-dir sub-option in the description so readers don't need to look up integration docs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix(tests): rename duplicate test classes to avoid shadowing The rename from Test*AutoPromote to Test*Integration collided with the existing Test*Integration(SkillsIntegrationTests) base classes, causing the shared test suites to be silently overwritten. Rename the CLI init flow classes to Test*InitFlow instead. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Manfred Riem <mnriem@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
75 lines
2.9 KiB
Python
75 lines
2.9 KiB
Python
"""Tests for DevinIntegration."""
|
|
|
|
from .test_integration_base_skills import SkillsIntegrationTests
|
|
|
|
|
|
class TestDevinIntegration(SkillsIntegrationTests):
|
|
KEY = "devin"
|
|
FOLDER = ".devin/"
|
|
COMMANDS_SUBDIR = "skills"
|
|
REGISTRAR_DIR = ".devin/skills"
|
|
CONTEXT_FILE = "AGENTS.md"
|
|
|
|
|
|
class TestDevinBuildExecArgs:
|
|
"""Regression tests for DevinIntegration.build_exec_args.
|
|
|
|
Devin's CLI has no --output-format flag, so build_exec_args must
|
|
omit it regardless of the output_json argument. The integration
|
|
must also remain dispatchable (must not return None, which is the
|
|
codebase's IDE-only sentinel checked by CommandStep).
|
|
"""
|
|
|
|
def test_returns_args_not_none_for_dispatch(self):
|
|
"""Devin is CLI-dispatchable; build_exec_args must not return None."""
|
|
from specify_cli.integrations.devin import DevinIntegration
|
|
|
|
impl = DevinIntegration()
|
|
args = impl.build_exec_args("test prompt")
|
|
assert args is not None, (
|
|
"DevinIntegration.build_exec_args must not return None. "
|
|
"None is the codebase sentinel for IDE-only integrations "
|
|
"(see WindsurfIntegration); Devin is dispatchable via 'devin -p'."
|
|
)
|
|
assert args[:3] == ["devin", "-p", "test prompt"]
|
|
|
|
def test_output_json_does_not_emit_output_format_flag(self):
|
|
"""Devin has no --output-format flag; output_json=True must not add it."""
|
|
from specify_cli.integrations.devin import DevinIntegration
|
|
|
|
impl = DevinIntegration()
|
|
args_json = impl.build_exec_args("hello", output_json=True)
|
|
args_text = impl.build_exec_args("hello", output_json=False)
|
|
|
|
assert "--output-format" not in args_json
|
|
assert "json" not in args_json[3:]
|
|
# The two should be identical: output_json is documented as having
|
|
# no effect on the command line for Devin (plain-text stdout).
|
|
assert args_json == args_text
|
|
|
|
def test_model_flag_passed_through(self):
|
|
"""--model is supported and should appear when provided."""
|
|
from specify_cli.integrations.devin import DevinIntegration
|
|
|
|
impl = DevinIntegration()
|
|
args = impl.build_exec_args("hi", model="claude-sonnet-4")
|
|
assert args == ["devin", "-p", "hi", "--model", "claude-sonnet-4"]
|
|
|
|
|
|
class TestDevinInitFlow:
|
|
"""--integration devin creates expected files."""
|
|
|
|
def test_integration_devin_creates_skills(self, tmp_path):
|
|
"""--integration devin should create skills directory."""
|
|
from typer.testing import CliRunner
|
|
from specify_cli import app
|
|
|
|
runner = CliRunner()
|
|
target = tmp_path / "test-proj"
|
|
result = runner.invoke(
|
|
app,
|
|
["init", str(target), "--integration", "devin", "--no-git", "--ignore-agent-tools", "--script", "sh"],
|
|
)
|
|
|
|
assert result.exit_code == 0, f"init --integration devin failed: {result.output}"
|
|
assert (target / ".devin" / "skills" / "speckit-plan" / "SKILL.md").exists() |