-
-
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: add support for uses=st2cluster in BUILD metadata #6279
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.
@cognifloyd I've approved but left some comments. Most are about the copyright, which may well be correct, if those changes were started in 2023. But if not then please amend to 2024.
Doh! I messed up the copyright again. Thanks for catching that, I'll fix it today. |
The copyrights were copy/pasta. These files were written in 2024, not 2023.
@cognifloyd lint checks failed |
…hosts/ports In the uses_services plugin, I am now adding env var support (in several PRs), but so far I've avoiding parsing conf files. Plus, allowing reconfiguration of the st2cluster hosts/ports would require the st2client and st2 dev cluster config to align. Today, the st2cluster integration tests hardcode st2client's base_url to `http://127.0.0.1`. Technically someone could override the endpoint URLs with ST2_{AUTH,API,STREAM}_URL env vars, but they would also need to make sure whatever cluster they use has the examples pack and other things handled by `launchdev.sh`. Today, the other alternative for using a different cluster would be to forward the service ports to the localhost at the standard ports. For now, just use a separate host for each endpoint so it is easier to support overriding via env vars and/or conf files at some point in the future--if someone needs that. Until then, we'll go with the minimal implementation that assumes the default hosts and ports.
491a4a2
to
b0767b9
Compare
K. I fixed my lint issue. All CI is passing 😄. One more review, and this can be merged. |
This PR's commits were extracted from #6273 where I'm working on getting pants+pytest to run integration tests.
Today, we run a dev st2 cluster using
tools/launchdev.sh
for all integration tests. However, only a subset of the tests actually make use of the running service. The only tests that require the dev st2 cluster are orquesta runner integration tests (which run today as part of integration tests) and the orquesta integration tests (inst2tests/integration/orquesta
) that today run in a separate Orquesta Tests CI job.The rest of the integration tests actually start the
st2api
or other process as part of the test, so they ignore the dev cluster, meaning CI doesn't need to the overhead of running the full cluster to run those tests. Plus, when running the tests locally, you don't need to run the dev cluster either, unless you need to run the orquesta tests.So, this PR adds a new
st2cluster
service topants-plugins/uses_services
so that we can check for the running dev cluster and raise an error if the cluster isn't running when attempting to run the tests that need it.I also added an
st2cluster
tag to the BUILD metadata of these tests so that it is simple to run only the tests that needst2cluster
or run allintegration
tagged tests except for thest2cluster
tagged tasks. To skip thest2cluster
tagged tasks, you might run pants like this:pants --tag=integration --tag=-st2cluster test ::
.It might be helpful to review each commit of this PR. Sorry for the size of the first commit; I don't see a sane way to split this PR up any farther.
For background 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