diff --git a/internal/k6runner/k6runner_test.go b/internal/k6runner/k6runner_test.go index 2f4e83ef..d44ba926 100644 --- a/internal/k6runner/k6runner_test.go +++ b/internal/k6runner/k6runner_test.go @@ -11,7 +11,6 @@ import ( "net" "net/http" "net/http/httptest" - "reflect" "sort" "strconv" "strings" @@ -118,7 +117,12 @@ func TestHttpRunnerRun(t *testing.T) { require.Equal(t, http.MethodPost, r.Method) require.Equal(t, "application/json", r.Header.Get("Content-Type")) - var req HTTPRunRequest + var req struct { + Script []byte `json:"script"` + Settings Settings `json:"settings"` + NotAfter time.Time `json:"notAfter"` + } + err := json.NewDecoder(r.Body).Decode(&req) if err != nil { t.Logf("decoding body: %v", err) @@ -127,13 +131,6 @@ func TestHttpRunnerRun(t *testing.T) { return } - if !reflect.DeepEqual(script, req.Script) { - t.Log("unexpected script in request") - t.Fail() - w.WriteHeader(400) // Use 400 as the client won't retry this failure. - return - } - if time.Since(req.NotAfter) > time.Hour || time.Until(req.NotAfter) > time.Hour { t.Log("unexpected value for NotAfter too far from the present") t.Fail()