From 4c1e9ba7751885125ab8e9ff9343a489feb972c8 Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Sat, 25 Jan 2025 22:50:41 +0100 Subject: [PATCH 1/2] only run the workflow in the pgf organization --- .github/workflows/main.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 930ccfa6..e2d75c6d 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -17,6 +17,7 @@ env: jobs: run-tests: + if: github.repository_owner == 'pangeo-forge' runs-on: ubuntu-latest strategy: fail-fast: false From 947fdf30d386a9ac5925d72ae01a491c0ff7145a Mon Sep 17 00:00:00 2001 From: Justus Magin Date: Sat, 25 Jan 2025 22:51:02 +0100 Subject: [PATCH 2/2] create reports on failing upstream-dev tests --- .github/workflows/main.yaml | 13 ++++++++++++- pyproject.toml | 1 + 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index e2d75c6d..378517a7 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -49,12 +49,23 @@ jobs: python -m pip install -U --pre apache-beam - name: 🏄‍♂️ Run Tests shell: bash -l {0} + id: test-run run: | py.test tests -v -n auto \ --cov=pangeo_forge_recipes --cov-config .coveragerc \ --cov-report term-missing \ --cov-report xml \ - --durations=10 --durations-min=1.0 + --durations=10 --durations-min=1.0 \ + --report-log output-${{ matrix.python-version }}-log.jsonl + - name: Generate and publish the report + if: | + failure() + && steps.test-run.outcome == 'failure' + && github.event_name == 'schedule' + uses: xarray-contrib/issue-from-pytest-log@v1 + with: + log-path: output-${{ matrix.python-version }}-log.jsonl + issue-title: ⚠ Nightly upstream-dev CI (${{matrix.python-version}}) failed ⚠ - name: 🚦 Run Codecov if: | github.event_name == 'push' || diff --git a/pyproject.toml b/pyproject.toml index 301fbbf9..7c26b6a1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -48,6 +48,7 @@ test = [ "pytest-lazy-fixture", "pytest-sugar", "pytest-timeout", + "pytest-reportlog", "s3fs", "gcsfs", "scipy",