refactor(xcf_stack): use explicit inputs for layer list and scheduling
Replace prior_steps and runs_last with inputs=[...] step refs so GIMP export waits only on listed layers. Add rezepttest pipeline and bokeh-oktagon recipe. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+13
-7
@@ -41,7 +41,7 @@ class TestModuleRegistration:
|
||||
def test_get_module_returns_xcf_stack_class(self) -> None:
|
||||
assert get_module("xcf_stack") is XcfStackModule
|
||||
|
||||
def test_xcf_stack_runs_last(self) -> None:
|
||||
def test_xcf_stack_waits_for_layer_inputs(self) -> None:
|
||||
from imagepipeline.core.runner import PipelineRunner
|
||||
from imagepipeline.core.step import StepDefinition
|
||||
from imagepipeline.modules.imagemagick_grayscale import ImageMagickGrayscale
|
||||
@@ -51,7 +51,7 @@ class TestModuleRegistration:
|
||||
step_id="xcf_stack_01",
|
||||
module_name="xcf_stack",
|
||||
module=XcfStackModule,
|
||||
input_refs=["input"],
|
||||
input_refs=["input", "imagemagick_grayscale_01"],
|
||||
params={},
|
||||
output_dir_name="xcf_stack_01",
|
||||
),
|
||||
@@ -71,7 +71,10 @@ class TestModuleRegistration:
|
||||
steps=steps,
|
||||
)
|
||||
ordered = runner._topological_sort()
|
||||
assert ordered[-1].module_name == "xcf_stack"
|
||||
assert [step.step_id for step in ordered] == [
|
||||
"imagemagick_grayscale_01",
|
||||
"xcf_stack_01",
|
||||
]
|
||||
|
||||
|
||||
class TestExpectedOutputFilenames:
|
||||
@@ -116,7 +119,7 @@ def _make_stack_fixture(tmp_path: Path) -> dict[str, Path]:
|
||||
|
||||
class TestXcfStackRun:
|
||||
@patch("imagepipeline.modules.xcf_stack.stack_images_to_xcf")
|
||||
def test_collects_layers_from_input_and_prior_steps(
|
||||
def test_collects_layers_from_explicit_inputs(
|
||||
self, mock_stack: object, tmp_path: Path
|
||||
) -> None:
|
||||
paths = _make_stack_fixture(tmp_path)
|
||||
@@ -130,7 +133,8 @@ class TestXcfStackRun:
|
||||
params=XcfStackModule.validate_module_params({}),
|
||||
pipeline_output_root=paths["root"],
|
||||
step_id="xcf_stack_01",
|
||||
prior_steps=[
|
||||
input_layer_dirs=[
|
||||
("input", paths["input_dir"]),
|
||||
("step_a", paths["step_a"]),
|
||||
("step_b", paths["step_b"]),
|
||||
],
|
||||
@@ -161,7 +165,8 @@ class TestXcfStackRun:
|
||||
params=XcfStackModule.validate_module_params({"skip_missing": True}),
|
||||
pipeline_output_root=paths["root"],
|
||||
step_id="xcf_stack_01",
|
||||
prior_steps=[
|
||||
input_layer_dirs=[
|
||||
("input", paths["input_dir"]),
|
||||
("step_a", paths["step_a"]),
|
||||
("step_b", paths["step_b"]),
|
||||
],
|
||||
@@ -187,7 +192,8 @@ class TestXcfStackRun:
|
||||
params=XcfStackModule.validate_module_params({"skip_missing": False}),
|
||||
pipeline_output_root=paths["root"],
|
||||
step_id="xcf_stack_01",
|
||||
prior_steps=[
|
||||
input_layer_dirs=[
|
||||
("input", paths["input_dir"]),
|
||||
("step_a", paths["step_a"]),
|
||||
("step_b", paths["step_b"]),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user