File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,14 @@ import os
2
2
3
3
const vexe = @VEXE
4
4
5
+ const is_ci = os.getenv ('CI' ) == 'true'
6
+
7
+ fn dump_on_ci [T](x T) {
8
+ if is_ci {
9
+ dump (x)
10
+ }
11
+ }
12
+
5
13
fn test_retry () {
6
14
tpath := os.join_path (os.vtmp_dir (), 'vretry_test' )
7
15
os.rmdir_all (tpath) or {}
@@ -11,26 +19,29 @@ fn test_retry() {
11
19
}
12
20
13
21
fail_cmd := 'git asdf'
14
- if os. getenv ( 'CI' ) == 'true' {
22
+ if is_ci {
15
23
// Skip longer running test on local runs.
16
24
res := os.execute ('${vexe} retry ${fail_cmd} ' )
17
25
assert res.exit_code != 0
18
26
assert res.output.contains ('error: exceeded maximum number of retries' )
19
27
}
20
28
21
29
mut res := os.execute ('${vexe} retry -d 0.2 -r 3 ${fail_cmd} ' )
30
+ dump_on_ci (res)
22
31
assert res.exit_code != 0
23
32
assert res.output.contains ('error: exceeded maximum number of retries (3)!' )
24
33
25
34
os.chdir (os.dir (vexe))!
26
35
pass_cmd := 'git branch'
27
36
res = os.execute ('${vexe} retry ${pass_cmd} ' )
37
+ dump_on_ci (res)
28
38
assert res.exit_code == 0
29
39
assert res.output == os.execute (pass_cmd).output
30
40
31
41
// Include flags on the cmd as well.
32
42
pass_cmd_with_flags := 'git branch --list'
33
43
res = os.execute ('${vexe} retry -r 3 -- ${pass_cmd_with_flags} ' )
44
+ dump_on_ci (res)
34
45
assert res.exit_code == 0
35
46
assert res.output == os.execute (pass_cmd_with_flags).output
36
47
}
You can’t perform that action at this time.
0 commit comments