-
Notifications
You must be signed in to change notification settings - Fork 28
Update unit test coverage for tools + secret packages #85
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
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.
Just left one suggestion for a change, but otherwise code lgtm. Thanks for adding these!
CONTRIBUTING.md
Outdated
# Run integration tests (requires Docker plugin to be installed) | ||
make integration | ||
|
||
# Run integration tests with console output |
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.
question: Did this mean to say "unit tests"?
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.
Ah nice catch, updated it to remove the integration command to avoid confusion
### Unit Test Coverage | ||
|
||
```bash | ||
# Generate HTML coverage report for ALL packages in one view |
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.
Nice!
cmd/docker-mcp/tools/enable_test.go
Outdated
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.
suggestion: I would recommend keeping all tools.go
tests in a single tools_test.go
file. In my experience that's golang convention for unit tests, but also I think it would make browsing go source files difficult with lots of test files bloating the filesystem. wdyt?
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.
@cmrigney - good idea, we don't have many tests to begin with so let's stick with that pattern and can re-visit it as needed. Updated to keep the tests in tools_test.go
Add coverage for package secret Linter issues Consolidate tools tests into tools test file Clean-up test structure update contributing
9791244
to
06c9f7d
Compare
What I did
Test coverage needs to be improved.
CONTRIBUTING.md
updated with Testing section - which contains commands for quickly understanding current coverage and snippets for analyzing integration test outputIncreased coverage for
tools
package to:58.9%
from36.0%
(Note this is only for unit, integration coverage is higher)Added tests for
secret
package.set.go
coverage is now60%
Note: This PR focused on adding simple tests for input criteria - subsequent test changes will tackle mocking providers where it makes sense to increase additional test coverage
Related issue
36.0%
of statements. See screenshot below for tools package file coverage breakdown:0.0%
(not mandatory) A picture of a cute animal, if possible in relation to what you did
🕸️