Skip to content

Commit 1ff76af

Browse files
committed
add integration tests
1 parent 35f26d2 commit 1ff76af

8 files changed

Lines changed: 22 additions & 4 deletions

File tree

commander_linux.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ tests:
66
- ✓ [ssh-host] it should test ssh host
77
- ✓ [ssh-host] it should set env variable
88
- ✓ [ssh-host-default] it should be executed on ssh-host-default
9+
- "- [] it should skip, was skipped"
910
- ✓ [ssh-host] it should test multiple hosts
1011
- ✓ [ssh-host-default] it should test multiple hosts
1112
- ✓ [local] it should test multiple hosts

commander_unix.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ tests:
1515
stdout:
1616
contains:
1717
- ✓ [local] it should exit with error code
18-
line-count: 16
18+
- "- [] it should skip, was skipped"
19+
line-count: 17
1920
exit-code: 0
2021

2122
it should assert that commander will fail:

commander_windows.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ tests:
1414
command: commander.exe test ./integration/windows/commander_test.yaml
1515
stdout:
1616
contains:
17+
- "- [] it should skip, was skipped"
1718
- test
1819
exit-code: 0
1920

integration/linux/nodes.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ tests:
4040
it should be executed on ssh-host-default:
4141
command: whoami
4242
stdout: root
43+
44+
it should skip:
45+
command: whoami
46+
stdout: root
47+
skip: true
4348

4449
it should test multiple hosts:
4550
command: echo hello

integration/unix/commander_test.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,8 @@ tests:
6565
command: echo $USER
6666
stdout: from_parent
6767
exit-code: 0
68+
69+
it should skip:
70+
command: whoami
71+
stdout: root
72+
skip: true

integration/windows/commander_test.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,9 @@ tests:
3838
command: echo lorem ipsum
3939
stdout:
4040
not-contains:
41-
- not contains
41+
- not contains
42+
43+
it should skip:
44+
command: whoami
45+
stdout: root
46+
skip: true

pkg/output/cli.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ func (w *OutputWriter) printResult(r TestResult) {
9191
}
9292

9393
func (w *OutputWriter) printSkip(r TestResult) {
94-
w.fprintf(fmt.Sprintf("- [skipped] %s", r.Title))
94+
w.fprintf(fmt.Sprintf("- [] %s, was skipped", r.Title))
9595
}
9696

9797
func (w *OutputWriter) printFailures(results []runtime.TestResult) {

pkg/output/cli_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func Test_EventHandlerTestSkipped(t *testing.T) {
5151
}
5252
}
5353
output := buf.String()
54-
assert.Contains(t, output, "- [skipped] Skipped test")
54+
assert.Contains(t, output, "- [] Skipped test, was skipped")
5555
}
5656

5757
func Test_PrintSummary(t *testing.T) {

0 commit comments

Comments
 (0)