Skip to content
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 ci: Run self-check tests w/ venv generated by pants #6287

Merged
merged 10 commits into from
Dec 17, 2024

Conversation

cognifloyd
Copy link
Member

@cognifloyd cognifloyd commented Dec 12, 2024

This adds a Pants-based CI job to run st2-self-check with a virtualenv generated by pants.

I recommend reviewing each commit.
The largest chunk of this PR is in 12af930 where I add the GHA job that runs st2-self-check.
Everything else is minor cleanup (or bugfixes) of several random scripts and a test.

I can split the unrelated changes into a separate PR if needed, but they're fairly small, so I hope we can just include them here.

@cognifloyd cognifloyd added this to the pants milestone Dec 12, 2024
@cognifloyd cognifloyd self-assigned this Dec 12, 2024
@pull-request-size pull-request-size bot added the size/L PR that changes 100-499 lines. Requires some effort to review. label Dec 12, 2024
@cognifloyd cognifloyd force-pushed the pants-itests-self-check branch from 84c5a9d to d46b106 Compare December 12, 2024 03:32
Comment on lines +34 to +41
def setUp(self):
super().setUp()
# pre-condition: Make sure there is no test pollution
sw_queues = self._get_sensor_watcher_amqp_queues(
queue_name="st2.sensor.watch.covfefe"
)
# TODO: Maybe just delete any leftover queues from previous failed test runs.
self.assertTrue(len(sw_queues) == 0)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is unrelated to this PR. This test failed for several runs, and now it is magically passing.

Apparently we still have some cross test pollution with data in RabbitMQ. So, I'll leave this here and next time we see the bug, hopefully we can figure out how to prevent that cross test pollution that can make tests randomly fail.

I'm wondering about having some pytest fixture handle cleaning up all exchanges/queues for the execution slot before running any tests. If we do that, then we'd need to make sure not to break the tests that use the full st2 cluster (started with tools/launchdev.sh).

@cognifloyd cognifloyd marked this pull request as ready for review December 12, 2024 04:39
@cognifloyd cognifloyd requested a review from a team December 17, 2024 14:33
@cognifloyd cognifloyd merged commit b62e82e into master Dec 17, 2024
48 checks passed
@cognifloyd cognifloyd deleted the pants-itests-self-check branch December 17, 2024 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
infrastructure: ci/cd pantsbuild size/L PR that changes 100-499 lines. Requires some effort to review. tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants