This is an automated email from the ASF dual-hosted git repository.
potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 557716aa02 Optimize away pytest collection steps (#30824)
557716aa02 is described below
commit 557716aa0215bab9b084e926fe09b779f046ac85
Author: Jarek Potiuk <[email protected]>
AuthorDate: Mon Apr 24 08:03:45 2023 +0200
Optimize away pytest collection steps (#30824)
The Pytest collection steps are only needed if there are any tests
about to be run. There are cases where we build CI images but
we do not expect to run any tests (for doc-only changes). This
should save about 3 minutes of build time.
Also ARM pytest collection should only be executed once for
every build after all "regular" tests passed - there is no need
to run them for different backends/versions. It is enough
to run them for default single backend version (Postgres).
---
.github/workflows/ci.yml | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 3d4c3523f0..ef12395c17 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -547,6 +547,7 @@ jobs:
DEBUG_RESOURCES: ${{needs.build-info.outputs.debug-resources}}
- name: "Tests Pytest collection"
run: breeze testing tests --run-in-parallel --collect-only
+ if: needs.build-info.outputs.run-tests == 'true'
env:
PYTHON_MAJOR_MINOR_VERSION:
"${{needs.build-info.outputs.default-python-version}}"
BACKEND: sqlite
@@ -964,6 +965,7 @@ jobs:
run: breeze testing tests --run-in-parallel
- name: "Tests ARM Pytest collection: ${{matrix.python-version}}"
run: breeze testing tests --run-in-parallel --collect-only
--remove-arm-packages
+ if: matrix.postgres-version ==
needs.build-info.outputs.default-postgres-version
- name: "Post Tests:
${{matrix.python-version}}:${{needs.build-info.outputs.parallel-test-types}}"
uses: ./.github/actions/post_tests
@@ -1097,9 +1099,6 @@ jobs:
uses: ./.github/actions/migration_tests
- name: "Tests:
${{matrix.python-version}}:${{needs.build-info.outputs.parallel-test-types}}"
run: breeze testing tests --run-in-parallel
- - name: "Tests ARM Pytest collection: ${{matrix.python-version}}"
- if: env.MYSQL_VERSION != '5.7'
- run: breeze testing tests --run-in-parallel --collect-only
--remove-arm-packages
- name: "Post Tests:
${{matrix.python-version}}:${{needs.build-info.outputs.parallel-test-types}}"
uses: ./.github/actions/post_tests
@@ -1183,8 +1182,6 @@ jobs:
uses: ./.github/actions/migration_tests
- name: "Tests:
${{matrix.python-version}}:${{needs.build-info.outputs.parallel-test-types}}"
run: breeze testing tests --run-in-parallel
- - name: "Tests ARM Pytest collection: ${{matrix.python-version}}"
- run: breeze testing tests --run-in-parallel --collect-only
--remove-arm-packages
- name: "Post Tests:
${{matrix.python-version}}:${{needs.build-info.outputs.parallel-test-types}}"
uses: ./.github/actions/post_tests