-
Notifications
You must be signed in to change notification settings - Fork 805
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
Add unit tests for methods in frontend API handler #6119
Add unit tests for methods in frontend API handler #6119
Conversation
s.mockDomainCache.EXPECT().GetDomainName(s.testDomainID).Return(s.testDomain, nil) | ||
wh.config.DecisionResultCountLimit = dc.GetIntPropertyFilteredByDomain(10) | ||
}, | ||
expectError: true, |
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.
Can we assert error message? You can change through expectError string
and assert.ErrorContains()
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.
Thank you for your comment, I have made the change.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted filessee 13 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
Pull Request Test Coverage Report for Build 018feab2-d9fc-47c6-b1ec-38eeb350d343Details
💛 - Coveralls |
**What changed?** Excluded `domains` that have `preferredClusters` that are not present in its `cluster` list in `ReplicationConfiguration` **Why?** `Domains` with `preferredClusters` not in their `cluster` list were causing the `workflow` to panic when trying to acquire the `client` for the `preferredCluster` from the `remoteFrontendClients` **How did you test it?** unit tests and local replication tests **Potential risks** The `workflow` was generally not working before because having a `preferredCluster` not in the `domain` `cluster` list is a normal scenario. The risk introduced is the `workflow` actually executing and doing something unexpected. For now, we just rebalance `domains` that have `preferredCluster` set and that can be rebalanced back to their `preferredCluster` **Release notes** **Documentation Changes**
Apparently that was being searched, and it noticed a "thing.go" folder that git made! So now this has two improvements: 1. it does not step into the `.git` folder, because obviously there is no source that needs formatting in there 2. it only finds files, `-type f`, because directories aren't source files Both pretty obviously good to have in retrospect. --- A way to validate this kind of change for the future: 1. change the `SHELL = ...` line near the top of the makefile to include a `-x` debug flag. `make` will now print all the shell commands it runs, including this `find`. 2. copy it and run it by hand and check the output. in particular, this time I just had it find _all_ files to check where it looked, and made sure the list was reasonable (it included my local .idea, but that seems fine, it's small and has no go files) I should've done 2 earlier when I added this `find` command, I likely would have noticed the directories and `.git` and removed them. Sorry about that.
…#6062) * Add tests for mutable_state_util_test.go * added mutablestate assertions
Also renamed variable as `r` looks too short and stands more for reader or ref rather than response/result.
Pull Request Test Coverage Report for Build 018feecd-c54b-4228-8334-8ea702900f98Details
💛 - Coveralls |
What changed?
Add unit tests for RespondDecisionTaskCompleted in frontend api handler
Why?
Improve test coverage
How did you test it?
Unit tests
Potential risks
Release notes
Documentation Changes