From be47941273003b5bb925b7d09b7b3a50fb810633 Mon Sep 17 00:00:00 2001 From: eli knaap Date: Mon, 2 Oct 2023 10:56:44 -0700 Subject: [PATCH 1/5] try skipping problematic tests on win --- geosnap/tests/test_constructors.py | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/geosnap/tests/test_constructors.py b/geosnap/tests/test_constructors.py index dad389aa..3693ec9a 100644 --- a/geosnap/tests/test_constructors.py +++ b/geosnap/tests/test_constructors.py @@ -10,6 +10,7 @@ LTDB = None NCDB = None +import sys store = DataStore() @@ -25,13 +26,24 @@ def test_nces_school_dists(): def test_ejscreen(): - ej = io.get_ejscreen(store, years=[2018], fips=["11"]) - assert ej.shape == (450, 369) + if sys.platform.startswith("win"): + pytest.skip( + "skipping test on windows due to mem failure", allow_module_level=True + ) + + else: + ej = io.get_ejscreen(store, years=[2018], fips=["11"]) + assert ej.shape == (450, 369) def test_nces_sabs(): - sabs = io.get_nces(store, dataset="sabs") - assert sabs.shape == (75128, 15) + if sys.platform.startswith("win"): + pytest.skip( + "skipping test on windows due to mem failure", allow_module_level=True + ) + else: + sabs = io.get_nces(store, dataset="sabs") + assert sabs.shape == (75128, 15) def test_acs(): From d917836e7a9d60b40508d25fed8186e1416f054f Mon Sep 17 00:00:00 2001 From: eli knaap Date: Mon, 2 Oct 2023 11:05:56 -0700 Subject: [PATCH 2/5] use skipif --- geosnap/tests/test_constructors.py | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/geosnap/tests/test_constructors.py b/geosnap/tests/test_constructors.py index 3693ec9a..6b6077ef 100644 --- a/geosnap/tests/test_constructors.py +++ b/geosnap/tests/test_constructors.py @@ -24,26 +24,15 @@ def test_nces_school_dists(): dists = io.get_nces(store, dataset="school_districts") assert dists.shape == (13352, 18) - +@pytest.mark.skipif(sys.platform.startswith("win"), reason="skipping test on windows due to mem failure") def test_ejscreen(): - if sys.platform.startswith("win"): - pytest.skip( - "skipping test on windows due to mem failure", allow_module_level=True - ) - - else: - ej = io.get_ejscreen(store, years=[2018], fips=["11"]) - assert ej.shape == (450, 369) - + ej = io.get_ejscreen(store, years=[2018], fips=["11"]) + assert ej.shape == (450, 369) +@pytest.mark.skipif(sys.platform.startswith("win"), reason="skipping test on windows due to mem failure") def test_nces_sabs(): - if sys.platform.startswith("win"): - pytest.skip( - "skipping test on windows due to mem failure", allow_module_level=True - ) - else: - sabs = io.get_nces(store, dataset="sabs") - assert sabs.shape == (75128, 15) + sabs = io.get_nces(store, dataset="sabs") + assert sabs.shape == (75128, 15) def test_acs(): From e89ddbab421470b462be8953dd6c1f2de180637f Mon Sep 17 00:00:00 2001 From: eli knaap Date: Mon, 2 Oct 2023 11:38:58 -0700 Subject: [PATCH 3/5] codecov step --- .github/workflows/unittests.yml | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/.github/workflows/unittests.yml b/.github/workflows/unittests.yml index e3e24c2a..32914d3f 100644 --- a/.github/workflows/unittests.yml +++ b/.github/workflows/unittests.yml @@ -48,14 +48,9 @@ jobs: run: | pytest -v --color yes --cov geosnap/tests --cov-append --cov-report term-missing --cov-report xml . - - uses: codecov/codecov-action@v3 - - - name: Generate and publish the report - if: | - failure() - && steps.status.outcome == 'failure' - && github.event_name == 'schedule' - && github.repository_owner == 'pysal' - uses: xarray-contrib/issue-from-pytest-log@v1 + - name: codecov + uses: codecov/codecov-action@v3 with: - log-path: pytest-log.jsonl \ No newline at end of file + token: ${{ secrets.CODECOV_TOKEN }} + file: ./coverage.xml + name: geosnap-codecov \ No newline at end of file From 7f4f5638e36b62eb06202744282c0f267bd546a5 Mon Sep 17 00:00:00 2001 From: eli knaap Date: Mon, 2 Oct 2023 11:59:07 -0700 Subject: [PATCH 4/5] test workflow --- .github/workflows/unittests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unittests.yml b/.github/workflows/unittests.yml index 32914d3f..4931b4a9 100644 --- a/.github/workflows/unittests.yml +++ b/.github/workflows/unittests.yml @@ -46,7 +46,7 @@ jobs: - name: Test geosnap run: | - pytest -v --color yes --cov geosnap/tests --cov-append --cov-report term-missing --cov-report xml . + pytest -v --color yes --cov=geosnap --cov-append --cov-report term-missing --cov-report xml . - name: codecov uses: codecov/codecov-action@v3 From dcf7de8e38de8b80a9c54692584b186d7e49d6a5 Mon Sep 17 00:00:00 2001 From: eli knaap Date: Mon, 2 Oct 2023 12:01:50 -0700 Subject: [PATCH 5/5] use micromamba recipe --- .github/workflows/unittests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/unittests.yml b/.github/workflows/unittests.yml index 4931b4a9..e28ffa7f 100644 --- a/.github/workflows/unittests.yml +++ b/.github/workflows/unittests.yml @@ -34,10 +34,10 @@ jobs: - uses: actions/checkout@v4 - name: setup micromamba - uses: mamba-org/provision-with-micromamba@main + uses: mamba-org/setup-micromamba@v1 with: environment-file: ${{ matrix.environment-file }} - micromamba-version: "latest" + micromamba-version: 'latest' - name: Install geosnap run: pip install . ;python geosnap/tests/_dl_data.py;