-
Notifications
You must be signed in to change notification settings - Fork 580
End-to-end publish test using examples from docs #199
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
Codecov ReportAttention: Patch coverage is
📢 Thoughts on this report? Let us know! |
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.
The delta here is the tests from integrationtests/publish_integration_test.go, tweaked to use the slightly different mocks defined in this file
tadasant
left a comment
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 is awesome, thank you! Looks great.
Closes #105 by adding an end-to-end test that uses
publisherto publish examples fromdocs/server-json/examples.mdto a live local registry so we can have some confidence that the examples are valid andpublisherandregistrywork together.sample output
To make this possible in a local dev loop without modifying (much of) the registry's internals, I added a build tag that disables registry auth. Gating this feature behind a build tag makes it hard to enable accidentally and ensures the no-auth code doesn't exist in normal builds, and
registryprints a warning when auth was disabled at build time. I also tweakedpublisherto return a nonzero exit code when an operation fails.Running the test exposed a bug fixed in this PR: a couple mongo operations used
versiondetailin a key whereas theServermodel usesversion_detail.I did a little reorganizing as well by moving the publish handler tests in
/integrationtests, which rely on mocking internal implementations, into the existing unit test suite.Types of changes
Checklist