diff --git a/.github/workflows/dags_test.yml b/.github/workflows/dags_test.yml index 266dba13c..16d979cfe 100644 --- a/.github/workflows/dags_test.yml +++ b/.github/workflows/dags_test.yml @@ -12,25 +12,21 @@ jobs: steps: - uses: actions/checkout@v3 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: - python-version: "3.7" + python-version: "3.9" - name: Install dependencies run: | python -m pip install --upgrade pip - pip install -r requirements/requirements.txt + pip install -r dags/requirements.txt pip check - - name: Lint with Flake8 + - name: Lint dags with ruff run: | - pip install flake8 - flake8 dags --benchmark -v - - name: Confirm Black code compliance - run: | - pip install black - black dags -v + pip install ruff + ruff check --format=github ./dags - name: Test with Pytest run: | - pip install pytest - cd tests || exit + pip install pytest apache-airflow + cd dags || exit pytest tests.py -v diff --git a/dags/tests.py b/dags/tests.py index 0f3802f24..0e0642abb 100644 --- a/dags/tests.py +++ b/dags/tests.py @@ -2,7 +2,6 @@ from airflow.models import DagBag -from . import rikolti_harvest_collection_dag as harvest_dag DAGS_FOLDER = "." @@ -11,5 +10,5 @@ class HarvestDagsTest(TestCase): def dag_bag(self): return DagBag(dag_folder=DAGS_FOLDER, include_examples=False) - def test_no_import_errors(dag_bag): - assert not dag_bag.import_errors + def test_no_import_errors(self): + assert not self.dag_bag.import_errors