Skip to content

Commit 36e267d

Browse files
authored
Split tests to core/providers/task-sdk/integration/system (apache#43979)
The tests execution was traditionally using single "breeze testing tests" command and you could select which test to run via TEST_TYPE. However the recent move of providers and adding task_sdk necessitates splitting the tests commands into separate commands for core, providers, task_sdk, helm, integration and system. This is done via introducing "TEST_GROUP" - which determines which group of tests is being executed, and dedicated testing command for each of the groups - with "db" and "non-db" variants where applicable. Cleanup and small refactoring has been done to make it easier to reason about parameters passed down from the command line to docker and in-container pytest command. Related: apache#42632
1 parent c3aabba commit 36e267d

File tree

96 files changed

+4314
-4127
lines changed

Some content is hidden

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

96 files changed

+4314
-4127
lines changed

.github/workflows/check-providers.yml

+7-7
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ on: # yamllint disable-line rule:truthy
4040
description: "Whether to upgrade to newer dependencies"
4141
required: true
4242
type: string
43-
affected-providers-list-as-string:
43+
selected-providers-list-as-string:
4444
description: "List of affected providers as string"
4545
required: false
4646
type: string
@@ -54,7 +54,7 @@ on: # yamllint disable-line rule:truthy
5454
description: "List of parallel provider test types as string"
5555
required: true
5656
type: string
57-
skip-provider-tests:
57+
skip-providers-tests:
5858
description: "Whether to skip provider tests (true/false)"
5959
required: true
6060
type: string
@@ -163,7 +163,7 @@ jobs:
163163
run: >
164164
breeze release-management prepare-provider-packages --include-not-ready-providers
165165
--version-suffix-for-pypi dev0 --package-format sdist
166-
${{ inputs.affected-providers-list-as-string }}
166+
${{ inputs.selected-providers-list-as-string }}
167167
- name: "Prepare airflow package: sdist"
168168
run: >
169169
breeze release-management prepare-airflow-package
@@ -187,7 +187,7 @@ jobs:
187187
--providers-constraints-location
188188
/files/constraints-${{env.PYTHON_MAJOR_MINOR_VERSION}}/constraints-source-providers-${{env.PYTHON_MAJOR_MINOR_VERSION}}.txt
189189
--run-in-parallel
190-
if: inputs.affected-providers-list-as-string == ''
190+
if: inputs.selected-providers-list-as-string == ''
191191
- name: "Install affected provider packages and airflow via sdist files"
192192
run: >
193193
breeze release-management install-provider-packages
@@ -198,7 +198,7 @@ jobs:
198198
--providers-constraints-location
199199
/files/constraints-${{env.PYTHON_MAJOR_MINOR_VERSION}}/constraints-source-providers-${{env.PYTHON_MAJOR_MINOR_VERSION}}.txt
200200
--run-in-parallel
201-
if: inputs.affected-providers-list-as-string != ''
201+
if: inputs.selected-providers-list-as-string != ''
202202

203203
providers-compatibility-checks:
204204
timeout-minutes: 80
@@ -218,7 +218,7 @@ jobs:
218218
VERSION_SUFFIX_FOR_PYPI: "dev0"
219219
VERBOSE: "true"
220220
CLEAN_AIRFLOW_INSTALLATION: "${{ inputs.canary-run }}"
221-
if: inputs.skip-provider-tests != 'true'
221+
if: inputs.skip-providers-tests != 'true'
222222
steps:
223223
- name: "Cleanup repo"
224224
shell: bash
@@ -268,7 +268,7 @@ jobs:
268268
Airflow ${{ matrix.airflow-version }}:Python ${{ matrix.python-version }}
269269
if: matrix.run-tests == 'true'
270270
run: >
271-
breeze testing tests --run-in-parallel
271+
breeze testing providers-tests --run-in-parallel
272272
--parallel-test-types "${{ inputs.providers-test-types-list-as-string }}"
273273
--use-packages-from-dist
274274
--package-format wheel

.github/workflows/ci.yml

+101-83
Large diffs are not rendered by default.

.github/workflows/helm-tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ jobs:
7575
- name: "Prepare breeze & CI image: ${{inputs.default-python-version}}:${{inputs.image-tag}}"
7676
uses: ./.github/actions/prepare_breeze_and_image
7777
- name: "Helm Unit Tests: ${{ matrix.helm-test-package }}"
78-
run: breeze testing helm-tests --helm-test-package "${{ matrix.helm-test-package }}"
78+
run: breeze testing helm-tests --test-type "${{ matrix.helm-test-package }}"
7979

8080
tests-helm-release:
8181
timeout-minutes: 80
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,200 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
#
18+
---
19+
name: Integration and system tests
20+
on: # yamllint disable-line rule:truthy
21+
workflow_call:
22+
inputs:
23+
runs-on-as-json-public:
24+
description: "The array of labels (in json form) determining public runners."
25+
required: true
26+
type: string
27+
image-tag:
28+
description: "Tag to set for the image"
29+
required: true
30+
type: string
31+
testable-core-integrations:
32+
description: "The list of testable core integrations as JSON array."
33+
required: true
34+
type: string
35+
testable-providers-integrations:
36+
description: "The list of testable providers integrations as JSON array."
37+
required: true
38+
type: string
39+
run-system-tests:
40+
description: "Run system tests (true/false)"
41+
required: true
42+
type: string
43+
default-postgres-version:
44+
description: "Default version of Postgres to use"
45+
required: true
46+
type: string
47+
default-mysql-version:
48+
description: "Default version of MySQL to use"
49+
required: true
50+
type: string
51+
skip-providers-tests:
52+
description: "Skip provider tests (true/false)"
53+
required: true
54+
type: string
55+
run-coverage:
56+
description: "Run coverage (true/false)"
57+
required: true
58+
type: string
59+
default-python-version:
60+
description: "Which version of python should be used by default"
61+
required: true
62+
type: string
63+
debug-resources:
64+
description: "Debug resources (true/false)"
65+
required: true
66+
type: string
67+
jobs:
68+
tests-core-integration:
69+
timeout-minutes: 130
70+
if: inputs.testable-core-integrations != '[]'
71+
name: "Integration core ${{ matrix.integration }}"
72+
runs-on: ${{ fromJSON(inputs.runs-on-as-json-public) }}
73+
strategy:
74+
fail-fast: false
75+
matrix:
76+
integration: ${{ fromJSON(inputs.testable-core-integrations) }}
77+
env:
78+
IMAGE_TAG: "${{ inputs.image-tag }}"
79+
BACKEND: "postgres"
80+
BACKEND_VERSION: ${{ inputs.default-postgres-version }}"
81+
PYTHON_MAJOR_MINOR_VERSION: "${{ inputs.default-python-version }}"
82+
JOB_ID: "integration-core-${{ matrix.integration }}"
83+
SKIP_PROVIDERS_TESTS: "${{ inputs.skip-providers-tests }}"
84+
ENABLE_COVERAGE: "${{ inputs.run-coverage}}"
85+
DEBUG_RESOURCES: "${{ inputs.debug-resources }}"
86+
GITHUB_REPOSITORY: ${{ github.repository }}
87+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
88+
GITHUB_USERNAME: ${{ github.actor }}
89+
VERBOSE: "true"
90+
steps:
91+
- name: "Cleanup repo"
92+
shell: bash
93+
run: docker run -v "${GITHUB_WORKSPACE}:/workspace" -u 0:0 bash -c "rm -rf /workspace/*"
94+
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
95+
uses: actions/checkout@v4
96+
with:
97+
persist-credentials: false
98+
- name: "Cleanup docker"
99+
run: ./scripts/ci/cleanup_docker.sh
100+
- name: "Prepare breeze & CI image: ${{ inputs.default-python-version }}:${{ inputs.image-tag }}"
101+
uses: ./.github/actions/prepare_breeze_and_image
102+
- name: "Integration: core ${{ matrix.integration }}"
103+
# yamllint disable rule:line-length
104+
run: ./scripts/ci/testing/run_integration_tests_with_retry.sh core "${{ matrix.integration }}"
105+
- name: "Post Tests success"
106+
uses: ./.github/actions/post_tests_success
107+
with:
108+
codecov-token: ${{ secrets.CODECOV_TOKEN }}
109+
python-version: ${{ inputs.default-python-version }}
110+
- name: "Post Tests failure"
111+
uses: ./.github/actions/post_tests_failure
112+
if: failure()
113+
114+
tests-providers-integration:
115+
timeout-minutes: 130
116+
if: inputs.testable-providers-integrations != '[]' && inputs.skip-providers-tests != 'true'
117+
name: "Integration: providers ${{ matrix.integration }}"
118+
runs-on: ${{ fromJSON(inputs.runs-on-as-json-public) }}
119+
strategy:
120+
fail-fast: false
121+
matrix:
122+
integration: ${{ fromJSON(inputs.testable-providers-integrations) }}
123+
env:
124+
IMAGE_TAG: "${{ inputs.image-tag }}"
125+
BACKEND: "postgres"
126+
BACKEND_VERSION: ${{ inputs.default-postgres-version }}"
127+
PYTHON_MAJOR_MINOR_VERSION: "${{ inputs.default-python-version }}"
128+
JOB_ID: "integration-providers-${{ matrix.integration }}"
129+
SKIP_PROVIDERS_TESTS: "${{ inputs.skip-providers-tests }}"
130+
ENABLE_COVERAGE: "${{ inputs.run-coverage}}"
131+
DEBUG_RESOURCES: "${{ inputs.debug-resources }}"
132+
GITHUB_REPOSITORY: ${{ github.repository }}
133+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
134+
GITHUB_USERNAME: ${{ github.actor }}
135+
VERBOSE: "true"
136+
steps:
137+
- name: "Cleanup repo"
138+
shell: bash
139+
run: docker run -v "${GITHUB_WORKSPACE}:/workspace" -u 0:0 bash -c "rm -rf /workspace/*"
140+
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
141+
uses: actions/checkout@v4
142+
with:
143+
persist-credentials: false
144+
- name: "Cleanup docker"
145+
run: ./scripts/ci/cleanup_docker.sh
146+
- name: "Prepare breeze & CI image: ${{ inputs.default-python-version }}:${{ inputs.image-tag }}"
147+
uses: ./.github/actions/prepare_breeze_and_image
148+
- name: "Integration: providers ${{ matrix.integration }}"
149+
run: ./scripts/ci/testing/run_integration_tests_with_retry.sh providers "${{ matrix.integration }}"
150+
- name: "Post Tests success"
151+
uses: ./.github/actions/post_tests_success
152+
with:
153+
codecov-token: ${{ secrets.CODECOV_TOKEN }}
154+
python-version: ${{ inputs.default-python-version }}
155+
- name: "Post Tests failure"
156+
uses: ./.github/actions/post_tests_failure
157+
if: failure()
158+
159+
tests-system:
160+
timeout-minutes: 130
161+
if: inputs.run-system-tests == 'true'
162+
name: "System Tests"
163+
runs-on: ${{ fromJSON(inputs.runs-on-as-json-public) }}
164+
env:
165+
IMAGE_TAG: "${{ inputs.image-tag }}"
166+
BACKEND: "postgres"
167+
BACKEND_VERSION: ${{ inputs.default-postgres-version }}"
168+
PYTHON_MAJOR_MINOR_VERSION: "${{ inputs.default-python-version }}"
169+
JOB_ID: "system"
170+
SKIP_PROVIDERS_TESTS: "${{ inputs.skip-providers-tests }}"
171+
ENABLE_COVERAGE: "${{ inputs.run-coverage}}"
172+
DEBUG_RESOURCES: "${{ inputs.debug-resources }}"
173+
GITHUB_REPOSITORY: ${{ github.repository }}
174+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
175+
GITHUB_USERNAME: ${{ github.actor }}
176+
VERBOSE: "true"
177+
steps:
178+
- name: "Cleanup repo"
179+
shell: bash
180+
run: docker run -v "${GITHUB_WORKSPACE}:/workspace" -u 0:0 bash -c "rm -rf /workspace/*"
181+
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
182+
uses: actions/checkout@v4
183+
with:
184+
persist-credentials: false
185+
- name: "Cleanup docker"
186+
run: ./scripts/ci/cleanup_docker.sh
187+
- name: "Prepare breeze & CI image: ${{ inputs.default-python-version }}:${{ inputs.image-tag }}"
188+
uses: ./.github/actions/prepare_breeze_and_image
189+
- name: "System Tests"
190+
run: >
191+
./scripts/ci/testing/run_system_tests.sh
192+
tests/system/example_empty.py providers/tests/system/example_empty.py
193+
- name: "Post Tests success"
194+
uses: ./.github/actions/post_tests_success
195+
with:
196+
codecov-token: ${{ secrets.CODECOV_TOKEN }}
197+
python-version: ${{ inputs.default-python-version }}
198+
- name: "Post Tests failure"
199+
uses: ./.github/actions/post_tests_failure
200+
if: failure()

.github/workflows/integration-tests.yml

-103
This file was deleted.

0 commit comments

Comments
 (0)