diff --git a/docs/docs/writing-plugins/the-rules-api/testing-plugins.mdx b/docs/docs/writing-plugins/the-rules-api/testing-plugins.mdx index f3e7cc2875a..67e97b38b0b 100644 --- a/docs/docs/writing-plugins/the-rules-api/testing-plugins.mdx +++ b/docs/docs/writing-plugins/the-rules-api/testing-plugins.mdx @@ -598,3 +598,9 @@ def test_junit_report() -> None: coverage_report = Path(get_buildroot(), "dist", "coverage", "python", "report.json") assert coverage_report.read_text() == "foo" ``` + +### Debugging integration tests + +While developing and debugging integration tests, you can have Pants stream the output for the Pants invocation under test to the console. This is useful, for example, when debugging long-running integration tests which would otherwise show no output while they run. + +To use, adjust specific test(s) to use the `stream_output` parameter, for example, `run_pants_with_workdir(..., stream_output=True)` or `run_pants(..., stream_output=True)`, and then run the test with `pants test --debug path/to:test -- --capture=no` so the test is invoked as an interactive process and pytest does not capture the output during the run. diff --git a/docs/notes/2.25.x.md b/docs/notes/2.25.x.md index 2fe3be0a2ea..9c58074c2f4 100644 --- a/docs/notes/2.25.x.md +++ b/docs/notes/2.25.x.md @@ -209,8 +209,7 @@ The version of Python used by Pants itself is now [3.11](https://docs.python.org The oldest [glibc version](https://www.sourceware.org/glibc/wiki/Glibc%20Timeline) supported by the published Pants wheels is now 2.28. This should have no effect unless you are running on extremely old Linux distributions. See for background context on Python wheels and C libraries. -The integration testing framework in the `pantsbuild.pants.testutil` package now supports streaming the output of the Pants invocation under test to the console. This is useful when debugging long-running integration tests which would otherwise show no output while they run since the integration test framework previously only captured output to a buffer. To use, adjust specific test(s) to use the new `stream_output` parameter, like `run_pants_with_workdir(..., stream_output=True)` or `run_pants(..., stream_output=True)`, and then run the test `pants test --debug path/to:test -- --capture=no` so the test is invoked as an interactive process and pytest does not capture the output during the run. - +The integration testing framework in the `pantsbuild.pants.testutil` package now supports streaming the output of the Pants invocation under test to the console. This is useful when debugging long-running integration tests which would otherwise show no output while they run since the integration test framework previously only captured output to a buffer. To use, adjust specific test(s) to use the new `stream_output` parameter, for example, `run_pants_with_workdir(..., stream_output=True)` or `run_pants(..., stream_output=True)`, and then run the test with `pants test --debug path/to:test -- --capture=no` so the test is invoked as an interactive process and pytest does not capture the output during the run. ## Full Changelog