summaryrefslogtreecommitdiff
path: root/test/script
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2026-04-04 16:38:53 +0200
committerRoman Smrž <roman.smrz@seznam.cz>2026-06-23 22:42:37 +0200
commit26abedba2417ef166a3dfe2370736ec337ed7dfd (patch)
treeff26ffd3527a8660138b217d212271d2e6bba59f /test/script
parent5aacb05027deb842123b1f74f004531a055d26ae (diff)
Test: watching branch and cancellationHEADmaster
Diffstat (limited to 'test/script')
-rw-r--r--test/script/run.et100
1 files changed, 100 insertions, 0 deletions
diff --git a/test/script/run.et b/test/script/run.et
index 3e13ca1..4944f13 100644
--- a/test/script/run.et
+++ b/test/script/run.et
@@ -630,3 +630,103 @@ test RunWithManyRepos:
expect_success from p of "combined_transitive.$mt.$r1t.$r2t.$r3t.$r4t.$r5t"
expect /(.*)/ from p capture done
guard (done == "run-finish")
+
+
+test WatchBranchAndCancel:
+ 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}/cancel.yaml" minici.yaml
+ git add minici.yaml
+ git -c user.name=test -c user.email=test commit -q -m 'minici.yaml'
+
+ 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}
+
+ 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}
+
+ 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 reset --hard HEAD~2
+
+ touch d
+ git add d
+ git -c user.name=test -c user.email=test commit -q -m d
+ git rev-parse HEAD
+ git rev-parse HEAD^{tree}
+
+ touch e
+ git add e
+ git -c user.name=test -c user.email=test commit -q -m e
+ git rev-parse HEAD
+ git rev-parse HEAD^{tree}
+
+ git reset --hard HEAD~3
+ git rev-parse HEAD
+
+ 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 cd
+ expect /([0-9a-f]+)/ from git_init capture td
+ expect /([0-9a-f]+)/ from git_init capture ce
+ expect /([0-9a-f]+)/ from git_init capture te
+ expect /([0-9a-f]+)/ from git_init capture cbase
+
+ local:
+ spawn on n as p args [ "--jobs=2", "run", "--new-commits-on=master" ] killwith SIGINT
+ expect from p /watch-branch-started master/
+
+ shell on n:
+ git reset --hard $ca
+
+ expect from p:
+ /job-start $ta.first/
+ /job-start $ta.third/
+ /job-finish $ta.third done/
+
+ shell on n:
+ git reset --hard $cc
+
+ expect from p:
+ /job-start .*/
+
+ shell on n:
+ git reset --hard $ce
+
+ expect from p:
+ /job-finish $tb.first cancelled/
+ /job-finish $tb.second cancelled/
+ /job-finish $tc.first cancelled/
+ /job-finish $tc.second cancelled/
+ /job-finish $tc.third cancelled/
+
+ for commit in [ ta ]:
+ spawn on n as log args [ "log", "$commit.first" ]
+ expect from log /msg (.*)/ capture path
+ shell on n:
+ echo -n > $path
+ expect from p /job-finish $commit.first done/
+
+ for commit in [ td, te ]:
+ expect from p /job-start $commit.first/
+ spawn on n as log args [ "log", "$commit.first" ]
+ expect from log /msg (.*)/ capture path
+ shell on n:
+ echo -n > $path
+ expect from p /job-finish $commit.first done/