@@ -57,46 +57,35 @@ jobs:
5757 conda-forge::pyyaml \
5858 conda-forge::pytest
5959
60- - name : Install cc-plugin-wcrp
61- run : |
62- pip install cc-plugin-wcrp
63-
64- - name : Configure esgvoc controlled vocabularies
65- run : |
66- esgvoc config add cordex-cmip6
67- esgvoc config add cmip7
68- esgvoc config set project:branch=esgvoc
69- esgvoc install
70-
71- - name : Verify cc-plugin-wcrp installation
72- run : |
73- echo "Listing available compliance-checker plugins..."
74- compliance-checker -l
75-
7660 - name : Install fremorizer
7761 run : |
7862 pip install .
7963
64+ # ── generate test outputs (moved earlier, most fragile step) ──
8065 - name : Run tests to generate output files
66+ id : run_tests
8167 run : |
8268 echo "Running test suite to generate NetCDF outputs..."
69+ echo "Using --basetemp=tmp/pytest_basetemp to preserve pytest temp artifacts"
8370 echo ""
8471
8572 echo "=========================================="
8673 echo "Running CMIP6 basic tests..."
8774 echo "=========================================="
88- pytest fremorizer/tests/test_cmor_run_subtool.py -v || true
75+ pytest fremorizer/tests/test_cmor_run_subtool.py -v \
76+ --basetemp=tmp/pytest_basetemp || true
8977
9078 echo ""
9179 echo "=========================================="
9280 echo "Running extended test examples..."
9381 echo "=========================================="
94- pytest fremorizer/tests/test_cmor_run_subtool_further_examples.py -v || true
82+ pytest fremorizer/tests/test_cmor_run_subtool_further_examples.py -v \
83+ --basetemp=tmp/pytest_basetemp || true
9584
9685 echo ""
9786 echo "Test execution complete."
98- continue-on-error : true
9987
88+ # ── gather and categorize outputs ──
10089 - name : Gather test outputs into centralized directory
10190 id : gather_outputs
10291 run : |
@@ -115,6 +104,44 @@ jobs:
115104 echo "cmip7_count=${cmip7_files}" >> $GITHUB_OUTPUT
116105 echo "other_count=${other_files}" >> $GITHUB_OUTPUT
117106
107+ echo ""
108+ echo "Summary: total=${total_files} cmip6=${cmip6_files} cmip7=${cmip7_files} other=${other_files}"
109+
110+ - name : Verify outputs were gathered
111+ if : steps.gather_outputs.outputs.file_count == '0'
112+ run : |
113+ echo "::warning::No NetCDF files were found after running tests"
114+ echo "This may indicate that tests did not run successfully or outputs were not generated"
115+ echo ""
116+ echo "Checking known test output directories for debugging..."
117+ echo "--- fremorizer/tests/test_files/outdir ---"
118+ find fremorizer/tests/test_files/outdir -name "*.nc" -type f 2>/dev/null || echo "(empty or missing)"
119+ echo "--- fremorizer/tests/test_files/outdir_ppan_only ---"
120+ find fremorizer/tests/test_files/outdir_ppan_only -name "*.nc" -type f 2>/dev/null || echo "(empty or missing)"
121+ echo "--- tmp/pytest_basetemp ---"
122+ find tmp/pytest_basetemp -name "*.nc" -type f 2>/dev/null || echo "(empty or missing)"
123+
124+ # ── install cc-plugin-wcrp (after tests, since it's not needed until now) ──
125+ - name : Install cc-plugin-wcrp
126+ if : steps.gather_outputs.outputs.file_count != '0'
127+ run : |
128+ pip install cc-plugin-wcrp
129+
130+ - name : Configure esgvoc controlled vocabularies
131+ if : steps.gather_outputs.outputs.file_count != '0'
132+ run : |
133+ esgvoc config add cordex-cmip6
134+ esgvoc config add cmip7
135+ esgvoc config set project:branch=esgvoc
136+ esgvoc install
137+
138+ - name : Verify cc-plugin-wcrp installation
139+ if : steps.gather_outputs.outputs.file_count != '0'
140+ run : |
141+ echo "Listing available compliance-checker plugins..."
142+ compliance-checker -l
143+
144+ # ── run WCRP compliance checks ──
118145 - name : Run WCRP compliance checks on CMIP6 outputs
119146 if : steps.gather_outputs.outputs.cmip6_count != '0'
120147 run : |
@@ -190,6 +217,7 @@ jobs:
190217 fi
191218 done
192219
220+ # ── reports and artifacts ──
193221 - name : Generate summary report
194222 if : steps.gather_outputs.outputs.file_count != '0'
195223 run : |
@@ -227,9 +255,3 @@ jobs:
227255 name : wcrp-compliance-reports
228256 path : tmp/wcrp_compliance_reports/
229257 retention-days : 30
230-
231- - name : Check if any files were tested
232- if : steps.gather_outputs.outputs.file_count == '0'
233- run : |
234- echo "::warning::No NetCDF files were found to check for WCRP compliance"
235- echo "This may indicate that tests did not run successfully or outputs were not generated"
0 commit comments