Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OLD VERSION DO NOT MERGE] Split tests to core/providers/task-sdk/integration/system #43965

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/check-providers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ on: # yamllint disable-line rule:truthy
description: "Whether to upgrade to newer dependencies"
required: true
type: string
affected-providers-list-as-string:
selected-providers-list-as-string:
description: "List of affected providers as string"
required: false
type: string
Expand Down Expand Up @@ -163,7 +163,7 @@ jobs:
run: >
breeze release-management prepare-provider-packages --include-not-ready-providers
--version-suffix-for-pypi dev0 --package-format sdist
${{ inputs.affected-providers-list-as-string }}
${{ inputs.selected-providers-list-as-string }}
- name: "Prepare airflow package: sdist"
run: >
breeze release-management prepare-airflow-package
Expand All @@ -187,7 +187,7 @@ jobs:
--providers-constraints-location
/files/constraints-${{env.PYTHON_MAJOR_MINOR_VERSION}}/constraints-source-providers-${{env.PYTHON_MAJOR_MINOR_VERSION}}.txt
--run-in-parallel
if: inputs.affected-providers-list-as-string == ''
if: inputs.selected-providers-list-as-string == ''
- name: "Install affected provider packages and airflow via sdist files"
run: >
breeze release-management install-provider-packages
Expand All @@ -198,7 +198,7 @@ jobs:
--providers-constraints-location
/files/constraints-${{env.PYTHON_MAJOR_MINOR_VERSION}}/constraints-source-providers-${{env.PYTHON_MAJOR_MINOR_VERSION}}.txt
--run-in-parallel
if: inputs.affected-providers-list-as-string != ''
if: inputs.selected-providers-list-as-string != ''

providers-compatibility-checks:
timeout-minutes: 80
Expand Down
27 changes: 14 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ jobs:
image-tag: ${{ github.event.pull_request.head.sha || github.sha }}
docker-cache: ${{ steps.selective-checks.outputs.docker-cache }}
disable-airflow-repo-cache: ${{ steps.selective-checks.outputs.disable-airflow-repo-cache }}
affected-providers-list-as-string: >-
${{ steps.selective-checks.outputs.affected-providers-list-as-string }}
selected-providers-list-as-string: >-
${{ steps.selective-checks.outputs.selected-providers-list-as-string }}
upgrade-to-newer-dependencies: ${{ steps.selective-checks.outputs.upgrade-to-newer-dependencies }}
python-versions: ${{ steps.selective-checks.outputs.python-versions }}
python-versions-list-as-string: ${{ steps.selective-checks.outputs.python-versions-list-as-string }}
Expand All @@ -79,12 +79,12 @@ jobs:
default-kind-version: ${{ steps.selective-checks.outputs.default-kind-version }}
force-pip: ${{ steps.selective-checks.outputs.force-pip }}
full-tests-needed: ${{ steps.selective-checks.outputs.full-tests-needed }}
parallel-test-types-list-as-string: >-
${{ steps.selective-checks.outputs.parallel-test-types-list-as-string }}
core-test-types-list-as-string: >-
${{ steps.selective-checks.outputs.core-test-types-list-as-string }}
providers-test-types-list-as-string: >-
${{ steps.selective-checks.outputs.providers-test-types-list-as-string }}
separate-test-types-list-as-string: >-
${{ steps.selective-checks.outputs.separate-test-types-list-as-string }}
individual-providers-test-types-list-as-string: >-
${{ steps.selective-checks.outputs.individual-providers-test-types-list-as-string }}
include-success-outputs: ${{ steps.selective-checks.outputs.include-success-outputs }}
postgres-exclude: ${{ steps.selective-checks.outputs.postgres-exclude }}
mysql-exclude: ${{ steps.selective-checks.outputs.mysql-exclude }}
Expand Down Expand Up @@ -336,7 +336,7 @@ jobs:
canary-run: ${{ needs.build-info.outputs.canary-run }}
default-python-version: ${{ needs.build-info.outputs.default-python-version }}
upgrade-to-newer-dependencies: ${{ needs.build-info.outputs.upgrade-to-newer-dependencies }}
affected-providers-list-as-string: ${{ needs.build-info.outputs.affected-providers-list-as-string }}
selected-providers-list-as-string: ${{ needs.build-info.outputs.selected-providers-list-as-string }}
providers-compatibility-checks: ${{ needs.build-info.outputs.providers-compatibility-checks }}
skip-provider-tests: ${{ needs.build-info.outputs.skip-provider-tests }}
python-versions: ${{ needs.build-info.outputs.python-versions }}
Expand Down Expand Up @@ -379,7 +379,7 @@ jobs:
backend-versions: ${{ needs.build-info.outputs.postgres-versions }}
excluded-providers-as-string: ${{ needs.build-info.outputs.excluded-providers-as-string }}
excludes: ${{ needs.build-info.outputs.postgres-exclude }}
parallel-test-types-list-as-string: ${{ needs.build-info.outputs.parallel-test-types-list-as-string }}
core-test-types-list-as-string: ${{ needs.build-info.outputs.core-test-types-list-as-string }}
include-success-outputs: ${{ needs.build-info.outputs.include-success-outputs }}
run-migration-tests: "true"
run-coverage: ${{ needs.build-info.outputs.run-coverage }}
Expand All @@ -404,7 +404,7 @@ jobs:
backend-versions: ${{ needs.build-info.outputs.mysql-versions }}
excluded-providers-as-string: ${{ needs.build-info.outputs.excluded-providers-as-string }}
excludes: ${{ needs.build-info.outputs.mysql-exclude }}
parallel-test-types-list-as-string: ${{ needs.build-info.outputs.parallel-test-types-list-as-string }}
core-test-types-list-as-string: ${{ needs.build-info.outputs.core-test-types-list-as-string }}
include-success-outputs: ${{ needs.build-info.outputs.include-success-outputs }}
run-coverage: ${{ needs.build-info.outputs.run-coverage }}
run-migration-tests: "true"
Expand All @@ -431,7 +431,7 @@ jobs:
backend-versions: "['']"
excluded-providers-as-string: ${{ needs.build-info.outputs.excluded-providers-as-string }}
excludes: ${{ needs.build-info.outputs.sqlite-exclude }}
parallel-test-types-list-as-string: ${{ needs.build-info.outputs.parallel-test-types-list-as-string }}
core-test-types-list-as-string: ${{ needs.build-info.outputs.core-test-types-list-as-string }}
include-success-outputs: ${{ needs.build-info.outputs.include-success-outputs }}
run-coverage: ${{ needs.build-info.outputs.run-coverage }}
run-migration-tests: "true"
Expand All @@ -458,7 +458,7 @@ jobs:
backend-versions: "['']"
excluded-providers-as-string: ${{ needs.build-info.outputs.excluded-providers-as-string }}
excludes: ${{ needs.build-info.outputs.sqlite-exclude }}
parallel-test-types-list-as-string: ${{ needs.build-info.outputs.parallel-test-types-list-as-string }}
core-test-types-list-as-string: ${{ needs.build-info.outputs.core-test-types-list-as-string }}
include-success-outputs: ${{ needs.build-info.outputs.include-success-outputs }}
run-coverage: ${{ needs.build-info.outputs.run-coverage }}
debug-resources: ${{ needs.build-info.outputs.debug-resources }}
Expand All @@ -480,7 +480,7 @@ jobs:
with:
runs-on-as-json-default: ${{ needs.build-info.outputs.runs-on-as-json-default }}
image-tag: ${{ needs.build-info.outputs.image-tag }}
parallel-test-types-list-as-string: ${{ needs.build-info.outputs.parallel-test-types-list-as-string }}
core-test-types-list-as-string: ${{ needs.build-info.outputs.core-test-types-list-as-string }}
run-coverage: ${{ needs.build-info.outputs.run-coverage }}
default-python-version: ${{ needs.build-info.outputs.default-python-version }}
python-versions: ${{ needs.build-info.outputs.python-versions }}
Expand Down Expand Up @@ -531,7 +531,8 @@ jobs:
backend-versions: "['${{ needs.build-info.outputs.default-postgres-version }}']"
excluded-providers-as-string: ${{ needs.build-info.outputs.excluded-providers-as-string }}
excludes: "[]"
parallel-test-types-list-as-string: ${{ needs.build-info.outputs.separate-test-types-list-as-string }}
# yamllint disable rule:line-length
core-test-types-list-as-string: ${{ needs.build-info.outputs.individual-providers-test-types-list-as-string }}
include-success-outputs: ${{ needs.build-info.outputs.include-success-outputs }}
run-coverage: ${{ needs.build-info.outputs.run-coverage }}
debug-resources: ${{ needs.build-info.outputs.debug-resources }}
Expand Down
39 changes: 12 additions & 27 deletions .github/workflows/run-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ on: # yamllint disable-line rule:truthy
description: "The backend to run the tests on"
required: true
type: string
test-group:
description: "The group of the test to run: ('Core', 'Providers')"
required: true
type: string
test-scope:
description: "The scope of the test to run: ('DB', 'Non-DB', 'All', 'ARM collection')"
required: true
Expand Down Expand Up @@ -61,8 +65,8 @@ on: # yamllint disable-line rule:truthy
description: "Excluded combos (stringified JSON array of python-version/backend-version dicts)"
required: true
type: string
parallel-test-types-list-as-string:
description: "The list of parallel test types to run separated by spaces"
test-types-list-as-string:
description: "The list of test types to run separated by spaces"
required: true
type: string
run-migration-tests:
Expand Down Expand Up @@ -119,7 +123,7 @@ jobs:
name: "\
${{ inputs.test-scope }}:\
${{ inputs.test-name }}${{ inputs.test-name-separator }}${{ matrix.backend-version }}:\
${{matrix.python-version}}: ${{ inputs.parallel-test-types-list-as-string }}"
${{matrix.python-version}}: ${{ inputs.core-test-types-list-as-string }}"
runs-on: ${{ fromJSON(inputs.runs-on-as-json-default) }}
strategy:
fail-fast: false
Expand Down Expand Up @@ -147,7 +151,7 @@ jobs:
# yamllint disable rule:line-length
JOB_ID: "${{ inputs.test-scope }}-${{ inputs.test-name }}-${{inputs.backend}}-${{ matrix.backend-version }}-${{ matrix.python-version }}"
MOUNT_SOURCES: "skip"
PARALLEL_TEST_TYPES: "${{ inputs.parallel-test-types-list-as-string }}"
PARALLEL_TEST_TYPES: "${{ inputs.core-test-types-list-as-string }}"
PYTHON_MAJOR_MINOR_VERSION: "${{ matrix.python-version }}"
UPGRADE_BOTO: "${{ inputs.upgrade-boto }}"
AIRFLOW_MONITOR_DELAY_TIME_IN_SECONDS: "${{inputs.monitor-delay-time-in-seconds}}"
Expand All @@ -166,32 +170,13 @@ jobs:
uses: ./.github/actions/prepare_breeze_and_image
- name: >
Migration Tests:
${{ matrix.python-version }}:${{ inputs.parallel-test-types-list-as-string }}
${{ matrix.python-version }}:${{ inputs.core-test-types-list-as-string }}
uses: ./.github/actions/migration_tests
if: inputs.run-migration-tests == 'true'
- name: >
${{ inputs.test-scope }} Tests ${{ inputs.test-name }} ${{ matrix.backend-version }}
Py${{ matrix.python-version }}:${{ inputs.parallel-test-types-list-as-string}}
run: |
if [[ "${{ inputs.test-scope }}" == "DB" ]]; then
breeze testing db-tests \
--parallel-test-types "${{ inputs.parallel-test-types-list-as-string }}"
elif [[ "${{ inputs.test-scope }}" == "Non-DB" ]]; then
breeze testing non-db-tests \
--parallel-test-types "${{ inputs.parallel-test-types-list-as-string }}"
elif [[ "${{ inputs.test-scope }}" == "All" ]]; then
breeze testing tests --run-in-parallel \
--parallel-test-types "${{ inputs.parallel-test-types-list-as-string }}"
elif [[ "${{ inputs.test-scope }}" == "Quarantined" ]]; then
breeze testing tests --test-type "All-Quarantined" || true
elif [[ "${{ inputs.test-scope }}" == "ARM collection" ]]; then
breeze testing tests --collect-only --remove-arm-packages
elif [[ "${{ inputs.test-scope }}" == "System" ]]; then
breeze testing tests tests/system/example_empty.py --system core
else
echo "Unknown test scope: ${{ inputs.test-scope }}"
exit 1
fi
${{ inputs.test-group}}:${{ inputs.test-scope }} Tests ${{ inputs.test-name }} ${{ matrix.backend-version }}
Py${{ matrix.python-version }}:${{ inputs.test-types-list-as-string}}
run: ./scripts/ci/testing/run_unit_tests.sh
- name: "Post Tests success"
uses: ./.github/actions/post_tests_success
with:
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/special-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ on: # yamllint disable-line rule:truthy
description: "Tag to set for the image"
required: true
type: string
parallel-test-types-list-as-string:
core-test-types-list-as-string:
description: "The list of parallel test types to run separated by spaces"
required: true
type: string
Expand Down Expand Up @@ -83,7 +83,7 @@ jobs:
backend-versions: "['${{ inputs.default-postgres-version }}']"
excluded-providers-as-string: ${{ inputs.excluded-providers-as-string }}
excludes: "[]"
parallel-test-types-list-as-string: ${{ inputs.parallel-test-types-list-as-string }}
core-test-types-list-as-string: ${{ inputs.core-test-types-list-as-string }}
include-success-outputs: ${{ needs.build-info.outputs.include-success-outputs }}
run-coverage: ${{ inputs.run-coverage }}
debug-resources: ${{ inputs.debug-resources }}
Expand All @@ -106,7 +106,7 @@ jobs:
backend-versions: "['${{ inputs.default-postgres-version }}']"
excluded-providers-as-string: ${{ inputs.excluded-providers-as-string }}
excludes: "[]"
parallel-test-types-list-as-string: ${{ inputs.parallel-test-types-list-as-string }}
core-test-types-list-as-string: ${{ inputs.core-test-types-list-as-string }}
include-success-outputs: ${{ needs.build-info.outputs.include-success-outputs }}
run-coverage: ${{ inputs.run-coverage }}
debug-resources: ${{ inputs.debug-resources }}
Expand All @@ -129,7 +129,7 @@ jobs:
backend-versions: "['${{ inputs.default-postgres-version }}']"
excluded-providers-as-string: ${{ inputs.excluded-providers-as-string }}
excludes: "[]"
parallel-test-types-list-as-string: ${{ inputs.parallel-test-types-list-as-string }}
core-test-types-list-as-string: ${{ inputs.core-test-types-list-as-string }}
include-success-outputs: ${{ needs.build-info.outputs.include-success-outputs }}
run-coverage: ${{ inputs.run-coverage }}
debug-resources: ${{ inputs.debug-resources }}
Expand All @@ -152,7 +152,7 @@ jobs:
backend-versions: "['${{ inputs.default-postgres-version }}']"
excluded-providers-as-string: ${{ inputs.excluded-providers-as-string }}
excludes: "[]"
parallel-test-types-list-as-string: ${{ inputs.parallel-test-types-list-as-string }}
core-test-types-list-as-string: ${{ inputs.core-test-types-list-as-string }}
include-success-outputs: ${{ needs.build-info.outputs.include-success-outputs }}
run-coverage: ${{ inputs.run-coverage }}
debug-resources: ${{ inputs.debug-resources }}
Expand All @@ -174,7 +174,7 @@ jobs:
backend-versions: "['${{ inputs.default-postgres-version }}']"
excluded-providers-as-string: ${{ inputs.excluded-providers-as-string }}
excludes: "[]"
parallel-test-types-list-as-string: ${{ inputs.parallel-test-types-list-as-string }}
core-test-types-list-as-string: ${{ inputs.core-test-types-list-as-string }}
include-success-outputs: ${{ needs.build-info.outputs.include-success-outputs }}
run-coverage: ${{ inputs.run-coverage }}
debug-resources: ${{ inputs.debug-resources }}
Expand All @@ -196,7 +196,7 @@ jobs:
backend-versions: "['${{ inputs.default-postgres-version }}']"
excluded-providers-as-string: ${{ inputs.excluded-providers-as-string }}
excludes: "[]"
parallel-test-types-list-as-string: ${{ inputs.parallel-test-types-list-as-string }}
core-test-types-list-as-string: ${{ inputs.core-test-types-list-as-string }}
include-success-outputs: ${{ needs.build-info.outputs.include-success-outputs }}
run-coverage: ${{ inputs.run-coverage }}
debug-resources: ${{ inputs.debug-resources }}
Expand All @@ -218,7 +218,7 @@ jobs:
backend-versions: "['${{ inputs.default-postgres-version }}']"
excluded-providers-as-string: ${{ inputs.excluded-providers-as-string }}
excludes: "[]"
parallel-test-types-list-as-string: ${{ inputs.parallel-test-types-list-as-string }}
core-test-types-list-as-string: ${{ inputs.core-test-types-list-as-string }}
include-success-outputs: ${{ needs.build-info.outputs.include-success-outputs }}
run-coverage: ${{ inputs.run-coverage }}
debug-resources: ${{ inputs.debug-resources }}
6 changes: 0 additions & 6 deletions Dockerfile.ci
Original file line number Diff line number Diff line change
Expand Up @@ -1068,12 +1068,6 @@ function check_run_tests() {
python "${IN_CONTAINER_DIR}/remove_arm_packages.py"
fi

if [[ ${TEST_TYPE} == "PlainAsserts" ]]; then
# Plain asserts should be converted to env variable to make sure they are taken into account
# otherwise they will not be effective during test collection when plain assert is breaking collection
export PYTEST_PLAIN_ASSERTS="true"
fi

if [[ ${DATABASE_ISOLATION=} == "true" ]]; then
echo "${COLOR_BLUE}Starting internal API server:${COLOR_RESET}"
# We need to start the internal API server before running tests
Expand Down
10 changes: 0 additions & 10 deletions contributing-docs/testing/unit_tests.rst
Original file line number Diff line number Diff line change
Expand Up @@ -104,18 +104,8 @@ Those test types are defined:
``virtualenv_operator`` and ``external_python_operator`` test markers that the tests are marked with.
* ``WWW`` - Tests for the Airflow webserver (www folder)
* ``Providers`` - Tests for all Providers of Airflow (providers folder)
* ``PlainAsserts`` - tests that require disabling ``assert-rewrite`` feature of Pytest (usually because
a buggy/complex implementation of an imported library) (``plain_asserts`` marker)
* ``Other`` - all other tests remaining after the above tests are selected

There are also Virtualenv/ExternalPython operator test types that are excluded from ``Operators`` test type
and run as separate test types. Those are :

* ``PythonVenv`` - tests for PythonVirtualenvOperator - selected directly as TestPythonVirtualenvOperator
* ``BranchPythonVenv`` - tests for BranchPythonVirtualenvOperator - selected directly as TestBranchPythonVirtualenvOperator
* ``ExternalPython`` - tests for ExternalPythonOperator - selected directly as TestExternalPythonOperator
* ``BranchExternalPython`` - tests for BranchExternalPythonOperator - selected directly as TestBranchExternalPythonOperator

We have also tests that run "all" tests (so they do not look at the folder, but at the ``pytest`` markers
the tests are marked with to run with some filters applied.

Expand Down
Loading