summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/asset/artifact/minici.yaml25
-rw-r--r--test/asset/publish/from_dependency.yaml84
-rw-r--r--test/asset/publish/from_self.yaml22
-rw-r--r--test/asset/repo/checkout.yaml105
-rw-r--r--test/asset/run/dependencies.yaml62
-rw-r--r--test/asset/run/explicit.yaml7
-rw-r--r--test/asset/run/external.yaml42
-rw-r--r--test/asset/run/many_repos.yaml109
-rw-r--r--test/asset/run/norepo-basic.yaml20
-rw-r--r--test/asset/run/repo-basic.yaml7
-rw-r--r--test/asset/run/repo-basic2.yaml15
-rw-r--r--test/asset/run/rerun.yaml45
-rw-r--r--test/script/artifact.et128
-rw-r--r--test/script/common.et26
-rw-r--r--test/script/publish.et69
-rw-r--r--test/script/repo.et327
-rw-r--r--test/script/run.et632
17 files changed, 1725 insertions, 0 deletions
diff --git a/test/asset/artifact/minici.yaml b/test/asset/artifact/minici.yaml
new file mode 100644
index 0000000..7204bb3
--- /dev/null
+++ b/test/asset/artifact/minici.yaml
@@ -0,0 +1,25 @@
+job generate:
+ checkout: null
+
+ shell:
+ - echo "content 1" > f1
+ - mkdir -p dir/subdir
+ - echo "content 2" > dir/f2
+ - echo "content a" > dir/fa
+ - echo "content b" > dir/subdir/fb
+ - echo "content 3" > f3
+
+ artifact first:
+ path: f1
+
+ artifact second:
+ path: dir/f2
+
+ artifact third:
+ path: f3
+
+ artifact dir:
+ path: dir
+
+ artifact sdir:
+ path: dir/subdir
diff --git a/test/asset/publish/from_dependency.yaml b/test/asset/publish/from_dependency.yaml
new file mode 100644
index 0000000..6bbfbf8
--- /dev/null
+++ b/test/asset/publish/from_dependency.yaml
@@ -0,0 +1,84 @@
+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:
+ 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/asset/publish/from_self.yaml b/test/asset/publish/from_self.yaml
new file mode 100644
index 0000000..92d10e9
--- /dev/null
+++ b/test/asset/publish/from_self.yaml
@@ -0,0 +1,22 @@
+destination dest:
+
+
+job gen_publish:
+ checkout:
+
+ shell:
+ - touch x
+ - touch y
+
+ artifact x:
+ path: x
+
+ artifact y:
+ path: y
+
+ publish:
+ - to: dest
+ artifact: x
+
+ - to: dest
+ artifact: gen_publish.y
diff --git a/test/asset/repo/checkout.yaml b/test/asset/repo/checkout.yaml
new file mode 100644
index 0000000..05e0e99
--- /dev/null
+++ b/test/asset/repo/checkout.yaml
@@ -0,0 +1,105 @@
+repo r1:
+repo r2:
+repo r3:
+
+job checkout_subtree:
+ checkout:
+ - repo: r1
+ dest: d1
+
+ - repo: r2
+ subtree: s1
+ dest: d2_s1
+
+ shell:
+ - find \! -name 'list?' -type f > list1
+
+ artifact out:
+ path: list1
+
+
+job checkout_common_root:
+ checkout:
+ - repo: r1
+ dest: d1
+
+ - repo: r2
+ subtree: s1
+ dest: d2_s1
+
+ - repo: r2
+ subtree: s2
+ dest: d2_s2
+
+ shell:
+ - find \! -name 'list?' -type f > list2
+
+ artifact out:
+ path: list2
+
+
+job checkout_common_subtree:
+ checkout:
+ - repo: r3
+ subtree: a/b/s1
+ dest: d3_s1
+
+ - repo: r3
+ subtree: a/b/c/s2
+ dest: d3_s2
+
+ shell:
+ - find \! -name 'list?' -type f > list3
+
+ artifact out:
+ path: list3
+
+
+job checkout_common_subtree2:
+ checkout:
+ - repo: r1
+ dest: d1
+
+ - repo: r2
+ subtree: s1
+ dest: d2_s1
+
+ - repo: r3
+ subtree: a/b/c/s2
+ dest: d3_s2
+
+ - repo: r3
+ subtree: a/b/c/s3
+ dest: d3_s3
+
+ shell:
+ - find \! -name 'list?' -type f > list4
+
+ artifact out:
+ path: list4
+
+
+job combined_subtree:
+ uses:
+ - checkout_common_root.out
+ - checkout_common_subtree2.out
+
+ shell:
+ - find \! -name 'list5' -type f > list5
+
+ artifact out:
+ path: list5
+
+
+job combined_all:
+ uses:
+ - checkout_subtree.out
+ - checkout_common_root.out
+ - checkout_common_subtree.out
+ - checkout_common_subtree2.out
+
+ shell:
+ - find \! -name 'list6' -type f > list6
+
+ artifact out:
+ path: list6
diff --git a/test/asset/run/dependencies.yaml b/test/asset/run/dependencies.yaml
new file mode 100644
index 0000000..13d5e63
--- /dev/null
+++ b/test/asset/run/dependencies.yaml
@@ -0,0 +1,62 @@
+repo other:
+
+job first:
+ shell:
+ - touch x
+
+ artifact out:
+ path: x
+
+
+job second:
+ uses:
+ - first.out
+
+ shell:
+ - mv x y
+
+ artifact out:
+ path: y
+
+
+job third:
+ uses:
+ - first.out
+
+ shell:
+ - mv x z
+
+ artifact out:
+ path: z
+
+
+job fourth:
+ checkout:
+ - dest: a
+ - repo: other
+ dest: b
+
+ uses:
+ - second.out
+
+ shell:
+ - mv y w
+
+ artifact out:
+ path: w
+
+
+job fifth:
+ uses:
+ - third.out
+ - fourth.out
+
+ shell:
+ - mv z z2
+ - mv w w2
+
+ artifact out1:
+ path: z2
+
+ artifact out2:
+ path: w2
diff --git a/test/asset/run/explicit.yaml b/test/asset/run/explicit.yaml
new file mode 100644
index 0000000..d543d16
--- /dev/null
+++ b/test/asset/run/explicit.yaml
@@ -0,0 +1,7 @@
+job build:
+ shell:
+ - ls subdir | sed -e ':a;N;s/\n/ /;ta' > list
+ - echo >> list
+
+ artifact out:
+ path: list
diff --git a/test/asset/run/external.yaml b/test/asset/run/external.yaml
new file mode 100644
index 0000000..f1d2b2c
--- /dev/null
+++ b/test/asset/run/external.yaml
@@ -0,0 +1,42 @@
+repo first:
+ path: ../first
+
+repo second:
+ path: ../second
+
+
+job single:
+ checkout:
+ repo: first
+ dest: first
+
+ shell:
+ - tar czf first.tar.gz first
+
+ artifact tarball:
+ path: ./first.tar.gz
+
+job multiple:
+ checkout:
+ - repo: first
+ dest: first-subdir
+ subtree: subdir
+ - repo: second
+ dest: second-subdir
+ subtree: sub
+
+ shell:
+ - tar czf pack.tar.gz first-subdir second-subdir
+
+ artifact tarball:
+ path: ./pack.tar.gz
+
+job combine:
+ checkout: null
+
+ shell:
+ - ls
+
+ uses:
+ - single.tarball
+ - multiple.tarball
diff --git a/test/asset/run/many_repos.yaml b/test/asset/run/many_repos.yaml
new file mode 100644
index 0000000..d861433
--- /dev/null
+++ b/test/asset/run/many_repos.yaml
@@ -0,0 +1,109 @@
+repo r1:
+repo r2:
+repo r3:
+repo r4:
+repo r5:
+
+destination d1:
+
+job first:
+ checkout:
+ - repo: r1
+ dest: d1
+ - repo: r4
+ dest: d4b
+ - repo: r3
+ dest: d3
+ - repo: r2
+ dest: d2
+ - repo: r4
+ dest: d4
+
+ shell:
+ - touch some_file
+
+ artifact out:
+ path: some_file
+
+job first_manual_revision:
+ checkout:
+ - repo: r1
+ dest: d1
+ - repo: r1
+ dest: d1b
+ revision: tag1
+ - repo: r2
+ dest: d2b
+ revision: tag1
+ - repo: r4
+ dest: d4b
+ - repo: r3
+ dest: d3
+ revision: tag1
+ - repo: r2
+ dest: d2
+ - repo: r4
+ dest: d4
+
+ shell:
+ - touch some_file
+
+ artifact out:
+ path: some_file
+
+
+job second:
+ checkout:
+ - dest: main
+ - repo: r2
+ dest: d2
+ - repo: r5
+ dest: d5
+ - repo: r3
+ dest: d3
+
+ shell:
+ - touch second_file
+
+ artifact out:
+ path: second_file
+
+
+job dependent:
+ uses:
+ - first.out
+
+ shell:
+ - mv some_file some_other_file
+
+ artifact out:
+ path: some_other_file
+
+
+job dependent_publish:
+ publish:
+ - to: d1
+ artifact: first.out
+
+
+job transitive:
+ uses:
+ - dependent.out
+
+ artifact out:
+ path: some_other_file
+
+
+job combined:
+ uses:
+ - first.out
+ - second.out
+
+ artifact out:
+ path: second_file
+
+
+job combined_transitive:
+ uses:
+ - combined.out
+ - transitive.out
diff --git a/test/asset/run/norepo-basic.yaml b/test/asset/run/norepo-basic.yaml
new file mode 100644
index 0000000..ecd3a97
--- /dev/null
+++ b/test/asset/run/norepo-basic.yaml
@@ -0,0 +1,20 @@
+job success:
+ checkout: null
+ shell:
+ - "true"
+
+job failure:
+ checkout: null
+ shell:
+ - "false"
+
+job block_recipe:
+ checkout: null
+ shell: |
+ mkdir dir
+ cd dir
+ export VAR='abc'
+ echo $VAR > var
+
+ artifact out:
+ path: dir/var
diff --git a/test/asset/run/repo-basic.yaml b/test/asset/run/repo-basic.yaml
new file mode 100644
index 0000000..82f5650
--- /dev/null
+++ b/test/asset/run/repo-basic.yaml
@@ -0,0 +1,7 @@
+job success:
+ shell:
+ - "true"
+
+job failure:
+ shell:
+ - "false"
diff --git a/test/asset/run/repo-basic2.yaml b/test/asset/run/repo-basic2.yaml
new file mode 100644
index 0000000..bcfac50
--- /dev/null
+++ b/test/asset/run/repo-basic2.yaml
@@ -0,0 +1,15 @@
+job success:
+ shell:
+ - "true"
+
+job third:
+ shell:
+ - "true"
+
+job failure:
+ shell:
+ - "false"
+
+job fourth:
+ shell:
+ - "true"
diff --git a/test/asset/run/rerun.yaml b/test/asset/run/rerun.yaml
new file mode 100644
index 0000000..dc18b41
--- /dev/null
+++ b/test/asset/run/rerun.yaml
@@ -0,0 +1,45 @@
+job first:
+ shell:
+ - touch x
+
+ artifact out:
+ path: x
+
+
+job second:
+ uses:
+ - first.out
+
+ shell:
+ - mv x y
+
+ artifact out:
+ path: y
+
+
+job first_fail:
+ shell:
+ - "false"
+
+ artifact out:
+ path: x
+
+
+job second_skip:
+ uses:
+ - first_fail.out
+
+ shell:
+ - "true"
+
+ artifact out:
+ path: y
+
+
+job third:
+ uses:
+ - second.out
+ - second_skip.out
+
+ shell:
+ - "true"
diff --git a/test/script/artifact.et b/test/script/artifact.et
new file mode 100644
index 0000000..d353b49
--- /dev/null
+++ b/test/script/artifact.et
@@ -0,0 +1,128 @@
+module artifact
+
+asset scripts:
+ path: ../asset/artifact
+
+
+test ExtractArtifact:
+ node n
+ local:
+ spawn on n as p args [ "--storage=.minici", "${scripts.path}/minici.yaml", "run", "generate" ]
+ expect /job-finish generate done/ from p
+
+ local:
+ spawn on n as p args [ "--storage=.minici", "${scripts.path}/minici.yaml", "extract", "generate.first", "extracted" ]
+ local:
+ shell on n as s:
+ cat ./extracted
+ expect /content 1/ from s
+
+ local:
+ spawn on n as p args [ "--storage=.minici", "${scripts.path}/minici.yaml", "extract", "generate.second", "generate.third", "." ]
+ local:
+ shell on n as s:
+ cat ./f2
+ cat ./f3
+ expect /content 2/ from s
+ expect /content 3/ from s
+
+ local:
+ spawn on n as p args [ "--storage=.minici", "${scripts.path}/minici.yaml", "extract", "generate.dir", "." ]
+ local:
+ shell on n as s:
+ cat ./dir/f2
+ cat ./dir/fa
+ cat ./dir/subdir/fb
+ expect /content 2/ from s
+ expect /content a/ from s
+ expect /content b/ from s
+
+ local:
+ spawn on n as p args [ "--storage=.minici", "${scripts.path}/minici.yaml", "extract", "generate.sdir", "extracted_subdir" ]
+ local:
+ 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")
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..6cea2f2
--- /dev/null
+++ b/test/script/publish.et
@@ -0,0 +1,69 @@
+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")
+
+
+test PublishFromSelf:
+ node n
+ shell on n:
+ mkdir workdir
+ cp ${scripts.path}/from_self.yaml workdir/minici.yaml
+
+ spawn on n as p args [ "--destination=dest:destination", "workdir/minici.yaml", "run", "gen_publish" ]
+ expect_result from p:
+ of "gen_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/
+ /.\/destination\/x/
+ /.\/destination\/y/
+ /(.*)/ capture done
+ guard (done == "DONE")
diff --git a/test/script/repo.et b/test/script/repo.et
new file mode 100644
index 0000000..1ac05a2
--- /dev/null
+++ b/test/script/repo.et
@@ -0,0 +1,327 @@
+module repo
+
+import common
+
+asset scripts:
+ path: ../asset/repo
+
+
+test RepoSubtree:
+ node n
+ shell on n as git_init:
+ mkdir -p work
+ git -C work -c init.defaultBranch=master init -q
+ git -C work -c user.name=test -c user.email=test commit -q --allow-empty -m 'initial commit'
+
+ mkdir -p work/first/second
+ touch work/first/second/file
+ git -C work add first
+ git -C work -c user.name=test -c user.email=test commit -q -m 'commit'
+ git -C work rev-parse HEAD^{commit}
+ git -C work rev-parse HEAD^{tree}
+ git -C work rev-parse HEAD:first
+ git -C work rev-parse HEAD:first/second
+
+ git clone -q --bare work bare.git
+
+ expect /([0-9a-f]+)/ from git_init capture commit
+ expect /([0-9a-f]+)/ from git_init capture root
+ expect /([0-9a-f]+)/ from git_init capture sub1
+ expect /([0-9a-f]+)/ from git_init capture sub2
+
+ for repo in [ "./work", "./bare.git" ]:
+ local:
+ spawn as p on n args [ repo, "subtree", commit, "" ]
+ expect from p /msg $root/
+ expect from p /path (.*)/ capture path
+ guard (path == "")
+
+ local:
+ spawn as p on n args [ repo, "subtree", commit, "." ]
+ expect from p /msg $root/
+ expect from p /path (.*)/ capture path
+ guard (path == "")
+
+ local:
+ spawn as p on n args [ repo, "subtree", commit, "/" ]
+ expect from p /msg $root/
+ expect from p /path (.*)/ capture path
+ guard (path == "")
+
+ local:
+ spawn as p on n args [ repo, "subtree", commit, "first" ]
+ expect from p /msg $sub1/
+ expect from p /path (.*)/ capture path
+ guard (path == "first")
+
+ local:
+ spawn as p on n args [ repo, "subtree", commit, "./first" ]
+ expect from p /msg $sub1/
+ expect from p /path (.*)/ capture path
+ guard (path == "first")
+
+ local:
+ spawn as p on n args [ repo, "subtree", commit, "/first" ]
+ expect from p /msg $sub1/
+ expect from p /path (.*)/ capture path
+ guard (path == "first")
+
+ local:
+ spawn as p on n args [ repo, "subtree", commit, "./first/second" ]
+ expect from p /msg $sub2/
+ expect from p /path (.*)/ capture path
+ guard (path == "first/second")
+
+ local:
+ spawn as p on n args [ repo, "subtree", commit, "/first/second" ]
+ expect from p /msg $sub2/
+ expect from p /path (.*)/ capture path
+ guard (path == "first/second")
+
+ local:
+ spawn as p on n args [ repo, "subtree", "$sub1(first)", "second" ]
+ expect from p /msg $sub2/
+ expect from p /path (.*)/ capture path
+ guard (path == "first/second")
+
+ local:
+ spawn as p on n args [ repo, "subtree", "$sub1(first)", "./second" ]
+ expect from p /msg $sub2/
+ expect from p /path (.*)/ capture path
+ guard (path == "first/second")
+
+ local:
+ spawn as p on n args [ repo, "subtree", "$sub1(first)", "/second/" ]
+ expect from p /msg $sub2/
+ expect from p /path (.*)/ capture path
+ guard (path == "first/second")
+
+
+test CheckoutSubtree:
+ node n
+ shell on n as git_init:
+ mkdir -p main
+ git -C main -c init.defaultBranch=master init -q
+ cp "${scripts.path}/checkout.yaml" main/minici.yaml
+ git -C main add minici.yaml
+ git -C main -c user.name=test -c user.email=test commit -q --allow-empty -m 'initial commit'
+ git -C main rev-parse HEAD
+ git -C main rev-parse HEAD^{tree}
+
+ mkdir -p dir_r1
+ git -C dir_r1 -c init.defaultBranch=master init -q
+ git -C dir_r1 -c user.name=test -c user.email=test commit -q --allow-empty -m 'initial commit'
+ touch dir_r1/file
+ git -C dir_r1 add .
+ git -C dir_r1 -c user.name=test -c user.email=test commit -q --allow-empty -m 'commit r1'
+ git -C dir_r1 rev-parse HEAD
+ git -C dir_r1 rev-parse HEAD^{tree}
+
+ mkdir -p dir_r2
+ git -C dir_r2 -c init.defaultBranch=master init -q
+ git -C dir_r2 -c user.name=test -c user.email=test commit -q --allow-empty -m 'initial commit'
+ mkdir -p dir_r2/s1
+ mkdir -p dir_r2/s2
+ touch dir_r2/s1/file1
+ touch dir_r2/s2/file2
+ git -C dir_r2 add .
+ git -C dir_r2 -c user.name=test -c user.email=test commit -q --allow-empty -m 'commit r2'
+ git -C dir_r2 rev-parse HEAD
+ git -C dir_r2 rev-parse HEAD^{tree}
+ git -C dir_r2 rev-parse HEAD^{tree}:s1
+ git -C dir_r2 rev-parse HEAD^{tree}:s2
+
+ mkdir -p dir_r3
+ git -C dir_r3 -c init.defaultBranch=master init -q
+ git -C dir_r3 -c user.name=test -c user.email=test commit -q --allow-empty -m 'initial commit'
+ mkdir -p dir_r3/a/b/s1
+ mkdir -p dir_r3/a/b/c/s2
+ mkdir -p dir_r3/a/b/c/s3
+ touch dir_r3/a/b/s1/file1
+ touch dir_r3/a/b/c/s2/file2
+ touch dir_r3/a/b/c/s3/file3
+ git -C dir_r3 add .
+ git -C dir_r3 -c user.name=test -c user.email=test commit -q --allow-empty -m 'commit r3'
+ git -C dir_r3 rev-parse HEAD
+ git -C dir_r3 rev-parse HEAD^{tree}
+ git -C dir_r3 rev-parse HEAD^{tree}:a/b
+ git -C dir_r3 rev-parse HEAD^{tree}:a/b/s1
+ git -C dir_r3 rev-parse HEAD^{tree}:a/b/c
+ git -C dir_r3 rev-parse HEAD^{tree}:a/b/c/s2
+ git -C dir_r3 rev-parse HEAD^{tree}:a/b/c/s3
+
+ expect /([0-9a-f]+)/ from git_init capture mc
+ expect /([0-9a-f]+)/ from git_init capture mt
+
+ expect /([0-9a-f]+)/ from git_init capture r1c
+ expect /([0-9a-f]+)/ from git_init capture r1t
+
+ expect /([0-9a-f]+)/ from git_init capture r2c
+ expect /([0-9a-f]+)/ from git_init capture r2t
+ expect /([0-9a-f]+)/ from git_init capture r2s1
+ expect /([0-9a-f]+)/ from git_init capture r2s2
+
+ expect /([0-9a-f]+)/ from git_init capture r3c
+ expect /([0-9a-f]+)/ from git_init capture r3t
+ expect /([0-9a-f]+)/ from git_init capture r3ab
+ expect /([0-9a-f]+)/ from git_init capture r3abs1
+ expect /([0-9a-f]+)/ from git_init capture r3abc
+ expect /([0-9a-f]+)/ from git_init capture r3abcs2
+ expect /([0-9a-f]+)/ from git_init capture r3abcs3
+
+ local:
+ spawn on n as p args [ "--storage=minici", "--repo=r1:./dir_r1", "--repo=r2:./dir_r2", "--repo=r3:./dir_r3", "./main", "run", "--rerun-all", "checkout_subtree" ]
+ expect_success from p of "$mt.checkout_subtree.$r1t.$r2s1"
+ expect /(.*)/ from p capture done
+ guard (done == "run-finish")
+ local:
+ spawn on n as p args [ "--storage=minici", "--repo=r1:./dir_r1", "--repo=r2:./dir_r2", "--repo=r3:./dir_r3", "./main", "run", "--rerun-all", "$mt.checkout_subtree.$r1t.$r2s1" ]
+ expect_success from p of "$mt.checkout_subtree.$r1t.$r2s1"
+ expect /(.*)/ from p capture done
+ guard (done == "run-finish")
+ local:
+ spawn on n as p args [ "--storage=minici", "--repo=r1:./dir_r1", "--repo=r2:./dir_r2", "--repo=r3:./dir_r3", "./main", "extract", "$mt.checkout_subtree.$r1t.$r2s1.out", "list" ]
+ local:
+ shell on n as list:
+ cat list
+ rm list
+ echo DONE
+ expect from list:
+ /\.\/d1\/file/
+ /\.\/d2_s1\/file1/
+ /(.*)/ capture done
+ guard (done == "DONE")
+
+ local:
+ spawn on n as p args [ "--storage=minici", "--repo=r1:./dir_r1", "--repo=r2:./dir_r2", "--repo=r3:./dir_r3", "./main", "run", "--rerun-all", "checkout_common_root" ]
+ expect_success from p of "$mt.checkout_common_root.$r1t.$r2t"
+ expect /(.*)/ from p capture done
+ guard (done == "run-finish")
+ local:
+ spawn on n as p args [ "--storage=minici", "--repo=r1:./dir_r1", "--repo=r2:./dir_r2", "--repo=r3:./dir_r3", "./main", "run", "--rerun-all", "$mt.checkout_common_root.$r1t.$r2t" ]
+ expect_success from p of "$mt.checkout_common_root.$r1t.$r2t"
+ expect /(.*)/ from p capture done
+ guard (done == "run-finish")
+ local:
+ spawn on n as p args [ "--storage=minici", "--repo=r1:./dir_r1", "--repo=r2:./dir_r2", "--repo=r3:./dir_r3", "./main", "extract", "$mt.checkout_common_root.$r1t.$r2t.out", "list" ]
+ local:
+ shell on n as list:
+ cat list
+ rm list
+ echo DONE
+ expect from list:
+ /\.\/d1\/file/
+ /\.\/d2_s1\/file1/
+ /\.\/d2_s2\/file2/
+ /(.*)/ capture done
+ guard (done == "DONE")
+
+ local:
+ spawn on n as p args [ "--storage=minici", "--repo=r1:./dir_r1", "--repo=r2:./dir_r2", "--repo=r3:./dir_r3", "./main", "run", "--rerun-all", "checkout_common_subtree" ]
+ expect_success from p of "$mt.checkout_common_subtree.$r3ab"
+ expect /(.*)/ from p capture done
+ guard (done == "run-finish")
+ local:
+ spawn on n as p args [ "--storage=minici", "--repo=r1:./dir_r1", "--repo=r2:./dir_r2", "--repo=r3:./dir_r3", "./main", "run", "--rerun-all", "$mt.checkout_common_subtree.$r3ab" ]
+ expect_success from p of "$mt.checkout_common_subtree.$r3ab"
+ expect /(.*)/ from p capture done
+ guard (done == "run-finish")
+ local:
+ spawn on n as p args [ "--storage=minici", "--repo=r1:./dir_r1", "--repo=r2:./dir_r2", "--repo=r3:./dir_r3", "./main", "extract", "$mt.checkout_common_subtree.$r3ab.out", "list" ]
+ local:
+ shell on n as list:
+ cat list
+ rm list
+ echo DONE
+ expect from list:
+ /\.\/d3_s1\/file1/
+ /\.\/d3_s2\/file2/
+ /(.*)/ capture done
+ guard (done == "DONE")
+
+ local:
+ spawn on n as p args [ "--storage=minici", "--repo=r1:./dir_r1", "--repo=r2:./dir_r2", "--repo=r3:./dir_r3", "./main", "run", "--rerun-all", "checkout_common_subtree2" ]
+ expect_success from p of "$mt.checkout_common_subtree2.$r1t.$r2s1.$r3abc"
+ expect /(.*)/ from p capture done
+ guard (done == "run-finish")
+ local:
+ spawn on n as p args [ "--storage=minici", "--repo=r1:./dir_r1", "--repo=r2:./dir_r2", "--repo=r3:./dir_r3", "./main", "run", "--rerun-all", "$mt.checkout_common_subtree2.$r1t.$r2s1.$r3abc" ]
+ expect_success from p of "$mt.checkout_common_subtree2.$r1t.$r2s1.$r3abc"
+ expect /(.*)/ from p capture done
+ guard (done == "run-finish")
+ local:
+ spawn on n as p args [ "--storage=minici", "--repo=r1:./dir_r1", "--repo=r2:./dir_r2", "--repo=r3:./dir_r3", "./main", "extract", "$mt.checkout_common_subtree2.$r1t.$r2s1.$r3abc.out", "list" ]
+ local:
+ shell on n as list:
+ cat list
+ rm list
+ echo DONE
+ expect from list:
+ /\.\/d1\/file/
+ /\.\/d2_s1\/file1/
+ /\.\/d3_s2\/file2/
+ /\.\/d3_s3\/file3/
+ /(.*)/ capture done
+ guard (done == "DONE")
+
+ local:
+ spawn on n as p args [ "--storage=minici", "--repo=r1:./dir_r1", "--repo=r2:./dir_r2", "--repo=r3:./dir_r3", "./main", "run", "--rerun-all", "combined_subtree" ]
+ expect_success from p of "$mt.checkout_common_root.$r1t.$r2t"
+ expect_success from p of "$mt.checkout_common_subtree2.$r1t.$r2s1.$r3abc"
+ expect_success from p of "$mt.combined_subtree.$r1t.$r2t.$r3abc"
+ expect /(.*)/ from p capture done
+ guard (done == "run-finish")
+ local:
+ spawn on n as p args [ "--storage=minici", "--repo=r1:./dir_r1", "--repo=r2:./dir_r2", "--repo=r3:./dir_r3", "./main", "run", "--rerun-all", "$mt.combined_subtree.$r1t.$r2t.$r3abc" ]
+ expect_success from p of "$mt.checkout_common_root.$r1t.$r2t"
+ expect_success from p of "$mt.checkout_common_subtree2.$r1t.$r2s1.$r3abc"
+ expect_success from p of "$mt.combined_subtree.$r1t.$r2t.$r3abc"
+ expect /(.*)/ from p capture done
+ guard (done == "run-finish")
+ local:
+ spawn on n as p args [ "--storage=minici", "--repo=r1:./dir_r1", "--repo=r2:./dir_r2", "--repo=r3:./dir_r3", "./main", "extract", "$mt.combined_subtree.$r1t.$r2t.$r3abc.out", "list" ]
+ local:
+ shell on n as list:
+ cat list
+ rm list
+ echo DONE
+ expect from list:
+ /\.\/minici.yaml/
+ /\.\/list2/
+ /\.\/list4/
+ /(.*)/ capture done
+ guard (done == "DONE")
+
+ local:
+ spawn on n as p args [ "--storage=minici", "--repo=r1:./dir_r1", "--repo=r2:./dir_r2", "--repo=r3:./dir_r3", "./main", "run", "--rerun-all", "combined_all" ]
+ expect_success from p of "$mt.checkout_subtree.$r1t.$r2s1"
+ expect_success from p of "$mt.checkout_common_root.$r1t.$r2t"
+ expect_success from p of "$mt.checkout_common_subtree.$r3ab"
+ expect_success from p of "$mt.checkout_common_subtree2.$r1t.$r2s1.$r3abc"
+ expect_success from p of "$mt.combined_all.$r1t.$r2t.$r3ab"
+ expect /(.*)/ from p capture done
+ guard (done == "run-finish")
+ local:
+ spawn on n as p args [ "--storage=minici", "--repo=r1:./dir_r1", "--repo=r2:./dir_r2", "--repo=r3:./dir_r3", "./main", "run", "--rerun-all", "$mt.combined_all.$r1t.$r2t.$r3ab" ]
+ expect_success from p of "$mt.checkout_subtree.$r1t.$r2s1"
+ expect_success from p of "$mt.checkout_common_root.$r1t.$r2t"
+ expect_success from p of "$mt.checkout_common_subtree.$r3ab"
+ expect_success from p of "$mt.checkout_common_subtree2.$r1t.$r2s1.$r3abc"
+ expect_success from p of "$mt.combined_all.$r1t.$r2t.$r3ab"
+ expect /(.*)/ from p capture done
+ guard (done == "run-finish")
+ local:
+ spawn on n as p args [ "--storage=minici", "--repo=r1:./dir_r1", "--repo=r2:./dir_r2", "--repo=r3:./dir_r3", "./main", "extract", "$mt.combined_all.$r1t.$r2t.$r3ab.out", "list" ]
+ local:
+ shell on n as list:
+ cat list
+ rm list
+ echo DONE
+ expect from list:
+ /\.\/minici.yaml/
+ /\.\/list1/
+ /\.\/list2/
+ /\.\/list3/
+ /\.\/list4/
+ /(.*)/ capture done
+ guard (done == "DONE")
diff --git a/test/script/run.et b/test/script/run.et
new file mode 100644
index 0000000..3e13ca1
--- /dev/null
+++ b/test/script/run.et
@@ -0,0 +1,632 @@
+module run
+
+import common
+
+asset scripts:
+ path: ../asset/run
+
+
+test RunWithoutRepo:
+ node n
+ local:
+ spawn on n as p args [ "--storage=.minici", "${scripts.path}/norepo-basic.yaml", "run", "success", "failure", "block_recipe" ]
+ expect_result from p:
+ of "success" result "done"
+ of "failure" result "failed"
+ of "block_recipe" result "done"
+ expect /(.*)/ from p capture done
+ guard (done == "run-finish")
+ local:
+ spawn on n as p args [ "--storage=.minici", "${scripts.path}/norepo-basic.yaml", "extract", "block_recipe.out", "." ]
+ local:
+ shell on n as s:
+ cat var
+ expect /abc/ from s
+
+
+test RunWithRepo:
+ node n
+ shell on n as git_init:
+ git -c init.defaultBranch=master init -q
+ git -c user.name=test -c user.email=test commit -q --allow-empty -m 'initial commit'
+ git rev-parse HEAD
+ cp "${scripts.path}/repo-basic.yaml" minici.yaml
+ git add minici.yaml
+ git -c user.name=test -c user.email=test commit -q -m 'basic1'
+ git rev-parse HEAD^{tree}
+ cp "${scripts.path}/repo-basic2.yaml" minici.yaml
+ git add minici.yaml
+ git -c user.name=test -c user.email=test commit -q -m 'basic1'
+ git rev-parse HEAD
+ git rev-parse HEAD^{tree}
+
+ expect /([0-9a-f]+)/ from git_init capture c0
+ expect /([0-9a-f]+)/ from git_init capture t1
+ expect /([0-9a-f]+)/ from git_init capture c2
+ expect /([0-9a-f]+)/ from git_init capture t2
+
+ local:
+ spawn on n as p args [ "run", "--range=$c0..$c2" ]
+ expect_result from p:
+ of "$t1.success" result "done"
+ of "$t1.failure" result "failed"
+
+ of "$t2.success" result "done"
+ of "$t2.failure" result "failed"
+ of "$t2.third" result "done"
+ of "$t2.fourth" result "done"
+
+ expect /(.*)/ from p capture done
+ guard (done == "run-finish")
+
+ local:
+ spawn on n as p args [ "./minici.yaml", "run", "--range=$c0..$c2" ]
+ expect_previous_result from p:
+ of "$t1.success" result "done"
+ expect_result from p:
+ of "$t1.failure" result "failed"
+ of "$t1.third" result "done"
+ of "$t1.fourth" result "done"
+
+ expect_previous_result from p:
+ of "$t2.success" result "done"
+ expect_result from p:
+ of "$t2.failure" result "failed"
+ expect_previous_result from p:
+ of "$t2.third" result "done"
+ of "$t2.fourth" result "done"
+
+ expect /(.*)/ from p capture done
+ guard (done == "run-finish")
+
+
+test RunExternalRepo:
+ node n
+ shell on n as git_init:
+ mkdir -p first/subdir
+ git -C first -c init.defaultBranch=master init -q
+ git -C first -c user.name=test -c user.email=test commit -q --allow-empty -m 'initial commit'
+ touch first/subdir/file
+ git -C first add subdir
+ git -C first -c user.name=test -c user.email=test commit -q -m 'commit'
+ git -C first rev-parse HEAD^{tree}
+ git -C first rev-parse HEAD:subdir
+
+ mkdir -p second/sub
+ git -C second -c init.defaultBranch=master init -q
+ git -C second -c user.name=test -c user.email=test commit -q --allow-empty -m 'initial commit'
+ touch second/sub/other
+ git -C second add sub
+ git -C second -c user.name=test -c user.email=test commit -q -m 'commit'
+ git -C second rev-parse HEAD^{tree}
+ git -C second rev-parse HEAD:sub
+
+ mkdir -p main
+ git -C main -c init.defaultBranch=master init -q
+ git -C main -c user.name=test -c user.email=test commit -q --allow-empty -m 'initial commit'
+ cp "${scripts.path}/external.yaml" main/minici.yaml
+ git -C main add minici.yaml
+ git -C main -c user.name=test -c user.email=test commit -q -m 'commit'
+ git -C main rev-parse HEAD^{tree}
+
+ expect /([0-9a-f]+)/ from git_init capture first_root
+ expect /([0-9a-f]+)/ from git_init capture first_subtree
+ expect /([0-9a-f]+)/ from git_init capture second_root
+ expect /([0-9a-f]+)/ from git_init capture second_subtree
+ expect /([0-9a-f]+)/ from git_init capture main_root
+
+ # Explicit jobfile outside of any git repo
+ local:
+ spawn on n as p args [ "--repo=first:./first", "--repo=second:./second", "--storage=.minici", "${scripts.path}/external.yaml", "run", "single", "multiple", "combine" ]
+ for job in [ "single.$first_root", "multiple.$first_subtree.$second_subtree", "combine.$first_root.$second_subtree" ]:
+ expect_success from p of job
+
+ expect /(.*)/ from p capture done
+ guard (done == "run-finish")
+
+ # Explicit jobfile within a git repo
+ local:
+ spawn on n as p args [ "--repo=first:./first", "--repo=second:./second", "--storage=.minici", "${scripts.path}/external.yaml", "run", "single" ]
+ expect_success from p of "single.$first_root"
+ expect /(.*)/ from p capture done
+ guard (done == "run-finish")
+
+ # Implicit jobfile within a git repo
+ local:
+ spawn on n as p args [ "--repo=first:./first", "--repo=second:./second", "./main", "run", "HEAD^..HEAD" ]
+ for job in [ "single.$first_root", "multiple.$first_subtree.$second_subtree", "combine.$first_root.$second_subtree" ]:
+ expect_success from p of "$main_root.$job"
+
+ expect /(.*)/ from p capture done
+ guard (done == "run-finish")
+
+
+test RunExplicitJob:
+ node n
+ shell on n as git_init:
+ mkdir -p main
+ git -C main -c init.defaultBranch=master init -q
+ cp "${scripts.path}/explicit.yaml" main/minici.yaml
+ git -C main add minici.yaml
+ git -C main -c user.name=test -c user.email=test commit -q --allow-empty -m 'initial commit'
+
+ mkdir -p main/subdir
+
+ touch main/subdir/a
+ git -C main add subdir
+ git -C main -c user.name=test -c user.email=test commit -q -m 'commit'
+ git -C main rev-parse HEAD^{commit}
+ git -C main rev-parse HEAD^{tree}
+
+ touch main/subdir/b
+ git -C main add subdir
+ git -C main -c user.name=test -c user.email=test commit -q -m 'commit'
+ git -C main rev-parse HEAD^{tree}
+
+ rm main/subdir/a
+ rm main/subdir/b
+ touch main/subdir/c
+ git -C main add subdir
+ git -C main -c user.name=test -c user.email=test commit -q -m 'commit'
+ git -C main rev-parse HEAD^{tree}
+
+ touch main/subdir/d
+ git -C main add subdir
+ git -C main -c user.name=test -c user.email=test commit -q -m 'commit'
+ git -C main rev-parse HEAD^{tree}
+
+ expect /([0-9a-f]+)/ from git_init capture c1
+ expect /([0-9a-f]+)/ from git_init capture t1
+ expect /([0-9a-f]+)/ from git_init capture t2
+ expect /([0-9a-f]+)/ from git_init capture t3
+ expect /([0-9a-f]+)/ from git_init capture t4
+
+ local:
+ spawn on n as p args [ "./main", "run", "$c1.build" ]
+ expect_success from p of "$t1.build"
+ expect /(.*)/ from p capture done
+ guard (done == "run-finish")
+ local:
+ spawn on n as p args [ "./main", "extract", "$c1.build.out", "list" ]
+ local:
+ shell on n as s:
+ cat list
+ rm list
+ expect /a/ from s
+
+ local:
+ spawn on n as p args [ "./main", "run", "$t2.build" ]
+ expect_success from p of "$t2.build"
+ expect /(.*)/ from p capture done
+ guard (done == "run-finish")
+ local:
+ spawn on n as p args [ "./main", "extract", "$t2.build.out", "list" ]
+ local:
+ shell on n as s:
+ cat list
+ rm list
+ expect /a b/ from s
+
+ local:
+ spawn on n as p args [ "./main", "run", "HEAD^.build" ]
+ expect_success from p of "$t3.build"
+ expect /(.*)/ from p capture done
+ guard (done == "run-finish")
+ local:
+ spawn on n as p args [ "./main", "extract", "HEAD^.build.out", "list" ]
+ local:
+ shell on n as s:
+ cat list
+ rm list
+ expect /c/ from s
+
+ local:
+ spawn on n as p args [ "./main", "run", "HEAD.build" ]
+ expect_success from p of "$t4.build"
+ expect /(.*)/ from p capture done
+ guard (done == "run-finish")
+ local:
+ spawn on n as p args [ "./main", "extract", "HEAD.build.out", "list" ]
+ local:
+ shell on n as s:
+ cat list
+ rm list
+ expect /c d/ from s
+
+
+test RunExplicitDependentJob:
+ node n
+ shell on n as git_init:
+ mkdir -p main
+ git -C main -c init.defaultBranch=master init -q
+ cp "${scripts.path}/dependencies.yaml" main/minici.yaml
+ git -C main add minici.yaml
+ git -C main -c user.name=test -c user.email=test commit -q --allow-empty -m 'initial commit'
+
+ mkdir -p main/subdir
+
+ touch main/subdir/a
+ git -C main add subdir
+ git -C main -c user.name=test -c user.email=test commit -q -m 'commit'
+ git -C main rev-parse HEAD^{commit}
+ git -C main rev-parse HEAD^{tree}
+
+ touch main/subdir/b
+ git -C main add subdir
+ git -C main -c user.name=test -c user.email=test commit -q -m 'commit'
+ git -C main rev-parse HEAD^{tree}
+
+ rm main/subdir/a
+ rm main/subdir/b
+ touch main/subdir/c
+ git -C main add subdir
+ git -C main -c user.name=test -c user.email=test commit -q -m 'commit'
+ git -C main rev-parse HEAD^{tree}
+
+ touch main/subdir/d
+ git -C main add subdir
+ git -C main -c user.name=test -c user.email=test commit -q -m 'commit'
+ git -C main rev-parse HEAD^{tree}
+
+ mkdir -p other
+ git -C other -c init.defaultBranch=master init -q
+
+ mkdir -p other/subdir
+
+ touch other/subdir/a
+ git -C other add subdir
+ git -C other -c user.name=test -c user.email=test commit -q -m 'commit'
+ git -C other rev-parse HEAD^{tree}
+
+ touch other/subdir/b
+ git -C other add subdir
+ git -C other -c user.name=test -c user.email=test commit -q -m 'commit'
+ git -C other rev-parse HEAD^{tree}
+
+ rm other/subdir/a
+ rm other/subdir/b
+ touch other/subdir/c
+ git -C other add subdir
+ git -C other -c user.name=test -c user.email=test commit -q -m 'commit'
+ git -C other rev-parse HEAD^{tree}
+
+ touch other/subdir/d
+ git -C other add subdir
+ git -C other -c user.name=test -c user.email=test commit -q -m 'commit'
+ git -C other rev-parse HEAD^{tree}
+
+ expect /([0-9a-f]+)/ from git_init capture c1
+ expect /([0-9a-f]+)/ from git_init capture t1
+ expect /([0-9a-f]+)/ from git_init capture t2
+ expect /([0-9a-f]+)/ from git_init capture t3
+ expect /([0-9a-f]+)/ from git_init capture t4
+
+ expect /([0-9a-f]+)/ from git_init capture o1
+ expect /([0-9a-f]+)/ from git_init capture o2
+ expect /([0-9a-f]+)/ from git_init capture o3
+ expect /([0-9a-f]+)/ from git_init capture o4
+
+ local:
+ spawn on n as p args [ "--repo=other:./other", "./main", "run", "$c1.first", "$t2.first", "$t3.fourth.$o3", "$c1.fifth.$o1", "$c1.fourth.$o1", "$c1.third", "$c1.second", "$t4.fifth.$o4" ]
+ expect_success from p of "$t1.first"
+ expect_success from p of "$t1.second"
+ expect_success from p of "$t1.third"
+ expect_success from p of "$t1.fourth.$o1"
+ expect_success from p of "$t1.fifth.$o1"
+
+ expect_success from p of "$t2.first"
+
+ expect_success from p of "$t3.first"
+ expect_success from p of "$t3.second"
+ expect_success from p of "$t3.fourth.$o3"
+
+ expect_success from p of "$t4.first"
+ expect_success from p of "$t4.second"
+ expect_success from p of "$t4.third"
+ expect_success from p of "$t4.fourth.$o4"
+ expect_success from p of "$t4.fifth.$o4"
+
+ flush from p matching /note .*/
+ flush from p matching /job-duplicate .*/
+ expect /(.*)/ from p capture done
+ guard (done == "run-finish")
+
+
+test RunRerun:
+ node n
+ shell on n as git_init:
+ mkdir -p main
+ git -C main -c init.defaultBranch=master init -q
+ git -C main -c user.name=test -c user.email=test commit -q --allow-empty -m 'initial commit'
+ cp "${scripts.path}/rerun.yaml" main/minici.yaml
+ git -C main add minici.yaml
+ git -C main -c user.name=test -c user.email=test commit -q --allow-empty -m 'minici'
+ git -C main rev-parse HEAD^{tree}
+
+ expect /([0-9a-f]+)/ from git_init capture t1
+
+ local:
+ spawn on n as p args [ "./main", "run", "$t1.third" ]
+ expect_success from p of "$t1.first"
+ expect_success from p of "$t1.second"
+ expect_result from p of "$t1.first_fail" result "failed"
+ expect_skip from p of "$t1.second_skip"
+ expect_skip from p of "$t1.third"
+
+ flush from p matching /note .*/
+ expect /(.*)/ from p capture done
+ guard (done == "run-finish")
+
+ local:
+ spawn on n as p args [ "./main", "run", "--rerun-explicit", "$t1.second" ]
+ expect_previous_success from p of "$t1.first"
+ expect_success from p of "$t1.second"
+
+ flush from p matching /note .*/
+ expect /(.*)/ from p capture done
+ guard (done == "run-finish")
+
+ local:
+ spawn on n as p args [ "./main", "run", "--rerun-failed", "$t1.second" ]
+ expect_previous_success from p of "$t1.first"
+ expect_previous_success from p of "$t1.second"
+
+ flush from p matching /note .*/
+ expect /(.*)/ from p capture done
+ guard (done == "run-finish")
+
+ local:
+ spawn on n as p args [ "./main", "run", "--rerun-all", "$t1.second" ]
+ expect_success from p of "$t1.first"
+ expect_success from p of "$t1.second"
+
+ flush from p matching /note .*/
+ expect /(.*)/ from p capture done
+ guard (done == "run-finish")
+
+ local:
+ spawn on n as p args [ "./main", "run", "--rerun-none", "$t1.second" ]
+ expect_previous_success from p of "$t1.first"
+ expect_previous_success from p of "$t1.second"
+
+ flush from p matching /note .*/
+ expect /(.*)/ from p capture done
+ guard (done == "run-finish")
+
+ local:
+ spawn on n as p args [ "./main", "run", "--rerun-explicit", "$t1.third" ]
+ expect_previous_success from p of "$t1.first"
+ expect_previous_success from p of "$t1.second"
+ expect_result from p of "$t1.first_fail" result "failed"
+ expect_skip from p of "$t1.second_skip"
+ expect_skip from p of "$t1.third"
+
+ flush from p matching /note .*/
+ expect /(.*)/ from p capture done
+ guard (done == "run-finish")
+
+ local:
+ spawn on n as p args [ "./main", "run", "--rerun-failed", "$t1.third" ]
+ expect_previous_success from p of "$t1.first"
+ expect_previous_success from p of "$t1.second"
+ expect_result from p of "$t1.first_fail" result "failed"
+ expect_skip from p of "$t1.second_skip"
+ expect_skip from p of "$t1.third"
+
+ flush from p matching /note .*/
+ expect /(.*)/ from p capture done
+ guard (done == "run-finish")
+
+ local:
+ spawn on n as p args [ "./main", "run", "--rerun-all", "$t1.third" ]
+ expect_success from p of "$t1.first"
+ expect_success from p of "$t1.second"
+ expect_result from p of "$t1.first_fail" result "failed"
+ expect_skip from p of "$t1.second_skip"
+ expect_skip from p of "$t1.third"
+
+ flush from p matching /note .*/
+ expect /(.*)/ from p capture done
+ guard (done == "run-finish")
+
+ local:
+ spawn on n as p args [ "./main", "run", "--rerun-none", "$t1.third" ]
+ expect_previous_success from p of "$t1.first"
+ expect_previous_success from p of "$t1.second"
+ expect_previous_result from p of "$t1.first_fail" result "failed"
+ expect_skip from p of "$t1.second_skip"
+ expect_skip from p of "$t1.third"
+
+ flush from p matching /note .*/
+ expect /(.*)/ from p capture done
+ guard (done == "run-finish")
+
+
+test RunWithManyRepos:
+ node n
+ shell on n as git_init:
+ mkdir -p main
+ git -C main -c init.defaultBranch=master init -q
+ cp "${scripts.path}/many_repos.yaml" main/minici.yaml
+ git -C main add minici.yaml
+ git -C main -c user.name=test -c user.email=test commit -q --allow-empty -m 'initial commit'
+ git -C main rev-parse HEAD
+ git -C main rev-parse HEAD^{tree}
+
+ mkdir -p dir_r1
+ git -C dir_r1 -c init.defaultBranch=master init -q
+ git -C dir_r1 -c user.name=test -c user.email=test commit -q --allow-empty -m 'initial commit'
+ touch dir_r1/file_r1
+ git -C dir_r1 add file_r1
+ git -C dir_r1 -c user.name=test -c user.email=test commit -q --allow-empty -m 'commit r1'
+ git -C dir_r1 -c user.name=test -c user.email=test tag tag1 -m tag1
+ touch dir_r1/file2_r1
+ git -C dir_r1 add file2_r1
+ git -C dir_r1 -c user.name=test -c user.email=test commit -q --allow-empty -m 'commit r1'
+ git -C dir_r1 rev-parse HEAD
+ git -C dir_r1 rev-parse HEAD^{tree}
+
+ mkdir -p dir_r2
+ git -C dir_r2 -c init.defaultBranch=master init -q
+ git -C dir_r2 -c user.name=test -c user.email=test commit -q --allow-empty -m 'initial commit'
+ touch dir_r2/file_r2
+ git -C dir_r2 add file_r2
+ git -C dir_r2 -c user.name=test -c user.email=test commit -q --allow-empty -m 'commit r2'
+ git -C dir_r2 -c user.name=test -c user.email=test tag tag1 -m tag1
+ touch dir_r2/file2_r2
+ git -C dir_r2 add file2_r2
+ git -C dir_r2 -c user.name=test -c user.email=test commit -q --allow-empty -m 'commit r2'
+ git -C dir_r2 rev-parse HEAD
+ git -C dir_r2 rev-parse HEAD^{tree}
+
+ mkdir -p dir_r3
+ git -C dir_r3 -c init.defaultBranch=master init -q
+ git -C dir_r3 -c user.name=test -c user.email=test commit -q --allow-empty -m 'initial commit'
+ touch dir_r3/file2_r3
+ git -C dir_r3 add file2_r3
+ git -C dir_r3 -c user.name=test -c user.email=test commit -q --allow-empty -m 'commit r3'
+ git -C dir_r3 -c user.name=test -c user.email=test tag tag1 -m tag1
+ touch dir_r3/file_r3
+ git -C dir_r3 add file_r3
+ git -C dir_r3 -c user.name=test -c user.email=test commit -q --allow-empty -m 'commit r3'
+ git -C dir_r3 rev-parse HEAD
+ git -C dir_r3 rev-parse HEAD^{tree}
+
+ mkdir -p dir_r4
+ git -C dir_r4 -c init.defaultBranch=master init -q
+ git -C dir_r4 -c user.name=test -c user.email=test commit -q --allow-empty -m 'initial commit'
+ touch dir_r4/file_r4
+ git -C dir_r4 add file_r4
+ git -C dir_r4 -c user.name=test -c user.email=test commit -q --allow-empty -m 'commit r4'
+ git -C dir_r4 rev-parse HEAD
+ git -C dir_r4 rev-parse HEAD^{tree}
+
+ mkdir -p dir_r5
+ git -C dir_r5 -c init.defaultBranch=master init -q
+ git -C dir_r5 -c user.name=test -c user.email=test commit -q --allow-empty -m 'initial commit'
+ touch dir_r5/file_r5
+ git -C dir_r5 add file_r5
+ git -C dir_r5 -c user.name=test -c user.email=test commit -q --allow-empty -m 'commit r5'
+ git -C dir_r5 rev-parse HEAD
+ git -C dir_r5 rev-parse HEAD^{tree}
+
+ expect /([0-9a-f]+)/ from git_init capture mc
+ expect /([0-9a-f]+)/ from git_init capture mt
+ expect /([0-9a-f]+)/ from git_init capture r1c
+ expect /([0-9a-f]+)/ from git_init capture r1t
+ expect /([0-9a-f]+)/ from git_init capture r2c
+ expect /([0-9a-f]+)/ from git_init capture r2t
+ expect /([0-9a-f]+)/ from git_init capture r3c
+ expect /([0-9a-f]+)/ from git_init capture r3t
+ expect /([0-9a-f]+)/ from git_init capture r4c
+ expect /([0-9a-f]+)/ from git_init capture r4t
+ expect /([0-9a-f]+)/ from git_init capture r5c
+ expect /([0-9a-f]+)/ from git_init capture r5t
+
+ # Path to a repo containing the script file
+
+ local:
+ spawn on n as p args [ "--storage=minici", "--repo=r1:./dir_r1", "--repo=r3:./dir_r3", "--repo=r4:./dir_r4", "--repo=r2:./dir_r2", "--repo=r5:./dir_r5", "--destination=d1:./dest1", "./main", "run", "--rerun-all", "first" ]
+ expect_success from p of "$mt.first.$r1t.$r2t.$r3t.$r4t"
+ expect /(.*)/ from p capture done
+ guard (done == "run-finish")
+
+ local:
+ spawn on n as p args [ "--storage=minici", "--repo=r1:./dir_r1", "--repo=r3:./dir_r3", "--repo=r4:./dir_r4", "--repo=r2:./dir_r2", "--repo=r5:./dir_r5", "--destination=d1:./dest1", "./main", "run", "--rerun-all", "$mc.first.$r1c.$r2t.$r3c.$r4t" ]
+ expect_success from p of "$mt.first.$r1t.$r2t.$r3t.$r4t"
+ expect /(.*)/ from p capture done
+ guard (done == "run-finish")
+
+ local:
+ spawn on n as p args [ "--storage=minici", "--repo=r1:./dir_r1", "--repo=r3:./dir_r3", "--repo=r4:./dir_r4", "--repo=r2:./dir_r2", "--repo=r5:./dir_r5", "--destination=d1:./dest1", "./main", "run", "--rerun-all", "first_manual_revision" ]
+ expect_success from p of "$mt.first_manual_revision.$r1t.$r2t.$r4t"
+ expect /(.*)/ from p capture done
+ guard (done == "run-finish")
+
+ local:
+ spawn on n as p args [ "--storage=minici", "--repo=r1:./dir_r1", "--repo=r3:./dir_r3", "--repo=r4:./dir_r4", "--repo=r2:./dir_r2", "--repo=r5:./dir_r5", "--destination=d1:./dest1", "./main", "run", "--rerun-all", "$mc.first_manual_revision.$r1c.$r2t.$r4t" ]
+ expect_success from p of "$mt.first_manual_revision.$r1t.$r2t.$r4t"
+ expect /(.*)/ from p capture done
+ guard (done == "run-finish")
+
+ local:
+ spawn on n as p args [ "--storage=minici", "--repo=r1:./dir_r1", "--repo=r3:./dir_r3", "--repo=r4:./dir_r4", "--repo=r2:./dir_r2", "--repo=r5:./dir_r5", "--destination=d1:./dest1", "./main", "run", "--rerun-all", "dependent" ]
+ expect_success from p of "$mt.first.$r1t.$r2t.$r3t.$r4t"
+ expect_success from p of "$mt.dependent.$r1t.$r2t.$r3t.$r4t"
+ expect /(.*)/ from p capture done
+ guard (done == "run-finish")
+
+ local:
+ spawn on n as p args [ "--storage=minici", "--repo=r1:./dir_r1", "--repo=r3:./dir_r3", "--repo=r4:./dir_r4", "--repo=r2:./dir_r2", "--repo=r5:./dir_r5", "--destination=d1:./dest1", "./main", "run", "--rerun-all", "$mc.dependent.$r1c.$r2t.$r3c.$r4t" ]
+ expect_success from p of "$mt.first.$r1t.$r2t.$r3t.$r4t"
+ expect_success from p of "$mt.dependent.$r1t.$r2t.$r3t.$r4t"
+ expect /(.*)/ from p capture done
+ guard (done == "run-finish")
+
+ local:
+ spawn on n as p args [ "--storage=minici", "--repo=r1:./dir_r1", "--repo=r3:./dir_r3", "--repo=r4:./dir_r4", "--repo=r2:./dir_r2", "--repo=r5:./dir_r5", "--destination=d1:./dest1", "./main", "run", "--rerun-all", "dependent_publish" ]
+ expect_success from p of "$mt.first.$r1t.$r2t.$r3t.$r4t"
+ expect_success from p of "$mt.dependent_publish.$r1t.$r2t.$r3t.$r4t"
+ expect /(.*)/ from p capture done
+ guard (done == "run-finish")
+
+ local:
+ spawn on n as p args [ "--storage=minici", "--repo=r1:./dir_r1", "--repo=r3:./dir_r3", "--repo=r4:./dir_r4", "--repo=r2:./dir_r2", "--repo=r5:./dir_r5", "--destination=d1:./dest1", "./main", "run", "--rerun-all", "transitive" ]
+ expect_success from p of "$mt.first.$r1t.$r2t.$r3t.$r4t"
+ expect_success from p of "$mt.dependent.$r1t.$r2t.$r3t.$r4t"
+ expect_success from p of "$mt.transitive.$r1t.$r2t.$r3t.$r4t"
+ expect /(.*)/ from p capture done
+ guard (done == "run-finish")
+
+ local:
+ spawn on n as p args [ "--storage=minici", "--repo=r1:./dir_r1", "--repo=r3:./dir_r3", "--repo=r4:./dir_r4", "--repo=r2:./dir_r2", "--repo=r5:./dir_r5", "--destination=d1:./dest1", "./main", "run", "--rerun-all", "$mc.transitive.$r1c.$r2t.$r3c.$r4t" ]
+ expect_success from p of "$mt.first.$r1t.$r2t.$r3t.$r4t"
+ expect_success from p of "$mt.dependent.$r1t.$r2t.$r3t.$r4t"
+ expect_success from p of "$mt.transitive.$r1t.$r2t.$r3t.$r4t"
+ expect /(.*)/ from p capture done
+ guard (done == "run-finish")
+
+ local:
+ spawn on n as p args [ "--storage=minici", "--repo=r1:./dir_r1", "--repo=r3:./dir_r3", "--repo=r4:./dir_r4", "--repo=r2:./dir_r2", "--repo=r5:./dir_r5", "--destination=d1:./dest1", "./main", "run", "--rerun-all", "combined" ]
+ expect_success from p of "$mt.first.$r1t.$r2t.$r3t.$r4t"
+ expect_success from p of "$mt.second.$r2t.$r3t.$r5t"
+ expect_success from p of "$mt.combined.$r1t.$r2t.$r3t.$r4t.$r5t"
+ expect /(.*)/ from p capture done
+ guard (done == "run-finish")
+
+ local:
+ spawn on n as p args [ "--storage=minici", "--repo=r1:./dir_r1", "--repo=r3:./dir_r3", "--repo=r4:./dir_r4", "--repo=r2:./dir_r2", "--repo=r5:./dir_r5", "--destination=d1:./dest1", "./main", "run", "--rerun-all", "combined_transitive" ]
+ expect_success from p of "$mt.first.$r1t.$r2t.$r3t.$r4t"
+ expect_success from p of "$mt.second.$r2t.$r3t.$r5t"
+ expect_success from p of "$mt.dependent.$r1t.$r2t.$r3t.$r4t"
+ expect_success from p of "$mt.transitive.$r1t.$r2t.$r3t.$r4t"
+ expect_success from p of "$mt.combined.$r1t.$r2t.$r3t.$r4t.$r5t"
+ expect_success from p of "$mt.combined_transitive.$r1t.$r2t.$r3t.$r4t.$r5t"
+ expect /(.*)/ from p capture done
+ guard (done == "run-finish")
+
+
+ # Explicit path to the script file
+
+ local:
+ spawn on n as p args [ "--storage=minici", "--repo=r1:./dir_r1", "--repo=r3:./dir_r3", "--repo=r4:./dir_r4", "--repo=r2:./dir_r2", "--repo=r5:./dir_r5", "--destination=d1:./dest1", "./main/minici.yaml", "run", "--rerun-all", "first" ]
+ expect_success from p of "first.$r1t.$r2t.$r3t.$r4t"
+ expect /(.*)/ from p capture done
+ guard (done == "run-finish")
+
+ local:
+ spawn on n as p args [ "--storage=minici", "--repo=r1:./dir_r1", "--repo=r3:./dir_r3", "--repo=r4:./dir_r4", "--repo=r2:./dir_r2", "--repo=r5:./dir_r5", "--destination=d1:./dest1", "./main/minici.yaml", "run", "--rerun-all", "second" ]
+ expect_success from p of "second.$mt.$r2t.$r3t.$r5t"
+ expect /(.*)/ from p capture done
+ guard (done == "run-finish")
+
+ local:
+ spawn on n as p args [ "--storage=minici", "--repo=r1:./dir_r1", "--repo=r3:./dir_r3", "--repo=r4:./dir_r4", "--repo=r2:./dir_r2", "--repo=r5:./dir_r5", "--destination=d1:./dest1", "./main/minici.yaml", "run", "--rerun-all", "combined_transitive" ]
+ expect_success from p of "first.$r1t.$r2t.$r3t.$r4t"
+ expect_success from p of "second.$mt.$r2t.$r3t.$r5t"
+ expect_success from p of "dependent.$mt.$r1t.$r2t.$r3t.$r4t"
+ expect_success from p of "transitive.$mt.$r1t.$r2t.$r3t.$r4t"
+ expect_success from p of "combined.$mt.$r1t.$r2t.$r3t.$r4t.$r5t"
+ expect_success from p of "combined_transitive.$mt.$r1t.$r2t.$r3t.$r4t.$r5t"
+ expect /(.*)/ from p capture done
+ guard (done == "run-finish")