pants-plugins/uses_services: respect ST2_DATABASE__*
vars
#6278
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR's commits were extracted from #6273 where I'm working on getting pants+pytest to run integration tests.
This lightly refactors
pants-plugins/uses_services
to make it easier to mention theST2_*
conf vars (introduced in #6277) in the instructions messages that the plugin prints when a service isn't running.Then this PR updates the mongo rules to make use of the
ST2_DATABASE__*
conf vars if present. Thus, people can useST2_DATABASE__*
both in production and when testing to use whatever database they choose.This only passes a subset of the possible
ST2_DATABASE__*
vars to tests. If anyone wants to add others, they need to review the tests to see if the tests override that setting or not. This is the config that tells pants to pass these vars to pytest:st2/pants.toml
Lines 238 to 249 in 5c384d9
For background context on
pants-plugins/uses_services
see:pants-plugins/uses_services
to check before running tests for required services (like mongo) #5864pants-plugins/uses_services
to support checking for rabbitmq #5884pants-plugins/uses_services
to support checking for redis #5893pants-plugins/uses_services
improvements #5898system_user
detection topants-plugins/uses_services
(+mongo
detection improvements) #6244