Skip to content

Commit

Permalink
output/cloud: Usual valid test run ids in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mstoykov committed Jan 12, 2024
1 parent b0f0f02 commit f423f54
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion output/cloud/expv2/integration/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func TestOutputFlush(t *testing.T) {
// init and start the output
o, err := expv2.New(logger, conf, cc)
require.NoError(t, err)
o.SetTestRunID("my-test-run-id-123")
o.SetTestRunID("123")
require.NoError(t, o.Start())

// collect and flush samples
Expand Down
2 changes: 1 addition & 1 deletion output/cloud/expv2/integration/testdata/metricset.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"testRunId": "my-test-run-id-123",
"testRunId": "123",
"aggregationPeriod": 3,
"metrics": [
{
Expand Down
2 changes: 1 addition & 1 deletion output/cloud/expv2/output_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ func TestOutputStopWithTestError(t *testing.T) {
o, err := New(logger, config, cc)
require.NoError(t, err)

o.SetTestRunID("ref-id-123")
o.SetTestRunID("1234")
require.NoError(t, o.Start())
require.NoError(t, o.StopWithTestError(errors.New("an error")))
}
Expand Down
10 changes: 5 additions & 5 deletions output/cloud/output_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,13 @@ func TestOutputCreateTestWithConfigOverwrite(t *testing.T) {
switch r.URL.Path {
case "/v1/tests":
fmt.Fprintf(w, `{
"reference_id": "cloud-create-test",
"reference_id": "12345",
"config": {
"metricPushInterval": "10ms",
"aggregationPeriod": "1s"
}
}`)
case "/v1/tests/cloud-create-test":
case "/v1/tests/12345":
w.WriteHeader(http.StatusOK)
default:
http.Error(w, "not expected path", http.StatusInternalServerError)
Expand Down Expand Up @@ -216,7 +216,7 @@ func TestOutputStartWithTestRunID(t *testing.T) {
Logger: testutils.NewLogger(t),
Environment: map[string]string{
"K6_CLOUD_HOST": ts.URL,
"K6_CLOUD_PUSH_REF_ID": "my-passed-id",
"K6_CLOUD_PUSH_REF_ID": "12345",
},
ScriptOptions: lib.Options{
SystemTags: &metrics.DefaultSystemTagSet,
Expand Down Expand Up @@ -252,7 +252,7 @@ func TestOutputStopWithTestError(t *testing.T) {

handler := func(w http.ResponseWriter, r *http.Request) {
switch r.URL.Path {
case "/v1/tests/test-ref-id-1234":
case "/v1/tests/1234":
b, err := io.ReadAll(r.Body)
require.NoError(t, err)

Expand Down Expand Up @@ -282,7 +282,7 @@ func TestOutputStopWithTestError(t *testing.T) {
require.NoError(t, err)

calledStopFn := false
out.testRunID = "test-ref-id-1234"
out.testRunID = "1234"
out.versionedOutput = versionedOutputMock{
callback: func(fn string) {
if fn == "StopWithTestError" {
Expand Down

0 comments on commit f423f54

Please sign in to comment.