From 23b832250ac6ba04be8b508cd83816923747c551 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mirko=20M=C3=A4licke?= Date: Fri, 25 Feb 2022 09:15:24 +0100 Subject: [PATCH 1/3] add OS environ check --- .github/workflows/main.yml | 7 ++++--- ruins/tests/test_datamanager.py | 8 ++++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 17c550c..12d6f25 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,9 +20,10 @@ jobs: - name: Checkout and use lfs uses: actions/checkout@v2 with: - lfs: true - - name: Download LFS - run: git lfs checkout + # lfs: true + lfs: false + # - name: Download LFS + # run: git lfs checkout - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: diff --git a/ruins/tests/test_datamanager.py b/ruins/tests/test_datamanager.py index b3858e0..1c63238 100644 --- a/ruins/tests/test_datamanager.py +++ b/ruins/tests/test_datamanager.py @@ -1,8 +1,13 @@ import xarray as xr +import os from ruins.core import DataManager from ruins.core.data_manager import HDF5Source +# some datasources are backed by git-lfs which have to be disabled on +# github actions +NO_LFS = 'NO_LFS' in os.environ + def test_default_manager(): """Instantiate the default data manager""" @@ -27,5 +32,8 @@ def test_weather_dataset(): assert isinstance(weather, HDF5Source) # load the data + if NO_LFS: + return + data = weather.read() assert isinstance(data, xr.Dataset) From a151ec460f9b31910e92cb22b3213393058cd56b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mirko=20M=C3=A4licke?= Date: Fri, 25 Feb 2022 09:21:06 +0100 Subject: [PATCH 2/3] add print to captured output --- ruins/tests/test_datamanager.py | 1 + 1 file changed, 1 insertion(+) diff --git a/ruins/tests/test_datamanager.py b/ruins/tests/test_datamanager.py index 1c63238..25e1cbd 100644 --- a/ruins/tests/test_datamanager.py +++ b/ruins/tests/test_datamanager.py @@ -33,6 +33,7 @@ def test_weather_dataset(): # load the data if NO_LFS: + print('No LFS, skipping partial test') return data = weather.read() From c1f8f0721089ef4f8debe2d195c216a94b4794f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mirko=20M=C3=A4licke?= Date: Fri, 25 Feb 2022 09:23:44 +0100 Subject: [PATCH 3/3] disable LFS tests on GH actions --- .github/workflows/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 12d6f25..45ddf1d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -38,6 +38,8 @@ jobs: run: | pip install pytest pytest-cov pytest --import-mode=append --cov-config=.coveragerc --cov=ruins --cov-report=xml + env: + NO_LFS: true - name: Upload coverage to codecov uses: codecov/codecov-action@v2