-
-
Notifications
You must be signed in to change notification settings - Fork 746
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
pants-plugins/uses_services: respect ST2_DATABASE__*
vars
#6278
Open
cognifloyd
wants to merge
4
commits into
master
Choose a base branch
from
pants-plugins-uses_services-refactor
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cognifloyd
requested review from
winem,
nzlosh,
rush-skills,
guzzijones,
amanda11 and
a team
November 17, 2024 05:33
pull-request-size
bot
added
the
size/L
PR that changes 100-499 lines. Requires some effort to review.
label
Nov 17, 2024
guzzijones
approved these changes
Nov 19, 2024
cognifloyd
commented
Nov 19, 2024
Comment on lines
+243
to
+249
# Use these to override MongoDB connection details | ||
# "ST2_DATABASE__HOST", # Tests override this with "127.0.0.1" | ||
"ST2_DATABASE__PORT", | ||
# "ST2_DATABASE__DB_NAME", # Tests override this with: "st2-test{ST2TESTS_PARALLEL_SLOT}" | ||
"ST2_DATABASE__CONNECTION_TIMEOUT", | ||
"ST2_DATABASE__USERNAME", | ||
"ST2_DATABASE__PASSWORD", |
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.
These changes affect running all tests, not just pants-plugins/uses_services
.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
database
enhancement
infrastructure: ci/cd
pantsbuild
refactor
size/L
PR that changes 100-499 lines. Requires some effort to review.
tests
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