Skip to content

Commit f52b462

Browse files
committed
fix archive plugin smoke decompress params
1 parent daa5f39 commit f52b462

2 files changed

Lines changed: 19 additions & 1 deletion

File tree

examples/runbooks/runbooks/03-archive.check.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ tasks:
2525
with:
2626
archive: /tmp/app.tar.gz
2727
dest: /tmp/automax-demo
28-
source: /tmp/automax-demo.gz
2928
- id: archive_tar
3029
use: archive.tar
3130
with:

tests/test_documentation_and_regressions.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -644,6 +644,25 @@ def test_plugin_smoke_runbooks_keep_file_modes_as_strings():
644644

645645
assert offenders == []
646646

647+
648+
def test_plugin_smoke_runbooks_match_archive_decompress_parameters():
649+
runbook_path = Path("examples/runbooks/runbooks/03-archive.check.yaml")
650+
data = yaml.safe_load(runbook_path.read_text(encoding="utf-8"))
651+
offenders = []
652+
for task in data.get("tasks", []):
653+
for step in task.get("steps", []):
654+
for substep in step.get("substeps", []):
655+
if substep.get("use") != "archive.decompress":
656+
continue
657+
params = substep.get("with") or {}
658+
if "source" in params:
659+
offenders.append(
660+
f"{runbook_path}:{substep.get('id')}: "
661+
"source is not valid for archive.decompress"
662+
)
663+
664+
assert offenders == []
665+
647666
def test_docs_show_sudo_password_env_for_runs_and_capability_installs():
648667
docs = "\n".join(
649668
path.read_text(encoding="utf-8")

0 commit comments

Comments
 (0)