-
Couldn't load subscription status.
- Fork 88
CLOUDP-305055 Add snapshot testing #3760
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
Conversation
5c639d0 to
5c55578
Compare
test/e2e/snapshot_test.go
Outdated
| } | ||
|
|
||
| for k, v := range data { | ||
| if k == "__body__" || k == "__status__" || k == "__method__" || k == "__path__" { |
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.
Could you define these strings as constants?
test/e2e/snapshot_test.go
Outdated
| } | ||
|
|
||
| var data map[string]any | ||
| if err := json.Unmarshal(buf, &data); err != 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.
[q] What's the reason for using a map[string]map[string]any{} over a type Memory struct that contains a strongly typed version of the memory?
test/e2e/snapshot_test.go
Outdated
| } | ||
|
|
||
| func updateSnapshots() bool { | ||
| return isTrue(os.Getenv("UPDATE_SNAPSHOTS")) |
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.
Could you also turn this into a constant?
|
Coverage Report 📈
|
Proposed changes
Add snapshot testing
Jira ticket: CLOUDP-305055
Closes #[issue number]
Checklist
make fmtand formatted my codeFurther comments
Note: first commit has all code, second commit has a bunch of snapshots in json format
Test failures:
Excluded tests:
Follow ups: