diff options
| author | Roman Smrž <roman.smrz@seznam.cz> | 2026-11-25 20:25:45 +0100 |
|---|---|---|
| committer | Roman Smrž <roman.smrz@seznam.cz> | 2026-11-27 22:28:01 +0100 |
| commit | c5f4e01a84ee7e348bcde3dc3313c198d1197aa1 (patch) | |
| tree | 7786a030ea453bcdad2844abbf4d1a3b10b2d2a3 /test/script/publish.et | |
| parent | 54bf3a5f5c6f660a461d65aea279e698a51c0f1d (diff) | |
Push job now succeeds on attempt to push ancestor commit
Diffstat (limited to 'test/script/publish.et')
| -rw-r--r-- | test/script/publish.et | 56 |
1 files changed, 54 insertions, 2 deletions
diff --git a/test/script/publish.et b/test/script/publish.et index e895b93..57cbb6e 100644 --- a/test/script/publish.et +++ b/test/script/publish.et @@ -108,13 +108,15 @@ test PushRepo: $git rev-parse HEAD $git rev-parse HEAD^{tree} + $git reset --hard HEAD~4 + touch workdir/e $git add e $commit -m e $git rev-parse HEAD $git rev-parse HEAD^{tree} - $git reset --hard HEAD~5 + $git reset --hard HEAD~1 $git rev-parse HEAD expect /([0-9a-f]+)/ from git_init capture c_init @@ -133,6 +135,40 @@ test PushRepo: guard (c_init == c_end) let cmd_run = [ "--repo=source_repo:workdir", "--writable-repo=target_repo:target.git", "run" ] + + # Normal push + local: + spawn on n as p args (cmd_run ++ [ "push_job:$cd" ]) killwith SIGINT + expect from p: + /job-enqueue push_job:$cd/ + /job-start push_job:$cd/ + /job-finish push_job:$cd done/ + + expect /(.*)/ from p capture finish + guard (finish == "run-finish") + + shell on n as git_check: + git -C target.git rev-parse HEAD + expect /([0-9a-f]+)/ from git_check capture cur_target + guard (cur_target == cd) + + # Push the same commit as is in target + local: + spawn on n as p args (cmd_run ++ [ "push_job:$cd" ]) killwith SIGINT + expect from p: + /job-enqueue push_job:$cd/ + /job-start push_job:$cd/ + /job-finish push_job:$cd done/ + + expect /(.*)/ from p capture finish + guard (finish == "run-finish") + + shell on n as git_check: + git -C target.git rev-parse HEAD + expect /([0-9a-f]+)/ from git_check capture cur_target + guard (cur_target == cd) + + # Push ancestor commit local: spawn on n as p args (cmd_run ++ [ "push_job:$cb" ]) killwith SIGINT expect from p: @@ -146,7 +182,23 @@ test PushRepo: shell on n as git_check: git -C target.git rev-parse HEAD expect /([0-9a-f]+)/ from git_check capture cur_target - guard (cur_target == cb) + guard (cur_target == cd) + + # Push conflicting commit + local: + spawn on n as p args (cmd_run ++ [ "push_job:$ce" ]) killwith SIGINT + expect from p: + /job-enqueue push_job:$ce/ + /job-start push_job:$ce/ + /job-finish push_job:$ce failed/ + + expect /(.*)/ from p capture finish + guard (finish == "run-finish") + + shell on n as git_check: + git -C target.git rev-parse HEAD + expect /([0-9a-f]+)/ from git_check capture cur_target + guard (cur_target == cd) test PushRepoWritable: |