Skip to content

Commit

Permalink
.github/workflows/tests.yml: airflow-extras, tests-pattern
Browse files Browse the repository at this point in the history
Configuration simplified to reduce duplication
  • Loading branch information
bryzgaloff authored Jan 29, 2024
1 parent 53b520c commit 557e74c
Showing 1 changed file with 16 additions and 99 deletions.
115 changes: 16 additions & 99 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ env:

jobs:

unit-tests-no-common-sql:
unit-tests:
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -46,6 +46,11 @@ jobs:
airflow-version: "2.4.3"
- python-version: "3.11"
airflow-version: "2.5.3"
include:
- airflow-extras: "[common.sql]"
tests-pattern: ""
- airflow-extras: ""
tests-pattern: "-p test_clickhouse.py"
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -57,57 +62,14 @@ jobs:
python -m pip install --upgrade pip
python -m pip install \
-r requirements.txt \
apache-airflow==${{ matrix.airflow-version }} \
apache-airflow${{ matrix.airflow-extras }}==${{ matrix.airflow-version }} \
--ignore-installed \
--constraint "https://raw.githubusercontent.com/apache/airflow/constraints-${{ matrix.airflow-version }}/constraints-${{ matrix.python-version }}.txt"
- name: Run unit tests
run: |
python -m unittest discover -t tests -s unit -p test_clickhouse.py
python -m unittest discover -t tests -s unit ${{ matrix.tests-pattern }}
unit-tests-common-sql:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
airflow-version: ["2.1.4", "2.2.5", "2.3.4", "2.4.3", "2.5.3", "2.6.3", "2.7.1"]
exclude:
- python-version: "3.10"
airflow-version: "2.0.2"
- python-version: "3.10"
airflow-version: "2.1.4"
- python-version: "3.10"
airflow-version: "2.2.5"
- python-version: "3.11"
airflow-version: "2.0.2"
- python-version: "3.11"
airflow-version: "2.1.4"
- python-version: "3.11"
airflow-version: "2.2.5"
- python-version: "3.11"
airflow-version: "2.3.4"
- python-version: "3.11"
airflow-version: "2.4.3"
- python-version: "3.11"
airflow-version: "2.5.3"
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install \
-r requirements.txt \
apache-airflow[common.sql]==${{ matrix.airflow-version }} \
--ignore-installed \
--constraint "https://raw.githubusercontent.com/apache/airflow/constraints-${{ matrix.airflow-version }}/constraints-${{ matrix.python-version }}.txt"
- name: Run unit tests
run: |
python -m unittest discover -t tests -s unit
integration-tests-no-common-sql:
integration-tests:
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -132,6 +94,11 @@ jobs:
airflow-version: "2.4.3"
- python-version: "3.11"
airflow-version: "2.5.3"
include:
- airflow-extras: "[common.sql]"
tests-pattern: ""
- airflow-extras: ""
tests-pattern: "-p test_clickhouse.py"
services:
clickhouse:
image: yandex/clickhouse-server
Expand All @@ -148,61 +115,11 @@ jobs:
python -m pip install --upgrade pip
python -m pip install \
-r requirements.txt \
apache-airflow==${{ matrix.airflow-version }} \
--ignore-installed \
--constraint "https://raw.githubusercontent.com/apache/airflow/constraints-${{ matrix.airflow-version }}/constraints-${{ matrix.python-version }}.txt"
- name: Run tests on ClickHouse server
env:
AIRFLOW_CONN_CLICKHOUSE_DEFAULT: "clickhouse://localhost:${{ job.services.clickhouse.ports['9000'] }}"
run: |
python -m unittest discover -t tests -s integration -p test_clickhouse.py
integration-tests-common-sql:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
airflow-version: ["2.1.4", "2.2.5", "2.3.4", "2.4.3", "2.5.3", "2.6.3", "2.7.1"]
exclude:
- python-version: "3.10"
airflow-version: "2.0.2"
- python-version: "3.10"
airflow-version: "2.1.4"
- python-version: "3.10"
airflow-version: "2.2.5"
- python-version: "3.11"
airflow-version: "2.0.2"
- python-version: "3.11"
airflow-version: "2.1.4"
- python-version: "3.11"
airflow-version: "2.2.5"
- python-version: "3.11"
airflow-version: "2.3.4"
- python-version: "3.11"
airflow-version: "2.4.3"
- python-version: "3.11"
airflow-version: "2.5.3"
services:
clickhouse:
image: yandex/clickhouse-server
ports:
- 9000/tcp
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install \
-r requirements.txt \
apache-airflow[common.sql]==${{ matrix.airflow-version }} \
apache-airflow${{ matrix.airflow-extras }}==${{ matrix.airflow-version }} \
--ignore-installed \
--constraint "https://raw.githubusercontent.com/apache/airflow/constraints-${{ matrix.airflow-version }}/constraints-${{ matrix.python-version }}.txt"
- name: Run tests on ClickHouse server
env:
AIRFLOW_CONN_CLICKHOUSE_DEFAULT: "clickhouse://localhost:${{ job.services.clickhouse.ports['9000'] }}"
run: |
python -m unittest discover -t tests -s integration
python -m unittest discover -t tests -s integration ${{ matrix.tests-pattern }}

0 comments on commit 557e74c

Please sign in to comment.