diff --git a/.github/workflows/test-and-build.yml b/.github/workflows/test-and-build.yml index f37acf0..aeb5688 100644 --- a/.github/workflows/test-and-build.yml +++ b/.github/workflows/test-and-build.yml @@ -63,6 +63,7 @@ jobs: username: ${{ secrets.HARBOR_USERNAME }} password: ${{ secrets.HARBOR_PASSWORD }} + - name: Run tests with pytest and generate report run: > docker run @@ -72,7 +73,13 @@ jobs: -v "$(pwd)"/dags:/opt/airflow/dags -v "$(pwd)"/airflow.cfg:/opt/airflow/airflow.cfg -v "$(pwd)"/data:/opt/airflow/data - --entrypoint pytest + bash -c "airflow db init && \ + airflow webserver -D && \ + airflow scheduler -D && \ + airflow triggerer -D && \ + airflow celery worker -D && \ + airflow celery flower -D && \ + pytest" $REGISTRY/$IMAGE@${{ steps.build.outputs.image-digest }} tests --cov=./ diff --git a/Dockerfile b/Dockerfile index 0fa6e58..06a6212 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,9 +5,3 @@ COPY requirements.txt ./requirements.txt COPY requirements-airflow.txt ./requirements-airflow.txt COPY requirements-test.txt ./requirements-test.txt RUN pip install --no-cache-dir --user -r requirements.txt -r requirements-test.txt -r requirements-airflow.txt -RUN airflow db init -RUN airflow webserver -D -RUN airflow triggerer -D -RUN airflow scheduler -D -RUN airflow celery worker -D -RUN airflow celery flower -D