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

enable streaming of integration test output #21912

Merged
merged 7 commits into from
Feb 5, 2025

Conversation

tdyas
Copy link
Contributor

@tdyas tdyas commented Feb 4, 2025

Add support to the Pants integration test framework to stream output to the console. This is very useful when debugging long-running integration tests which would otherwise show no output while they run since the integration test framework currently only captures output to a buffer.

Adds a stream_output parameter to PantsJoinHandle.join, run_pants_with_workdir, and run_pants. Enable stream_output=True on a specific invocation of run_pants_with_workdir and run_pants, and then run the test with --debug so the test is invoked as an interactive process.

@tdyas tdyas requested review from benjyw and huonw February 4, 2025 05:32
@tdyas tdyas added category:internal CI, fixes for not-yet-released features, etc. release-notes:not-required PR doesn't require mention in release notes labels Feb 4, 2025
@tdyas tdyas removed the release-notes:not-required PR doesn't require mention in release notes label Feb 4, 2025
Copy link
Contributor

@huonw huonw left a comment

Choose a reason for hiding this comment

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

Just confirming: this is designed to be used in an adhoc way? For instance: someone is working on a specific feature with a particular integration test of interest, so they temporarily turn stream_output=True on while iterating.

If so, sounds cool!

It might be nifty to document "permanently" too, in addition to the "transient" mention in release notes (likely only seen by someone upgrading to 2.25). Maybe https://www.pantsbuild.org/stable/docs/writing-plugins/the-rules-api/testing-plugins#approach-4-run_pants-integration-tests-for-pants is a good place to mention it too?

The code looks fine, and the release note paragraph seems fine as is (my suggestions are optional), plus it seems like it only needs light edits to be sensible as long-term docs... so approved conditional on copying that somewhere sensible more permanent!

docs/notes/2.25.x.md Outdated Show resolved Hide resolved
tdyas and others added 3 commits February 4, 2025 19:11
Copy link
Contributor

@benjyw benjyw left a comment

Choose a reason for hiding this comment

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

Nice!

@tdyas tdyas merged commit 51b0421 into pantsbuild:main Feb 5, 2025
24 checks passed
@tdyas tdyas deleted the stream-integration-test-output branch February 5, 2025 01:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:internal CI, fixes for not-yet-released features, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants