(t *testing.T)
| 69 | } |
| 70 | |
| 71 | func Test_RuntimeWithRetriesAndInterval(t *testing.T) { |
| 72 | s := getExampleTestCases() |
| 73 | s[0].Command.Retries = 3 |
| 74 | s[0].Command.Cmd = "echo fail" |
| 75 | s[0].Command.Interval = "50ms" |
| 76 | |
| 77 | start := time.Now() |
| 78 | r := getRuntime() |
| 79 | got := r.Start(s) |
| 80 | |
| 81 | var counter = 0 |
| 82 | for _, r := range got.TestResults { |
| 83 | counter++ |
| 84 | assert.False(t, r.ValidationResult.Success) |
| 85 | assert.Equal(t, 3, r.Tries) |
| 86 | } |
| 87 | duration := time.Since(start) |
| 88 | |
| 89 | assert.Equal(t, 1, counter) |
| 90 | assert.True(t, duration.Seconds() > 0.15, "Retry interval did not work") |
| 91 | } |
| 92 | |
| 93 | func Test_RuntimeWithSkip(t *testing.T) { |
| 94 | s := getExampleTestCases() |
nothing calls this directly
no test coverage detected