summaryrefslogtreecommitdiff
path: root/test/script
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2026-11-04 21:29:35 +0100
committerRoman Smrž <roman.smrz@seznam.cz>2026-11-06 19:50:31 +0100
commitbb780fa5637ddf346ad9e59e92755b4ca010a71c (patch)
tree44f907156d7f4088ab68b3cbfcd82e25b925c35a /test/script
parent9b14290c97df62f6e7da91c90b8bd7bb6a4bec42 (diff)
Accept revision expressions in job refs
Diffstat (limited to 'test/script')
-rw-r--r--test/script/run.et59
1 files changed, 59 insertions, 0 deletions
diff --git a/test/script/run.et b/test/script/run.et
index 4df5a2e..4825108 100644
--- a/test/script/run.et
+++ b/test/script/run.et
@@ -860,3 +860,62 @@ test RestartCancelledJobs:
/job-start $td:third/
/job-(.*)/ capture final_job
guard (final_job == "finish $td:third done")
+
+
+test RunHighestTag:
+ 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'
+ cp "${scripts.path}/repo-basic2.yaml" minici.yaml
+ git add minici.yaml
+ git -c user.name=test -c user.email=test commit -q -m 'minici.yaml'
+ git rev-parse HEAD
+
+ touch a
+ git add a
+ git -c user.name=test -c user.email=test commit -q -m a
+ git rev-parse HEAD
+ git rev-parse HEAD^{tree}
+ git -c user.name=test -c user.email=test tag -a -m ... v1.2
+
+ touch b
+ git add b
+ git -c user.name=test -c user.email=test commit -q -m b
+ git rev-parse HEAD
+ git rev-parse HEAD^{tree}
+ git -c user.name=test -c user.email=test tag -a -m ... v2.1
+
+ touch c
+ git add c
+ git -c user.name=test -c user.email=test commit -q -m c
+ git rev-parse HEAD
+ git rev-parse HEAD^{tree}
+ git -c user.name=test -c user.email=test tag -a -m ... v1.3
+ git -c user.name=test -c user.email=test tag -a -m ... w1.3
+
+ git reset --hard HEAD~3
+ git rev-parse HEAD
+
+ expect /([0-9a-f]+)/ from git_init capture c_init
+ expect /([0-9a-f]+)/ from git_init capture ca
+ expect /([0-9a-f]+)/ from git_init capture ta
+ expect /([0-9a-f]+)/ from git_init capture cb
+ expect /([0-9a-f]+)/ from git_init capture tb
+ expect /([0-9a-f]+)/ from git_init capture cc
+ expect /([0-9a-f]+)/ from git_init capture tc
+ expect /([0-9a-f]+)/ from git_init capture c_end
+
+ guard (c_init == c_end)
+
+ local:
+ spawn on n as p args [ "run", "highesttag(v*):third", "highesttag(*):fourth" ]
+ expect from p:
+ /job-enqueue $tb:third/
+ /job-start $tb:third/
+ /job-finish $tb:third done/
+ /job-enqueue $tc:fourth/
+ /job-start $tc:fourth/
+ /job-finish $tc:fourth done/
+ expect /(.*)/ from p capture finish
+ guard (finish == "run-finish")