-
Notifications
You must be signed in to change notification settings - Fork 19
/
commander_unix.yaml
161 lines (144 loc) · 4.7 KB
/
commander_unix.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
tests:
it should fail with invalid argument:
command: ./commander asfdf
exit-code: 3
it should display help:
command: ./commander
exit-code: 0
it should execute tests:
config:
env:
USER: from_parent
command: ./commander test ./integration/unix/commander_test.yaml
stdout:
contains:
- ✓ [local] it should exit with error code
- "- [local] it should skip, was skipped"
line-count: 20
exit-code: 0
it should assert that commander will fail:
command: ./commander test ./integration/unix/failing_suite.yaml
stdout:
contains:
- ✗ [local] 'file matcher should fail when file and output are different', on property 'Stdout'
- ✗ [local] 'it will fail', on property 'ExitCode'
- ✗ [local] 'test timeout' could not be executed with error message
- Command timed out after 10ms
- "Count: 3, Failed: 3"
exit-code: 1
it should validate a big output:
command: ./commander test ./integration/unix/test_big_output.yaml
stdout:
contains:
- ✓ [local] cat ./integration/unix/_fixtures/big_out.txt
- "Count: 1, Failed: 0"
exit-code: 0
test global and local configurations:
command: ./commander test ./integration/unix/config_test.yaml
config:
env:
COMMANDER_FROM_SHELL: from_shell
stdout:
contains:
- ✓ [local] should print global env value
- ✓ [local] should print local env value
- ✓ [local] should print env var from shell
exit-code: 0
test add command:
command: ./commander add --no-file --stdout "echo hello"
stdout: |-
tests:
echo hello:
exit-code: 0
stdout: hello
exit-code: 0
test retries:
command: ./commander test integration/unix/retries.yaml
stdout:
contains:
- ✗ [local] echo hello, retries 3
- ✓ [local] it should retry failed commands, retries 2
- ✗ [local] it should retry failed commands with an interval, retries 2
exit-code: 1
test directory order:
command: ./commander test --dir integration/unix/directory_test/
stdout:
lines:
3: ✓ [alpha_test.yaml] [local] sleep test
4: ✓ [beta_test.yaml] [local] ehco hello
test missing dir flag:
command: ./commander test integration/unix/directory_test/
stdout:
contains:
- 'integration/unix/directory_test/: is a directory'
exit-code: 1
test filter flag works:
command: ./commander test integration/unix/filter_test.yaml --filter=executed
stdout:
contains:
- ✓ [local] should be executed
- ✓ [local] should also be executed
not-contains:
- should be filtered
exit-code: 0
test filter flag with regex:
command: ./commander test integration/unix/filter_test.yaml --filter="executed$"
stdout:
contains:
- ✓ [local] should be executed
- ✓ [local] should also be executed
not-contains:
- should be ignored
- executed at the beginning is ignored
exit-code: 0
test mulitple filters:
command: ./commander test integration/unix/filter_test.yaml --filter="executed$" --filter="should be ignored"
stdout:
contains:
- ✓ [local] should be executed
- ✓ [local] should also be executed
- ✓ [local] should be ignored
not-contains:
- executed at the beginning is ignored
exit-code: 0
it should be executed in alphabetical order:
command: ./commander test integration/unix/alphabetically_order.yaml
stdout:
contains:
- |-
✓ [local] ---
✓ [local] 123
✓ [local] a
✓ [local] b
exit-code: 0
it should execute test from url:
skip: false
config:
env:
USER: from_parent
command: ./commander test https://raw.githubusercontent.com/commander-cli/commander/master/integration/unix/remote_http.yaml
stdout:
contains:
- ✓ [local] hello world
exit-code: 0
test stdin input:
command: cat integration/unix/stdin.yaml | ./commander test -
stdout:
contains:
- ✓ [local] hello world
exit-code: 0
test workdir flag:
command: ./commander test --workdir integration/unix/ workdir.yaml
stdout:
contains:
- ✓ [local] echo hello
exit-code: 0
test config flag:
command: ./commander test --config integration/unix/_fixtures/overwrite_config.yaml integration/unix/overwrite.yaml
stdout:
contains:
- ✗ [local] echo hello, retries 2
- ✗ [local] should retry 3 times, retries 3
- ✓ [local] should use key from config
- ✓ [local] should use dir from config
exit-code: 1