Add unit tests for Workflow Manager#169
Conversation
Summary of ChangesHello @ginaxu1, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the test suite for the backend's workflow module. By introducing dedicated unit tests for key components, it aims to improve code reliability, catch regressions early, and ensure the correct functioning of workflow orchestration, consignment management, and state transitions. The addition of new testing libraries facilitates robust and isolated testing of database interactions and complex logic. Highlights
Changelog
Ignored Files
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
backend/internal/workflowThere was a problem hiding this comment.
Code Review
This pull request adds a comprehensive suite of unit tests for the backend/internal/workflow and related packages, which is a great step towards improving code quality and reliability. The tests cover various services, models, and managers, using mocks and sqlmock effectively. My review includes a few suggestions to enhance the new tests by improving robustness and maintainability, such as replacing time.Sleep with more reliable synchronization and consolidating duplicated test helper functions.
d08047b to
8b72995
Compare
|
Still most of the files are under 80% |
df955a6 to
8dddae2
Compare
8dddae2 to
41f433f
Compare
Summary
Add Unit Tests to
backend/internal/workflowTesting
go test -coverprofile=coverage.out ./internal/workflow/... ok github.com/OpenNSW/nsw/internal/workflow 0.578s coverage: 73.0% of statements ok github.com/OpenNSW/nsw/internal/workflow/model 0.184s coverage: 91.4% of statements ok github.com/OpenNSW/nsw/internal/workflow/router 0.761s coverage: 64.8% of statements ok github.com/OpenNSW/nsw/internal/workflow/service 0.387s coverage: 76.3% of statementsRelated Issues
Related to #153