diff options
Diffstat (limited to 'test/script/run.et')
| -rw-r--r-- | test/script/run.et | 111 |
1 files changed, 111 insertions, 0 deletions
diff --git a/test/script/run.et b/test/script/run.et index 6c990be..e491c64 100644 --- a/test/script/run.et +++ b/test/script/run.et @@ -862,6 +862,117 @@ test RestartCancelledJobs: guard (final_job == "finish $td:third done") +test CancelDuplicateJobs: + 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' + git rev-parse HEAD + + git branch -f base + git branch -f tip + + 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} + + git -c user.name=test -c user.email=test revert HEAD --no-edit >/dev/null + 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~4 + 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 crb + expect /([0-9a-f]+)/ from git_init capture trb + 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 [ "--jobs=20", "run", "watch(base)..watch(tip)" ] killwith SIGINT + expect from p /watch-branch-started base/ + expect from p /watch-branch-started tip/ + + shell on n: + git branch -f tip $cb + + expect from p: + /job-enqueue $ta:first/ + /job-enqueue $ta:second/ + /job-enqueue $ta:third/ + /job-start $ta:first/ + /job-start $ta:third/ + /job-finish $ta:third done/ + /job-enqueue $tb:first/ + /job-enqueue $tb:second/ + /job-enqueue $tb:third/ + /job-start $tb:first/ + /job-start $tb:third/ + /job-finish $tb:third done/ + + shell on n: + git branch -f tip $crb + + expect from p: + /job-duplicate $ta:first/ + /job-duplicate $ta:second/ + /job-duplicate $ta:third/ + + shell on n: + git branch -f base $cb + + expect from p: + /job-finish $tb:first cancelled/ + /job-(.*)/ capture cancel_b + guard (cancel_b == "finish $tb:second cancelled") + + shell on n: + git branch -f tip $cc + + expect from p: + /job-enqueue $tc:first/ + /job-enqueue $tc:second/ + /job-enqueue $tc:third/ + /job-start $tc:first/ + /job-start $tc:third/ + /job-(.*)/ capture finish_tc_third + guard (finish_tc_third == "finish $tc:third done") + + shell on n: + git branch -f base $cc + + expect from p: + /job-finish $ta:first cancelled/ + /job-finish $ta:second cancelled/ + /job-finish $tc:first cancelled/ + /job-finish $tc:second cancelled/ + + test RunHighestTag: node n shell on n as git_init: |