Skip to content

Commit

Permalink
Improve assets script and attempt pytest fix
Browse files Browse the repository at this point in the history
  • Loading branch information
felixhekhorn committed Jan 10, 2025
1 parent 3ee5efb commit 17033fc
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 13 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/unittests-rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ jobs:
- name: Download test data
if: steps.cache-test-data.outputs.cache-hit != 'true'
run: |
cd crates/dekoder/tests/data
./download.sh
./test/data/assets.sh
- uses: actions/setup-python@v5
- name: Install task runner
run: pip install poethepoet
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,22 @@ name: Python unit tests
on: push

jobs:
data:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Get test data
id: cache-test-data
uses: actions/cache@v4
with:
path: test-data
key: test-data-v1
- name: Download test data
if: steps.cache-test-data.outputs.cache-hit != 'true'
run: |
./test/data/assets.sh
test:
needs: data
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
Expand Down
3 changes: 0 additions & 3 deletions crates/dekoder/tests/data/download.sh

This file was deleted.

8 changes: 0 additions & 8 deletions download-test-assets.sh

This file was deleted.

17 changes: 17 additions & 0 deletions tests/data/assets.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/bash
# upload: scp v0.15.tar [email protected]:WEB/eko/test-data

# Server path
URL="https://data.nnpdf.science/eko/test-data/"
# local paths
PYDATADIR="tests/data/"
RUSTDATADIR="crates/dekoder/tests/data/"

# download from the server
curl -s -C - -o "./${PYDATADIR}v0.13.tar" "${URL}ekov013.tar"
curl -s -C - -o "./${PYDATADIR}v0.14.tar" "${URL}ekov014.tar"
curl -s -C - -o "./${PYDATADIR}v0.15.tar" "${URL}v0.15.tar"
# expose to Rust
if [ ! -f "./${RUSTDATADIR}v0.15.tar" ]; then
ln -s "./../../../../${PYDATADIR}v0.15.tar" "./${RUSTDATADIR}"
fi

0 comments on commit 17033fc

Please sign in to comment.