Skip to content

Better diangostics for parallel test execution in CI#38200

Merged
potiuk merged 1 commit into
apache:mainfrom
potiuk:better-diagnostics-for-tests-in-ci
Mar 16, 2024
Merged

Better diangostics for parallel test execution in CI#38200
potiuk merged 1 commit into
apache:mainfrom
potiuk:better-diagnostics-for-tests-in-ci

Conversation

@potiuk
Copy link
Copy Markdown
Member

@potiuk potiuk commented Mar 16, 2024

When running tests in parallel in our CI we switched off showing success outputs by default in #38157. This is generally a good thing, because it only shows outputs for the test types that failed and makes the CI log output far snappier in case only one or few test types failed.

However it also has a side effect that it's
not really easy to see what kind of commands were run in each parallel test type, so we might get accidentally some mistakes where we miss that our tests are not doing what we think they are doing - for example not running tests for various Python versions, only for one, or not running them for various database versions (both cases happened in the past). By hiding the success outputs, we make it harder to spot such issues.

This PR introduces two ways to improve it:

  • we can now set a label on PR to include success outputs and any committer can set the label to show success outputs as well.

  • When we run parallel unit tests we summarize what is going to be executed - showing all the ShellParams passed to the parallel test execution. This is the best place to show it because this ShellParams object contains all the actual values passed - after processing throught options, special environment variables and so-on - so those are the actual values used to run the parallel tests.

Also it will be printed in a prominent place - just before test execution in the main console output, which means it will be visible without the need to unfold any output.


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an 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 newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

When running tests in parallel in our CI we switched off showing
success outputs by default in apache#38157. This is generally a good
thing, because it only shows outputs for the test types that failed
and makes the CI log output far snappier in case only one or few
test types failed.

However it also has a side effect that it's
not really easy to see what kind of commands were run in each
parallel test type, so we might get accidentally some mistakes
where we miss that our tests are not doing what we think they are
doing - for example not running tests for various Python versions,
only for one, or not running them for various database versions
(both cases happened in the past). By hiding the success outputs,
we make it harder to spot such issues.

This PR introduces two ways to improve it:

* we can now set a label on PR to `include success outputs` and
  any committer can set the label to show success outputs as well.

* When we run parallel unit tests we summarize what is going
  to be executed - showing all the ShellParams passed to the
  parallel test execution. This is the best place to show it
  because this ShellParams object contains all the actual values
  passed - after processing throught options, special environment
  variables and so-on - so those are the actual values used to
  run the parallel tests.

Also it will be printed in a prominent place - just before test
execution in the main console output, which means it will be
visible without the need to unfold any output.
@potiuk potiuk added the default versions only When assigned to PR - only default python version is used for CI tests label Mar 16, 2024
@potiuk
Copy link
Copy Markdown
Member Author

potiuk commented Mar 16, 2024

That's how it will look like:

Screenshot 2024-03-16 at 08 52 17 Screenshot 2024-03-16 at 08 52 52

@potiuk potiuk merged commit 63bc63c into apache:main Mar 16, 2024
@potiuk potiuk deleted the better-diagnostics-for-tests-in-ci branch March 16, 2024 08:25
potiuk added a commit to potiuk/airflow that referenced this pull request Mar 16, 2024
The apache#38200 had already good results - I realized IMAGE_TAG has
not been propagated to the tests - and we were effectively
testing latest images rather than current PR images 😱
potiuk added a commit that referenced this pull request Mar 16, 2024
The #38200 had already good results - I realized IMAGE_TAG has
not been propagated to the tests - and we were effectively
testing latest images rather than current PR images 😱
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:dev-tools default versions only When assigned to PR - only default python version is used for CI tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants