Skip to content

Commit e254b61

Browse files
committed
Download test data for Python into central cache
1 parent acb3059 commit e254b61

File tree

4 files changed

+21
-23
lines changed

4 files changed

+21
-23
lines changed

.github/workflows/python.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,19 @@ jobs:
2323
- name: Set up Rust
2424
run: |
2525
rustup component add llvm-tools
26+
27+
- name: Get test data
28+
id: cache-test-data
29+
uses: actions/cache@v4
30+
with:
31+
path: test-data
32+
key: test-data-v20
33+
- name: Download test data
34+
if: steps.cache-test-data.outputs.cache-hit != 'true'
35+
run: |
36+
cd maintainer
37+
./download-test-data.sh
38+
2639
- name: Test
2740
env:
2841
# `-C link-dead-code` is needed to prevent 'warning: XX functions have mismatched data' warnings

.github/workflows/rust.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
uses: actions/cache@v4
2626
with:
2727
path: test-data
28-
key: test-data-v19
28+
key: test-data-v20
2929
- name: Download test data
3030
if: steps.cache-test-data.outputs.cache-hit != 'true'
3131
run: |

maintainer/download-test-data.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,12 @@ download 'https://data.nnpdf.science/pineappl/test-data/CMS_TTB_8TEV_2D_TTM_TRAP
2525
download 'https://data.nnpdf.science/pineappl/test-data/CMS_TTB_8TEV_2D_TTM_TRAP_TOT.tar'
2626
download 'https://data.nnpdf.science/pineappl/test-data/E906nlo_bin_00.pineappl.lz4'
2727
download 'https://data.nnpdf.science/pineappl/test-data/E906nlo_bin_00.tar'
28+
download 'https://data.nnpdf.science/pineappl/test-data/FKTABLE_CMSTTBARTOT8TEV-TOPDIFF8TEVTOT.pineappl.lz4'
29+
download 'https://data.nnpdf.science/pineappl/test-data/FKTABLE_STAR_WMWP_510GEV_WM-AL-POL.pineappl.lz4'
2830
download 'https://data.nnpdf.science/pineappl/test-data/FK_ATLASTTBARTOT13TEV.dat'
2931
download 'https://data.nnpdf.science/pineappl/test-data/FK_POSXDQ.dat'
32+
download 'https://data.nnpdf.science/pineappl/test-data/GRID_DYE906R_D_bin_1.pineappl.lz4'
33+
download 'https://data.nnpdf.science/pineappl/test-data/GRID_STAR_WMWP_510GEV_WP-AL-POL.pineappl.lz4'
3034
download 'https://data.nnpdf.science/pineappl/test-data/LHC8-Mtt-HT4-173_3-bin1.tab.gz'
3135
download 'https://data.nnpdf.science/pineappl/test-data/LHCBWZMU7TEV_PI_part1.appl'
3236
download 'https://data.nnpdf.science/pineappl/test-data/LHCB_DY_8TEV.pineappl.lz4'

pineappl_py/tests/conftest.py

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -198,27 +198,8 @@ def fake_grids():
198198
@pytest.fixture
199199
def download_objects(tmp_path_factory):
200200
def _download_fk(objname: str) -> None:
201-
download_dir = tmp_path_factory.mktemp("data")
202-
file_path = download_dir / f"{objname}"
203-
args = [
204-
"wget",
205-
"--no-verbose",
206-
"--no-clobber",
207-
"-P",
208-
f"{download_dir}",
209-
f"https://data.nnpdf.science/pineappl/test-data/{objname}",
210-
]
211-
212-
try:
213-
_ = subprocess.run(
214-
args,
215-
stdout=subprocess.DEVNULL,
216-
stderr=subprocess.DEVNULL,
217-
timeout=15,
218-
)
219-
return file_path
220-
except OSError as error:
221-
msg = f"Failed to execute the command {args}."
222-
raise EnvironmentError(msg) from error
201+
import os
202+
path = os.path.abspath(f"../test-data/{objname}")
203+
return path
223204

224205
return _download_fk

0 commit comments

Comments
 (0)