summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2025-11-30 13:27:58 +0100
committerRoman Smrž <roman.smrz@seznam.cz>2025-11-30 13:27:58 +0100
commit2ed70fa5d64bfcafd14dcc2d66ac0b95d4a85b26 (patch)
treef7603d88e6a9ad3e2c145ebb5df596c228de2ef2 /test
parent60d653c05420f4ca7b41e73bb252268c34d946fe (diff)
Implement and test ‘extract --force’ without copyRecursiveForce
Diffstat (limited to 'test')
-rw-r--r--test/script/artifact.et83
1 files changed, 83 insertions, 0 deletions
diff --git a/test/script/artifact.et b/test/script/artifact.et
index c2bfc30..d353b49 100644
--- a/test/script/artifact.et
+++ b/test/script/artifact.et
@@ -43,3 +43,86 @@ test ExtractArtifact:
shell on n as s:
cat ./extracted_subdir/fb
expect /content b/ from s
+
+
+test ExtractArtifactForce:
+ node n
+ local:
+ spawn on n as p args [ "--storage=.minici", "${scripts.path}/minici.yaml", "run", "generate" ]
+ expect /job-finish generate done/ from p
+
+ # TODO: test failure without --force
+ #local:
+ # shell on n:
+ # touch extracted
+ # spawn on n as p args [ "--storage=.minici", "${scripts.path}/minici.yaml", "extract", "generate.first", "extracted" ]
+ #local:
+
+ local:
+ shell on n:
+ touch extracted
+ spawn on n as p args [ "--storage=.minici", "${scripts.path}/minici.yaml", "extract", "--force", "generate.first", "extracted" ]
+ local:
+ shell on n as s:
+ cat ./extracted
+ expect /content 1/ from s
+
+ # TODO: test failure without --force
+ #local:
+ # shell on n:
+ # touch f1
+ # spawn on n as p args [ "--storage=.minici", "${scripts.path}/minici.yaml", "extract", "generate.first", "." ]
+ #local:
+
+ local:
+ shell on n:
+ touch f1
+ spawn on n as p args [ "--storage=.minici", "${scripts.path}/minici.yaml", "extract", "--force", "generate.first", "." ]
+ local:
+ shell on n as s:
+ cat ./f1
+ expect /content 1/ from s
+
+ # TODO: test failure without --force
+ #local:
+ # shell on n:
+ # mkdir dir
+ # touch dir/existing_file
+ # spawn on n as p args [ "--storage=.minici", "${scripts.path}/minici.yaml", "extract", "generate.dir", "." ]
+ #local:
+
+ local:
+ shell on n:
+ mkdir dir
+ touch dir/existing_file
+ spawn on n as p args [ "--storage=.minici", "${scripts.path}/minici.yaml", "extract", "--force", "generate.dir", "." ]
+ local:
+ shell on n as s:
+ ls dir
+ echo DONE
+ expect /f2/ from s
+ expect /fa/ from s
+ expect /subdir/ from s
+ expect /(.*)/ from s capture done
+ guard (done == "DONE")
+
+ # TODO: test failure without --force
+ #local:
+ # shell on n:
+ # touch dir
+ # spawn on n as p args [ "--storage=.minici", "${scripts.path}/minici.yaml", "extract", "generate.dir", "." ]
+ #local:
+
+ local:
+ shell on n:
+ touch dir
+ spawn on n as p args [ "--storage=.minici", "${scripts.path}/minici.yaml", "extract", "--force", "generate.dir", "." ]
+ local:
+ shell on n as s:
+ ls dir
+ echo DONE
+ expect /f2/ from s
+ expect /fa/ from s
+ expect /subdir/ from s
+ expect /(.*)/ from s capture done
+ guard (done == "DONE")