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 93a5422c56 Speed up test collection (#30801)
93a5422c56 is described below

commit 93a5422c5677a42b3329c329d65ff2b38b1348c2
Author: Jarek Potiuk <[email protected]>
AuthorDate: Fri Apr 21 21:49:29 2023 +0200

    Speed up test collection (#30801)
    
    Test collection had default setting for parallel test types because
    TEST_TYPES variable had not been renamed to PARALLEL_TEST_TYPES
    Also test collection can be run in Wait for CI images job which
    should save around a minute for setting up Breeze and pulling the
    images.
    
    This should speed up pytest collection test by around 1 and half minute
---
 .github/workflows/ci.yml | 59 ++++++++++++------------------------------------
 1 file changed, 15 insertions(+), 44 deletions(-)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index aeee676f22..3d4c3523f0 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -545,6 +545,12 @@ jobs:
         env:
           PYTHON_VERSIONS: ${{ 
needs.build-info.outputs.python-versions-list-as-string }}
           DEBUG_RESOURCES: ${{needs.build-info.outputs.debug-resources}}
+      - name: "Tests Pytest collection"
+        run: breeze testing tests --run-in-parallel --collect-only
+        env:
+          PYTHON_MAJOR_MINOR_VERSION: 
"${{needs.build-info.outputs.default-python-version}}"
+          BACKEND: sqlite
+          PARALLEL_TEST_TYPES: 
"${{needs.build-info.outputs.parallel-test-types}}"
       - name: "Fix ownership"
         run: breeze ci fix-ownership
         if: always()
@@ -916,48 +922,13 @@ jobs:
       - name: "Post Helm Tests"
         uses: ./.github/actions/post_tests
 
-  test-pytest-collection:
-    timeout-minutes: 8
-    name: "Test Pytest collection"
-    runs-on: "${{needs.build-info.outputs.runs-on}}"
-    needs: [build-info, wait-for-ci-images]
-    if: needs.build-info.outputs.image-build == 'true'
-    env:
-      RUNS_ON: "${{needs.build-info.outputs.runs-on}}"
-      BACKEND: sqlite
-      PYTHON_MAJOR_MINOR_VERSION: 
"${{needs.build-info.outputs.default-python-version}}"
-      TEST_TYPES: "${{needs.build-info.outputs.parallel-test-types}}"
-      FULL_TESTS_NEEDED: "${{needs.build-info.outputs.full-tests-needed}}"
-      DEBUG_RESOURCES: "${{needs.build-info.outputs.debug-resources}}"
-      JOB_ID: "test-pytest-collection"
-      COVERAGE: "false"
-    steps:
-      - name: Cleanup repo
-        run: docker run -v "${GITHUB_WORKSPACE}:/workspace" -u 0:0 bash -c "rm 
-rf /workspace/*"
-      - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
-        uses: actions/checkout@v3
-        with:
-          persist-credentials: false
-      - name: "Install Breeze"
-        uses: ./.github/actions/breeze
-      - name: Wait for CI images ${{ env.PYTHON_VERSIONS }}:${{ env.IMAGE_TAG 
}}
-        id: wait-for-images
-        run: breeze ci-image pull --wait-for-image --tag-as-latest
-        env:
-          DEBUG_RESOURCES: ${{needs.build-info.outputs.debug-resources}}
-      - name: "Tests Pytest collection"
-        run: breeze testing tests --run-in-parallel --collect-only
-      - name: "Fix ownership"
-        run: breeze ci fix-ownership
-        if: always()
-
   tests-postgres:
     timeout-minutes: 130
     name: >
       Postgres${{matrix.postgres-version}},Py${{matrix.python-version}}:
       ${{needs.build-info.outputs.parallel-test-types}}
     runs-on: "${{needs.build-info.outputs.runs-on}}"
-    needs: [build-info, test-pytest-collection]
+    needs: [build-info, wait-for-ci-images]
     strategy:
       matrix:
         python-version: 
"${{fromJson(needs.build-info.outputs.python-versions)}}"
@@ -1003,7 +974,7 @@ jobs:
       Py${{needs.build-info.outputs.default-python-version}}:
       ${{needs.build-info.outputs.parallel-test-types}}
     runs-on: "${{needs.build-info.outputs.runs-on}}"
-    needs: [build-info, test-pytest-collection]
+    needs: [build-info, wait-for-ci-images]
     env:
       RUNS_ON: "${{needs.build-info.outputs.runs-on}}"
       PARALLEL_TEST_TYPES: "${{needs.build-info.outputs.parallel-test-types}}"
@@ -1048,7 +1019,7 @@ jobs:
       Py${{needs.build-info.outputs.default-python-version}}:
       ${{needs.build-info.outputs.parallel-test-types}}
     runs-on: "${{needs.build-info.outputs.runs-on}}"
-    needs: [build-info, test-pytest-collection]
+    needs: [build-info, wait-for-ci-images]
     env:
       RUNS_ON: "${{needs.build-info.outputs.runs-on}}"
       PARALLEL_TEST_TYPES: "${{needs.build-info.outputs.parallel-test-types}}"
@@ -1093,7 +1064,7 @@ jobs:
       MySQL${{matrix.mysql-version}}, Py${{matrix.python-version}}:
       ${{needs.build-info.outputs.parallel-test-types}}
     runs-on: "${{needs.build-info.outputs.runs-on}}"
-    needs: [build-info, test-pytest-collection]
+    needs: [build-info, wait-for-ci-images]
     strategy:
       matrix:
         python-version: 
"${{fromJson(needs.build-info.outputs.python-versions)}}"
@@ -1138,7 +1109,7 @@ jobs:
       MSSQL${{matrix.mssql-version}}, Py${{matrix.python-version}}:
       ${{needs.build-info.outputs.parallel-test-types}}
     runs-on: "${{needs.build-info.outputs.runs-on}}"
-    needs: [build-info, test-pytest-collection]
+    needs: [build-info, wait-for-ci-images]
     strategy:
       matrix:
         python-version: 
"${{fromJson(needs.build-info.outputs.python-versions)}}"
@@ -1180,7 +1151,7 @@ jobs:
     name: >
       Sqlite Py${{matrix.python-version}}: 
${{needs.build-info.outputs.parallel-test-types}}
     runs-on: "${{needs.build-info.outputs.runs-on}}"
-    needs: [build-info, test-pytest-collection]
+    needs: [build-info, wait-for-ci-images]
     strategy:
       matrix:
         python-version: ${{ fromJson(needs.build-info.outputs.python-versions) 
}}
@@ -1221,7 +1192,7 @@ jobs:
     timeout-minutes: 130
     name: Integration Tests Postgres
     runs-on: "${{needs.build-info.outputs.runs-on}}"
-    needs: [build-info, test-pytest-collection]
+    needs: [build-info, wait-for-ci-images]
     env:
       RUNS_ON: "${{needs.build-info.outputs.runs-on}}"
       PARALLEL_TEST_TYPES: "${{needs.build-info.outputs.parallel-test-types}}"
@@ -1286,7 +1257,7 @@ jobs:
     timeout-minutes: 130
     name: Integration Tests MySQL
     runs-on: "${{needs.build-info.outputs.runs-on}}"
-    needs: [build-info, test-pytest-collection]
+    needs: [build-info, wait-for-ci-images]
     env:
       RUNS_ON: "${{needs.build-info.outputs.runs-on}}"
       PARALLEL_TEST_TYPES: "${{needs.build-info.outputs.parallel-test-types}}"
@@ -1327,7 +1298,7 @@ jobs:
     name: "Quarantined tests"
     runs-on: "${{needs.build-info.outputs.runs-on}}"
     continue-on-error: true
-    needs: [build-info, test-pytest-collection]
+    needs: [build-info, wait-for-ci-images]
     env:
       RUNS_ON: "${{needs.build-info.outputs.runs-on}}"
       PARALLEL_TEST_TYPES: "Quarantined"

Reply via email to