Skip to content

Commit

Permalink
fixup! cloud: Increased the test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
codebien committed May 16, 2023
1 parent 8405799 commit deeadbe
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions output/cloud/output_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"go.k6.io/k6/lib/types"
"go.k6.io/k6/metrics"
"go.k6.io/k6/output"
cloudv1 "go.k6.io/k6/output/cloud/v1"
"gopkg.in/guregu/null.v3"
)

Expand Down Expand Up @@ -153,6 +154,25 @@ func TestOutputStartVersionError(t *testing.T) {
require.ErrorContains(t, err, "v99 is an unexpected version")
}

func TestOutputStartVersionedOutputV1(t *testing.T) {
t.Parallel()

o := Output{
referenceID: "123",
config: cloudapi.Config{
APIVersion: null.IntFrom(1),
// Here, we are mostly silencing the flushing op
MetricPushInterval: types.NullDurationFrom(1 * time.Hour),
},
}

err := o.startVersionedOutput()
require.NoError(t, err)

_, ok := o.versionedOutput.(*cloudv1.Output)
assert.True(t, ok)
}

func TestOutputStartWithReferenceID(t *testing.T) {
t.Parallel()

Expand Down

0 comments on commit deeadbe

Please sign in to comment.