-
Notifications
You must be signed in to change notification settings - Fork 2
Test Suite Using Ginkgo #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| data | ||
| (struct { ResultType string "json:\"resultType\""; Result []e2e_tests.MatrixResult "json:\"result\"" }) { | ||
| ResultType: (string) (len=6) "matrix", | ||
| Result: ([]e2e_tests.MatrixResult) <nil> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty much all the tests have Result: ([]e2e_tests.MatrixResult) <nil> . That's wrong. The result should be non-nil
| var seriesResp SeriesResponse | ||
| err = json.Unmarshal(body, &seriesResp) | ||
| Expect(err).NotTo(HaveOccurred()) | ||
| err = cupaloy.New().SnapshotMulti( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This snapshot should be for the response body as well. Not just for status.
| Expect(err).NotTo(HaveOccurred()) | ||
|
|
||
| Expect(resp.StatusCode).To(Equal(200)) | ||
| err = cupaloy.New().SnapshotMulti( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This snapshot should be for the response body as well. Not just for status.
| resp, err := runRequest(fmt.Sprintf(`{test_id="%s"} | freq > 1 and (freq="4" or freq==2 or freq > 0.5)`, testID), 0, 0, 0, "", 0) | ||
| Expect(err).NotTo(HaveOccurred()) | ||
| adjustResult(resp, "", 0) | ||
| err = cupaloy.New().SnapshotMulti( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This snapshot should be for the response body as well. Not just for status.
| Expect(err).NotTo(HaveOccurred()) | ||
| adjustResult(resp, "", 0) | ||
| err = cupaloy.New().SnapshotMulti( | ||
| "status", resp.Status, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This snapshot should be for the response body as well. Not just for status.
e2e_tests/misc_test.go
Outdated
| Expect(err).ToNot(HaveOccurred()) | ||
| defer resp.Body.Close() | ||
| Expect(resp.StatusCode).To(Equal(200)) | ||
| err = cupaloy.New().SnapshotMulti( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this snapshot check.
e2e_tests/misc_test.go
Outdated
| Expect(err).ToNot(HaveOccurred()) | ||
| defer resp.Body.Close() | ||
| Expect(resp.StatusCode).To(Equal(200)) | ||
| err = cupaloy.New().SnapshotMulti( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this snapshot check.
e2e_tests/misc_test.go
Outdated
| Expect(err).ToNot(HaveOccurred()) | ||
| defer resp.Body.Close() | ||
| Expect(resp.StatusCode).To(Equal(200)) | ||
| err = cupaloy.New().SnapshotMulti( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this snapshot check.
e2e_tests/misc_test.go
Outdated
| Expect(err).ToNot(HaveOccurred()) | ||
| defer resp.Body.Close() | ||
| Expect(resp.StatusCode).To(Equal(200)) | ||
| err = cupaloy.New().SnapshotMulti( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this snapshot check.
e2e_tests/misc_test.go
Outdated
| defer resp.Body.Close() | ||
| Expect(resp.StatusCode).To(Equal(401)) | ||
| } | ||
| err = cupaloy.New().SnapshotMulti( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this snapshot check.
Implementation for #6