@@ -10273,6 +10273,68 @@ def test_lowercase_extension_still_installs(self, temp_dir, monkeypatch, sample_
1027310273 assert result.exit_code == 0, result.output
1027410274 assert "installed" in result.output
1027510275
10276+ def test_add_installs_workflow_with_custom_step(self, temp_dir, monkeypatch):
10277+ from typer.testing import CliRunner
10278+ from specify_cli import app
10279+
10280+ (temp_dir / ".specify" / "workflows").mkdir(parents=True)
10281+ step_dir = temp_dir / ".specify" / "workflows" / "steps" / "test-add-step"
10282+ step_dir.mkdir(parents=True)
10283+ step_manifest = {
10284+ "schema_version": "1.0",
10285+ "step": {
10286+ "type_key": "test-add-step",
10287+ "name": "Test Add Step",
10288+ "version": "1.0.0",
10289+ },
10290+ }
10291+ (step_dir / "step.yml").write_text(
10292+ yaml.safe_dump(step_manifest, sort_keys=False),
10293+ encoding="utf-8",
10294+ )
10295+ (step_dir / "__init__.py").write_text(
10296+ """
10297+ from specify_cli.workflows.base import StepBase, StepResult
10298+
10299+
10300+ class TestAddStep(StepBase):
10301+ type_key = "test-add-step"
10302+
10303+ def execute(self, config, context):
10304+ return StepResult()
10305+ """,
10306+ encoding="utf-8",
10307+ )
10308+
10309+ src = temp_dir / "sample.yml"
10310+ workflow_definition = {
10311+ "schema_version": "1.0",
10312+ "workflow": {
10313+ "id": "test-workflow-with-custom-step",
10314+ "name": "Test Workflow With Custom Step",
10315+ "version": "1.0.0",
10316+ },
10317+ "steps": [
10318+ {"id": "custom-step", "type": "test-add-step"},
10319+ ],
10320+ }
10321+ src.write_text(
10322+ yaml.safe_dump(workflow_definition, sort_keys=False),
10323+ encoding="utf-8",
10324+ )
10325+ monkeypatch.chdir(temp_dir)
10326+ result = CliRunner().invoke(app, ["workflow", "add", str(src)])
10327+
10328+ assert result.exit_code == 0, result.output
10329+ installed_workflow = (
10330+ temp_dir
10331+ / ".specify"
10332+ / "workflows"
10333+ / "test-workflow-with-custom-step"
10334+ / "workflow.yml"
10335+ )
10336+ assert installed_workflow.is_file()
10337+
1027610338
1027710339class TestWorkflowInfoStepGraph:
1027810340 """`workflow info` must render each step as `→ <id> [<type>]` with LITERAL
0 commit comments