-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
Add CI-friendly progress output for tests #24236
Conversation
Example output:
|
187e069
to
790ef69
Compare
790ef69
to
b31f3ff
Compare
b31f3ff
to
03150a8
Compare
Note - that this one is optimized for our CI usage. We cannot keep log output in memory, because we often might not have enough memory on GitHub Public runners. That's why each test "run" will simply write the output to a temporary file and we are using this file as the "progress status" source. By writing directly to file rather than getting the logs piped to our "managing" process we save precious memory for the actual test execution. On the other hand, when we will run two tests in parallel, we cannot interleave the output from both processes directly to stdout because it will be a complete mess. That's why it is also a bit more "complex" with separate thread monitoring the files and only occasionally prints the last few lines to show the progress (otherwise if someone watches the CI output they might be not aware that something is actually happening there and the tests are progresssing). Seeing the "coloured" progress from the last two lines is also good so that there is an early indicator if there was an error already during test execution (the number will get red) so that the user can get early feedback and cancel/rerun CI build with a fix-up in case they are actively monitoring the output. |
Tt's green and good next step to get rid of the bash finally |
03150a8
to
b3d746f
Compare
Yep. I just implemented it as I thought it might be useful for your PR (and got some fun while doing it :) |
b3d746f
to
307a3ab
Compare
PR Looking for some approval here :) |
307a3ab
to
df7bdc6
Compare
An approval would be nice :) |
df7bdc6
to
89c6f3a
Compare
ae18de9
to
a9ba762
Compare
Need it to improve testing speed in CI. |
This is the first step to run breeze tests in parallel in CI. This flag adds "limited progress" output when running tests which means that the runnig tests will just print few lines with percent progress and color status indication from last few progress lines of Pytest output, but when it completes, the whole output is printed in a CI group - colored depending on status. The final version (wnen we implement parallel test execution) should also defer writing the output to until all tests are completed, but this should be a follow-up PR.
a9ba762
to
436eb14
Compare
dev/breeze/src/airflow_breeze/commands/configuration_and_maintenance_commands.py
Show resolved
Hide resolved
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.
Small comment on using the new Enum in other places, but otherwise LGTM.
The PR is likely ready to be merged. No tests are needed as no important environment files, nor python files were modified by it. However, committers might decide that full test matrix is needed and add the 'full tests needed' label. Then you should rebase it to the latest main or amend the last commit of the PR, and push it with --force-with-lease. |
This is the first step to run breeze tests in parallel in CI. This flag adds "limited progress" output when running tests which means that the runnig tests will just print few lines with percent progress and color status indication from last few progress lines of Pytest output, but when it completes, the whole output is printed in a CI group - colored depending on status. The final version (wnen we implement parallel test execution) should also defer writing the output to until all tests are completed, but this should be a follow-up PR. (cherry picked from commit 41fefa1)
This is the first step to run breeze tests in parallel in CI.
This flag adds "limited progress" output when running tests
which means that the runnig tests will just print few lines with
percent progress and color status indication from last few
progress lines of Pytest output, but when it completes, the whole output is
printed in a CI group - colored depending on status.
The final version (wnen we implement parallel test execution) should
also defer writing the output to until all tests are completed, but
this should be a follow-up PR.
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code change, Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragement file, named
{pr_number}.significant.rst
, in newsfragments.