diff options
author | Valery Piashchynski <[email protected]> | 2021-08-12 13:25:36 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2021-08-12 13:25:36 +0300 |
commit | ecbfc5c5265a9895f4e371ce4388f64df8714e63 (patch) | |
tree | df0749155487eae6bcdbb2456885131a21916f4d /plugins/jobs/job/job_options_test.go | |
parent | 4169e8374f581ba2213f8cd1833cc6b9b84438e8 (diff) |
Remove unneeded options, complete tests for the ephemeral, update proto
Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'plugins/jobs/job/job_options_test.go')
-rw-r--r-- | plugins/jobs/job/job_options_test.go | 42 |
1 files changed, 6 insertions, 36 deletions
diff --git a/plugins/jobs/job/job_options_test.go b/plugins/jobs/job/job_options_test.go index 061e83cc..a47151a3 100644 --- a/plugins/jobs/job/job_options_test.go +++ b/plugins/jobs/job/job_options_test.go @@ -7,16 +7,6 @@ import ( "github.com/stretchr/testify/assert" ) -func TestOptions_RetryDuration(t *testing.T) { - opts := &Options{RetryDelay: 0} - assert.Equal(t, time.Duration(0), opts.RetryDuration()) -} - -func TestOptions_RetryDuration2(t *testing.T) { - opts := &Options{RetryDelay: 1} - assert.Equal(t, time.Second, opts.RetryDuration()) -} - func TestOptions_DelayDuration(t *testing.T) { opts := &Options{Delay: 0} assert.Equal(t, time.Duration(0), opts.DelayDuration()) @@ -27,49 +17,29 @@ func TestOptions_DelayDuration2(t *testing.T) { assert.Equal(t, time.Second, opts.DelayDuration()) } -func TestOptions_TimeoutDuration(t *testing.T) { - opts := &Options{Timeout: 0} - assert.Equal(t, time.Minute*30, opts.TimeoutDuration()) -} - -func TestOptions_TimeoutDuration2(t *testing.T) { - opts := &Options{Timeout: 1} - assert.Equal(t, time.Second, opts.TimeoutDuration()) -} - func TestOptions_Merge(t *testing.T) { opts := &Options{} opts.Merge(&Options{ - Pipeline: "pipeline", - Delay: 2, - Timeout: 1, - RetryDelay: 1, + Pipeline: "pipeline", + Delay: 2, }) assert.Equal(t, "pipeline", opts.Pipeline) assert.Equal(t, int64(2), opts.Delay) - assert.Equal(t, int64(1), opts.Timeout) - assert.Equal(t, int64(1), opts.RetryDelay) } func TestOptions_MergeKeepOriginal(t *testing.T) { opts := &Options{ - Pipeline: "default", - Delay: 10, - Timeout: 10, - RetryDelay: 10, + Pipeline: "default", + Delay: 10, } opts.Merge(&Options{ - Pipeline: "pipeline", - Delay: 2, - Timeout: 1, - RetryDelay: 1, + Pipeline: "pipeline", + Delay: 2, }) assert.Equal(t, "default", opts.Pipeline) assert.Equal(t, int64(10), opts.Delay) - assert.Equal(t, int64(10), opts.Timeout) - assert.Equal(t, int64(10), opts.RetryDelay) } |