This repository has been archived by the owner on Nov 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
airflow: add dag integrity test, clear warnings, fix tests
- Loading branch information
Showing
10 changed files
with
29 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,6 +51,7 @@ jobs: | |
-v "$(pwd)"/tests:/opt/airflow/tests | ||
-v "$(pwd)"/requirements-test.txt:/opt/airflow/requirements-test.txt | ||
-v "$(pwd)"/data:/opt/airflow/data | ||
-v "$(pwd)"/scripts/variables/variables.json:/opt/airflow/variables.json | ||
-e AIRFLOW__CORE__EXECUTOR=CeleryExecutor | ||
-e AIRFLOW__DATABASE__SQL_ALCHEMY_CONN=postgresql+psycopg2://airflow:[email protected]:5432/airflow | ||
-e AIRFLOW__CELERY__RESULT_BACKEND=db+postgresql://airflow:[email protected]:5432/airflow | ||
|
@@ -60,4 +61,4 @@ jobs: | |
-e AIRFLOW__CORE__LOAD_EXAMPLES="false" | ||
-e AIRFLOW__API__AUTH_BACKENDS="airflow.api.auth.backend.basic_auth,airflow.api.auth.backend.session" | ||
registry.cern.ch/cern-sis/inspire/workflows@${{ needs.build.outputs.image-id }} | ||
bash -c "pip install -r requirements-test.txt && airflow db init && pytest /opt/airflow/tests" | ||
bash -c "pip install -r requirements-test.txt && airflow db init && airflow variables import /opt/airflow/variables.json && pytest /opt/airflow/tests" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
FROM apache/airflow:2.9.3-python3.11 | ||
|
||
WORKDIR /opt/airflow | ||
|
||
COPY --chown=airflow:root dags ./dags/ | ||
COPY --chown=airflow:root plugins ./plugins/ | ||
COPY --chown=airflow:root requirements.txt ./requirements.txt | ||
COPY --chown=airflow:root requirements-test.txt ./requirements-test.txt | ||
|
||
RUN pip install --no-cache-dir -r requirements.txt -r requirements-test.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from airflow.models import DagBag | ||
|
||
|
||
def test_dagbag(): | ||
dag_bag = DagBag(include_examples=False) | ||
assert not dag_bag.import_errors |