Skip to content

Commit

Permalink
199 cordex xfails (#304)
Browse files Browse the repository at this point in the history
* Added xfails marker, changed modules on Gadi

* Fixed tests e2e test, just need to update bin script

* Updated flags for e2e test

* Changed flags on E2E test - should make inspecting logs easier

* update workflow file

* Only run e2e dir on workflow (sync between reference copy & remote pain to get right)
  • Loading branch information
charles-turner-1 authored Dec 12, 2024
1 parent 3590e46 commit d74943d
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 18 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
name: Run end-to-end tests on Gadi
on:
workflow_dispatch:
inputs:
release_version:
description: 'Release version'
required: true

jobs:
build:
Expand Down
10 changes: 6 additions & 4 deletions bin/test_end_to_end.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
#!/bin/bash -l

#PBS -P iq82
#PBS -l storage=gdata/xp65+gdata/ik11+gdata/cj50+gdata/p73+gdata/dk92+gdata/al33+gdata/rr3+gdata/fs38+gdata/oi10
#PBS -l storage=gdata/xp65+gdata/ik11+gdata/cj50+gdata/p73+gdata/dk92+gdata/al33+gdata/rr3+gdata/fs38+gdata/oi10+gdata/hq89+gdata/py18+gdata/ig45+gdata/zz63+gdata/rt52
#PBS -q normal
#PBS -W block=true
#PBS -l walltime=00:30:00
#PBS -l mem=32gb
#PBS -l mem=64gb
#PBS -l ncpus=12
#PBS -l wd
#PBS -j oe
#PBS -W umask=0022

###########################################################################################
# Copyright 2022 ACCESS-NRI and contributors. See the top-level COPYRIGHT file for details.
Expand All @@ -22,6 +23,7 @@
set -e

module use /g/data/xp65/public/modules
module load conda/access-med-0.6
module load conda/analysis3-24.12
module load openmpi

pytest -s --e2e tests
pytest -s --e2e /g/data/xp65/admin/access-nri-intake-catalog/tests/e2e
5 changes: 5 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,8 @@ def pytest_collection_modifyitems(config, items):
and _add_xfail
):
item.add_marker("xfail")

# Now add xfail to broken CordexTranslator in end to end tests.
for item in items:
if item.name == "test_alignment[CordexTranslator]":
item.add_marker("xfail")
18 changes: 8 additions & 10 deletions tests/e2e/test_end_to_end.py
Original file line number Diff line number Diff line change
Expand Up @@ -2400,12 +2400,11 @@ def test_cmip5_values_correct(metacat, current_catalog, path, varname, first_ten
}
)
da = da.isel(**{dim: 0 for dim in da.dims[1:]})
da_val = da.mean(dim=da.dims[0], skipna=True).values
da_val = float(da.mean(dim=da.dims[0], skipna=True).values)

if np.isnan(da_val).all():
vals_equal = np.isnan(first_ten_mean)
else:
vals_equal = da_val == pytest.approx(first_ten_mean, abs=1e-6)
vals_equal = da_val == pytest.approx(
first_ten_mean, abs=1e-6, rel=1e-3, nan_ok=True
)

assert vals_equal

Expand Down Expand Up @@ -2488,11 +2487,10 @@ def test_om2_values_correct(metacat, path, varname, first_ten_mean):
}
)
da = da.isel(**{dim: 0 for dim in da.dims[1:]})
da_val = da.mean(dim=da.dims[0], skipna=True).values
da_val = float(da.mean(dim=da.dims[0], skipna=True).values)

if np.isnan(da_val).all():
vals_equal = np.isnan(first_ten_mean)
else:
vals_equal = da_val == pytest.approx(first_ten_mean, abs=1e-6)
vals_equal = da_val == pytest.approx(
first_ten_mean, abs=1e-6, rel=1e-3, nan_ok=True
)

assert vals_equal

0 comments on commit d74943d

Please sign in to comment.