Skip to content

Commit 2921796

Browse files
authored
Switch tests in ci to use Python Breeze (#26612)
This is the last big change in "Rewrite Breeze to Python". Fixes: #23538
1 parent 6ddb646 commit 2921796

File tree

73 files changed

+3081
-3482
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+3081
-3482
lines changed

.github/workflows/ci.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ jobs:
160160
default-constraints-branch: ${{ steps.selective-checks.outputs.default-constraints-branch }}
161161
docs-filter: ${{ steps.selective-checks.outputs.docs-filter }}
162162
skip-pre-commits: ${{ steps.selective-checks.outputs.skip-pre-commits }}
163+
debug-resources: ${{ steps.selective-checks.outputs.debug-resources }}
163164
source-head-repo: ${{ steps.source-run-info.outputs.source-head-repo }}
164165
pull-request-labels: ${{ steps.source-run-info.outputs.pr-labels }}
165166
in-workflow-build: ${{ steps.source-run-info.outputs.in-workflow-build }}
@@ -1059,10 +1060,11 @@ ${{ hashFiles('.pre-commit-config.yaml') }}"
10591060
- name: "Test Offline SQL generation"
10601061
run: ./scripts/ci/testing/run_offline_sql_test.sh
10611062
- name: "Tests: ${{needs.build-info.outputs.test-types}}"
1062-
run: ./scripts/ci/testing/ci_run_airflow_testing.sh
1063+
run: breeze testing tests --run-in-parallel
10631064
env:
10641065
PR_LABELS: "${{ needs.build-info.outputs.pull-request-labels }}"
10651066
IMAGE_TAG: ${{ env.IMAGE_TAG_FOR_THE_BUILD }}
1067+
DEBUG_RESOURCES: ${{ needs.build-info.outputs.debug-resources }}
10661068
- name: "Upload airflow logs"
10671069
uses: actions/upload-artifact@v3
10681070
if: failure()
@@ -1130,10 +1132,11 @@ ${{ hashFiles('.pre-commit-config.yaml') }}"
11301132
- name: "Test downgrade"
11311133
run: ./scripts/ci/testing/run_downgrade_test.sh
11321134
- name: "Tests: ${{needs.build-info.outputs.test-types}}"
1133-
run: ./scripts/ci/testing/ci_run_airflow_testing.sh
1135+
run: breeze testing tests --run-in-parallel
11341136
env:
11351137
PR_LABELS: "${{ needs.build-info.outputs.pull-request-labels }}"
11361138
IMAGE_TAG: ${{ env.IMAGE_TAG_FOR_THE_BUILD }}
1139+
DEBUG_RESOURCES: ${{ needs.build-info.outputs.debug-resources }}
11371140
- name: "Upload airflow logs"
11381141
uses: actions/upload-artifact@v3
11391142
if: failure()
@@ -1201,10 +1204,11 @@ ${{ hashFiles('.pre-commit-config.yaml') }}"
12011204
- name: "Test downgrade"
12021205
run: ./scripts/ci/testing/run_downgrade_test.sh
12031206
- name: "Tests: ${{needs.build-info.outputs.test-types}}"
1204-
run: ./scripts/ci/testing/ci_run_airflow_testing.sh
1207+
run: breeze testing tests --run-in-parallel
12051208
env:
12061209
PR_LABELS: "${{ needs.build-info.outputs.pull-request-labels }}"
12071210
IMAGE_TAG: ${{ env.IMAGE_TAG_FOR_THE_BUILD }}
1211+
DEBUG_RESOURCES: ${{ needs.build-info.outputs.debug-resources }}
12081212
- name: "Upload airflow logs"
12091213
uses: actions/upload-artifact@v3
12101214
if: failure()
@@ -1270,10 +1274,11 @@ ${{ hashFiles('.pre-commit-config.yaml') }}"
12701274
- name: "Test downgrade"
12711275
run: ./scripts/ci/testing/run_downgrade_test.sh
12721276
- name: "Tests: ${{needs.build-info.outputs.test-types}}"
1273-
run: ./scripts/ci/testing/ci_run_airflow_testing.sh
1277+
run: breeze testing tests --run-in-parallel
12741278
env:
12751279
PR_LABELS: "${{ needs.build-info.outputs.pull-request-labels }}"
12761280
IMAGE_TAG: ${{ env.IMAGE_TAG_FOR_THE_BUILD }}
1281+
DEBUG_RESOURCES: ${{ needs.build-info.outputs.debug-resources }}
12771282
- name: "Upload airflow logs"
12781283
uses: actions/upload-artifact@v3
12791284
if: failure()
@@ -1309,7 +1314,6 @@ ${{ hashFiles('.pre-commit-config.yaml') }}"
13091314
RUNS_ON: ${{ needs.build-info.outputs.runs-on }}
13101315
MYSQL_VERSION: ${{needs.build-info.outputs.default-mysql-version}}
13111316
POSTGRES_VERSION: ${{needs.build-info.outputs.default-postgres-version}}
1312-
TEST_TYPES: "Quarantined"
13131317
PYTHON_MAJOR_MINOR_VERSION: ${{ needs.build-info.outputs.default-python-version }}
13141318
if: needs.build-info.outputs.run-tests == 'true'
13151319
steps:
@@ -1345,9 +1349,12 @@ ${{ hashFiles('.pre-commit-config.yaml') }}"
13451349
env:
13461350
IMAGE_TAG: ${{ env.IMAGE_TAG_FOR_THE_BUILD }}
13471351
- name: "Tests: Quarantined"
1348-
run: ./scripts/ci/testing/ci_run_quarantined_tests.sh
1352+
run: breeze testing tests --run-in-parallel || true
13491353
env:
13501354
PR_LABELS: "${{ needs.build-info.outputs.pull-request-labels }}"
1355+
IMAGE_TAG: ${{ env.IMAGE_TAG_FOR_THE_BUILD }}
1356+
TEST_TYPES: "Quarantined"
1357+
DEBUG_RESOURCES: ${{ needs.build-info.outputs.debug-resources }}
13511358
- name: "Upload Quarantine test results"
13521359
uses: actions/upload-artifact@v3
13531360
if: always()

.pre-commit-config.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -798,16 +798,17 @@ repos:
798798
files: newsfragments/.*\.rst
799799
entry: ./scripts/ci/pre_commit/pre_commit_newsfragments.py
800800
pass_filenames: true
801+
# We sometimes won't have newsfragments in the repo, so always run it so `check-hooks-apply` passes
802+
# This is fast, so not too much downside
803+
always_run: true
801804
- id: update-breeze-cmd-output
802805
name: Update output of breeze commands in BREEZE.rst
803806
entry: ./scripts/ci/pre_commit/pre_commit_breeze_cmd_line.py
804807
language: python
805808
files: ^BREEZE\.rst$|^dev/breeze/.*$|^\.pre-commit-config\.yaml$
809+
require_serial: true
806810
pass_filenames: false
807811
additional_dependencies: ['rich>=12.4.4', 'rich-click>=1.5']
808-
# We sometimes won't have newsfragments in the repo, so always run it so `check-hooks-apply` passes
809-
# This is fast, so not too much downside
810-
always_run: true
811812
- id: check-example-dags-urls
812813
name: Check that example dags url include provider versions
813814
entry: ./scripts/ci/pre_commit/pre_commit_update_example_dags_paths.py

BREEZE.rst

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -689,8 +689,24 @@ API, Providers. This how our CI runs them - running each group in parallel to ot
689689
replicate this behaviour.
690690

691691
Another interesting use of the ``breeze testing tests`` command is that you can easily specify sub-set of the
692-
tests for Providers. ``breeze testing tests --test-type "Providers[airbyte,http]`` for example will only run
693-
tests for airbyte and http providers.
692+
tests for Providers.
693+
694+
For example this will only run provider tests for airbyte and http providers:
695+
696+
.. code-block:: bash
697+
698+
breeze testing tests --test-type "Providers[airbyte,http]``
699+
700+
You can also run parallel tests with ``--run-in-parallel`` flag - by default it will run all tests types
701+
in parallel, but you can specify the test type that you want to run with space separated list of test
702+
types passed to ``--test-types`` flag.
703+
704+
For example this will run API and WWW tests in parallel:
705+
706+
.. code-block:: bash
707+
708+
breeze testing tests --test-types "API WWW" --run-in-parallel
709+
694710
695711
Here is the detailed set of options for the ``breeze testing tests`` command.
696712
@@ -747,7 +763,6 @@ You can:
747763
* Enter the interactive kubernetes test environment with ``breeze k8s shell`` and ``breeze k8s k9s`` command
748764
* Run multi-cluster-operations ``breeze k8s list-all-clusters`` and
749765
``breeze k8s delete-all-clusters`` commands as well as running complete tests in parallel
750-
via ``breeze k8s run-complete-tests`` and export logs from all clusters to a temp directory
751766
via ``breeze k8s dump-logs`` command
752767
753768
This is described in detail in `Testing Kubernetes <TESTING.rst#running-tests-with-kubernetes>`_.

0 commit comments

Comments
 (0)