(t *testing.T)
| 79 | } |
| 80 | |
| 81 | func Test_SSHExecutor_ExitCode(t *testing.T) { |
| 82 | if !isSSHTestsEnabled() { |
| 83 | return |
| 84 | } |
| 85 | |
| 86 | s := createExecutor() |
| 87 | |
| 88 | test := TestCase{ |
| 89 | Command: CommandUnderTest{ |
| 90 | Cmd: "exit 2;", |
| 91 | }, |
| 92 | } |
| 93 | |
| 94 | got := s.Execute(test) |
| 95 | |
| 96 | assert.False(t, got.ValidationResult.Success) |
| 97 | assert.Equal(t, 2, got.TestCase.Result.ExitCode) |
| 98 | } |
| 99 | |
| 100 | func isSSHTestsEnabled() bool { |
| 101 | v := os.Getenv("COMMANDER_SSH_TEST") |
nothing calls this directly
no test coverage detected