summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/asset/publish/from_dependency.yaml89
-rw-r--r--test/script/common.et26
-rw-r--r--test/script/publish.et44
-rw-r--r--test/script/run.et26
4 files changed, 161 insertions, 24 deletions
diff --git a/test/asset/publish/from_dependency.yaml b/test/asset/publish/from_dependency.yaml
new file mode 100644
index 0000000..40268fc
--- /dev/null
+++ b/test/asset/publish/from_dependency.yaml
@@ -0,0 +1,89 @@
+destination first:
+ url: ./first/dest
+
+destination second:
+ url: ./second/dest
+
+destination third:
+
+destination fourth:
+
+destination fifth:
+
+
+job gen:
+ checkout:
+
+ shell:
+ - mkdir dir
+ - mkdir dir2
+ - mkdir dir2/subdir
+ - touch x
+ - touch dir/y
+ - touch dir2/z2
+ - touch dir2/subdir/z
+
+ artifact x:
+ path: ./x
+
+ artifact y:
+ path: ./dir/y
+
+ artifact z:
+ path: ./dir2/subdir/z
+
+ artifact dir:
+ path: ./dir
+
+ artifact dir2:
+ path: ./dir2
+
+ artifact dir2_subdir:
+ path: ./dir2/subdir
+
+
+job publish:
+ shell:
+ - "true"
+
+ checkout:
+
+ publish:
+ - to: first
+ artifact: gen.x
+
+ - to: first
+ artifact: gen.y
+
+ - to: second
+ artifact: gen.z
+
+ - to: third
+ artifact: gen.dir
+
+ - to: third
+ artifact: gen.dir2_subdir
+
+ - to: fourth
+ artifact: gen.x
+ path: path/for/artifact
+
+ - to: fourth
+ artifact: gen.x
+ path: dir/for/artifact/
+
+ - to: fifth
+ artifact: gen.dir2_subdir
+ path: path/for/artifact
+
+ - to: fifth
+ artifact: gen.dir2_subdir
+ path: dir/for/artifact/
+
+ - to: fifth
+ artifact: gen.dir2
+ path: path2/for/artifact
+
+ - to: fifth
+ artifact: gen.dir2
+ path: dir2/for/artifact/
diff --git a/test/script/common.et b/test/script/common.et
new file mode 100644
index 0000000..8875c79
--- /dev/null
+++ b/test/script/common.et
@@ -0,0 +1,26 @@
+module common
+
+
+export def expect_result from p of job result result:
+ let dummy = job == "" # TODO: forces string type
+ expect from p:
+ /job-start $job/
+ /job-finish $job ([a-z]+)/ capture done
+ guard (done == result)
+
+export def expect_previous_result from p of job result result:
+ let dummy = job == "" # TODO: forces string type
+ expect from p:
+ /job-previous $job ([a-z]+)/ capture done
+ guard (done == result)
+
+export def expect_success from p of job:
+ expect_result from p of job result "done"
+
+export def expect_previous_success from p of job:
+ expect_previous_result from p of job result "done"
+
+export def expect_skip from p of job:
+ let dummy = job == "" # TODO: forces string type
+ expect from p:
+ /job-skip $job/
diff --git a/test/script/publish.et b/test/script/publish.et
new file mode 100644
index 0000000..d5756cb
--- /dev/null
+++ b/test/script/publish.et
@@ -0,0 +1,44 @@
+module publish
+
+import common
+
+
+asset scripts:
+ path: ../asset/publish
+
+
+test PublishFromDependency:
+ node n
+ shell on n:
+ mkdir workdir
+ cp ${scripts.path}/from_dependency.yaml workdir/minici.yaml
+
+ spawn on n as p args [ "--destination=second:second_override", "--destination=third:./third", "--destination=fourth:fourth/with_dir", "--destination=fifth:fifth/with_dir", "workdir/minici.yaml", "run", "publish" ]
+ expect_result from p:
+ of "gen" result "done"
+ of "publish" result "done"
+ local:
+ expect /(.*)/ from p capture done
+ guard (done == "run-finish")
+
+ shell on n as listing:
+ find . -path ./workdir/.minici -prune -o -type f -print
+ echo DONE
+
+ expect from listing:
+ /.\/workdir\/minici.yaml/
+ /.\/workdir\/first\/dest\/x/
+ /.\/workdir\/first\/dest\/dir\/y/
+ /.\/second_override\/dir2\/subdir\/z/
+ /.\/third\/dir\/y/
+ /.\/third\/dir2\/subdir\/z/
+ /.\/fourth\/with_dir\/path\/for\/artifact/
+ /.\/fourth\/with_dir\/dir\/for\/artifact\/x/
+ /.\/fifth\/with_dir\/path\/for\/artifact\/z/
+ /.\/fifth\/with_dir\/dir\/for\/artifact\/subdir\/z/
+ /.\/fifth\/with_dir\/path2\/for\/artifact\/z2/
+ /.\/fifth\/with_dir\/path2\/for\/artifact\/subdir\/z/
+ /.\/fifth\/with_dir\/dir2\/for\/artifact\/dir2\/z2/
+ /.\/fifth\/with_dir\/dir2\/for\/artifact\/dir2\/subdir\/z/
+ /(.*)/ capture done
+ guard (done == "DONE")
diff --git a/test/script/run.et b/test/script/run.et
index 7c3fb38..f33c2fa 100644
--- a/test/script/run.et
+++ b/test/script/run.et
@@ -1,32 +1,10 @@
module run
+import common
+
asset scripts:
path: ../asset/run
-def expect_result from p of job result result:
- let dummy = job == ""
- expect from p:
- /job-start $job/
- /job-finish $job ([a-z]+)/ capture done
- guard (done == result)
-
-def expect_previous_result from p of job result result:
- let dummy = job == "" # TODO: forces string type
- expect from p:
- /job-previous $job ([a-z]+)/ capture done
- guard (done == result)
-
-def expect_success from p of job:
- expect_result from p of job result "done"
-
-def expect_previous_success from p of job:
- expect_previous_result from p of job result "done"
-
-def expect_skip from p of job:
- let dummy = job == "" # TODO: forces string type
- expect from p:
- /job-skip $job/
-
test RunWithoutRepo:
node n