Skip to content

Commit 559392e

Browse files
committed
Separate test cases and correct github actions.
1 parent d828c84 commit 559392e

10 files changed

Lines changed: 142 additions & 56 deletions

.github/workflows/ci_env.yml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,28 @@ jobs:
66
tests:
77
runs-on: ubuntu-22.04
88
strategy:
9-
max-parallel: 5
9+
matrix:
10+
python-version: ["3.8"]
1011

1112
steps:
1213
- name: Checkout github repo
13-
uses: actions/checkout@v3
14-
- uses: conda-incubator/setup-miniconda@v2
14+
uses: actions/checkout@v4
15+
- name: Setup Miniconda
16+
uses: conda-incubator/setup-miniconda@v3
1517
with:
1618
auto-update-conda: true
1719
python-version: 3.8
20+
miniforge-version: latest
21+
1822
- name: Conda info
1923
shell: bash -el {0}
2024
run: conda info
21-
- name: Install python and gcc
22-
shell: bash -el {0}
23-
run: |
24-
conda install -c conda-forge python=3.8
25-
conda install -c conda-forge gcc=12.1.0
26-
- name: Install gdal eccodes hdf5
25+
26+
- name: Install system dependencies
2727
shell: bash -el {0}
2828
run: |
29-
conda install -c conda-forge "gdal<=3.9.2" eccodes
30-
conda install -c conda-forge hdf5
29+
conda install -c conda-forge "gcc=12.1.0" "gdal<=3.9.2" eccodes hdf5
30+
3131
- name: Install dependencies
3232
shell: bash -el {0}
3333
run: |
@@ -39,6 +39,7 @@ jobs:
3939
gdal-config --version
4040
python -c "from osgeo import gdal; print(gdal.__version__)"
4141
conda list
42+
4243
- name: Test with pytest
4344
shell: bash -el {0}
4445
run: |

pytest.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[pytest]
2-
python_files = *_tests.py
2+
python_files = tests_*.py
33
python_classes = Test
44
python_functions = test_*
55
norecursedirs = build

tests/dates_tests.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

tests/readfiles_tests.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

tests/tests_cordex.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
"""
2+
3+
Copyright 2019 European Union
4+
5+
Licensed under the EUPL, Version 1.2 or as soon they will be approved by the European Commission subsequent versions of the EUPL (the "Licence");
6+
7+
You may not use this work except in compliance with the Licence.
8+
You may obtain a copy of the Licence at:
9+
10+
https://joinup.ec.europa.eu/sites/default/files/inline-files/EUPL%20v1_2%20EN(1).txt
11+
12+
Unless required by applicable law or agreed to in writing, software distributed under the Licence is distributed on an "AS IS" basis,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the Licence for the specific language governing permissions and limitations under the Licence.
15+
16+
"""
17+
18+
import os
19+
20+
from tests import TestLis
21+
22+
current_dir = os.path.dirname(__file__)
23+
24+
25+
class TestCORDEX(TestLis):
26+
domain = 'cordex'
27+
settings_path = os.path.join(current_dir, 'data/tests_cordex.xml')
28+
29+
def test_e0(self):
30+
return self.listest('e0')
31+
32+
def test_et(self):
33+
return self.listest('et')
Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -136,44 +136,3 @@ def test_es(self):
136136

137137
def test_et(self):
138138
return self.listest('et')
139-
140-
141-
class TestCORDEX(TestLis):
142-
domain = 'cordex'
143-
settings_path = os.path.join(current_dir, 'data/tests_cordex.xml')
144-
145-
def test_e0(self):
146-
return self.listest('e0')
147-
148-
def test_et(self):
149-
return self.listest('et')
150-
151-
152-
class TestGLOFAS(TestLis):
153-
domain = 'glofas'
154-
settings_path = os.path.join(current_dir, 'data/tests_glofas.xml')
155-
156-
def test_e0(self):
157-
return self.listest('e0')
158-
159-
160-
class TestRel_Humidity_360_Cal(TestLis):
161-
domain = 'rel_humidity_360_cal'
162-
settings_path = os.path.join(current_dir, 'data/tests_rel_humidity_360_cal.xml')
163-
164-
def test_et(self):
165-
return self.listest('et')
166-
167-
def test_tair(self):
168-
return self.listest('tair')
169-
170-
171-
class TestHargreaves(TestLis):
172-
domain = 'hargreaves'
173-
settings_path = os.path.join(current_dir, 'data/tests_hargreaves.xml')
174-
175-
def test_et(self):
176-
return self.listest('et')
177-
178-
def test_tair(self):
179-
return self.listest('tair')

tests/tests_glofas.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
"""
2+
3+
Copyright 2019 European Union
4+
5+
Licensed under the EUPL, Version 1.2 or as soon they will be approved by the European Commission subsequent versions of the EUPL (the "Licence");
6+
7+
You may not use this work except in compliance with the Licence.
8+
You may obtain a copy of the Licence at:
9+
10+
https://joinup.ec.europa.eu/sites/default/files/inline-files/EUPL%20v1_2%20EN(1).txt
11+
12+
Unless required by applicable law or agreed to in writing, software distributed under the Licence is distributed on an "AS IS" basis,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the Licence for the specific language governing permissions and limitations under the Licence.
15+
16+
"""
17+
18+
import os
19+
20+
from tests import TestLis
21+
22+
current_dir = os.path.dirname(__file__)
23+
24+
25+
class TestGLOFAS(TestLis):
26+
domain = 'glofas'
27+
settings_path = os.path.join(current_dir, 'data/tests_glofas.xml')
28+
29+
def test_e0(self):
30+
return self.listest('e0')

tests/tests_hargreaves.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
"""
2+
3+
Copyright 2019 European Union
4+
5+
Licensed under the EUPL, Version 1.2 or as soon they will be approved by the European Commission subsequent versions of the EUPL (the "Licence");
6+
7+
You may not use this work except in compliance with the Licence.
8+
You may obtain a copy of the Licence at:
9+
10+
https://joinup.ec.europa.eu/sites/default/files/inline-files/EUPL%20v1_2%20EN(1).txt
11+
12+
Unless required by applicable law or agreed to in writing, software distributed under the Licence is distributed on an "AS IS" basis,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the Licence for the specific language governing permissions and limitations under the Licence.
15+
16+
"""
17+
18+
import os
19+
20+
from tests import TestLis
21+
22+
current_dir = os.path.dirname(__file__)
23+
24+
25+
class TestHargreaves(TestLis):
26+
domain = 'hargreaves'
27+
settings_path = os.path.join(current_dir, 'data/tests_hargreaves.xml')
28+
29+
def test_et(self):
30+
return self.listest('et')
31+
32+
def test_tair(self):
33+
return self.listest('tair')

tests/tests_relative_humidity.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
"""
2+
3+
Copyright 2019 European Union
4+
5+
Licensed under the EUPL, Version 1.2 or as soon they will be approved by the European Commission subsequent versions of the EUPL (the "Licence");
6+
7+
You may not use this work except in compliance with the Licence.
8+
You may obtain a copy of the Licence at:
9+
10+
https://joinup.ec.europa.eu/sites/default/files/inline-files/EUPL%20v1_2%20EN(1).txt
11+
12+
Unless required by applicable law or agreed to in writing, software distributed under the Licence is distributed on an "AS IS" basis,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the Licence for the specific language governing permissions and limitations under the Licence.
15+
16+
"""
17+
18+
import os
19+
20+
from tests import TestLis
21+
22+
current_dir = os.path.dirname(__file__)
23+
24+
25+
class TestRel_Humidity_360_Cal(TestLis):
26+
domain = 'rel_humidity_360_cal'
27+
settings_path = os.path.join(current_dir, 'data/tests_rel_humidity_360_cal.xml')
28+
29+
def test_et(self):
30+
return self.listest('et')
31+
32+
def test_tair(self):
33+
return self.listest('tair')

tests/writefiles_tests.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)