From b2fc73479765e21f78c5de6f4078b456f59cd033 Mon Sep 17 00:00:00 2001 From: Filippo Bigi <98903385+frostedoyster@users.noreply.github.com> Date: Wed, 24 Jul 2024 18:12:05 +0200 Subject: [PATCH] Fix tests (#317) --- ...model-tests.yml => architecture-tests.yml} | 14 ++++++-- .github/workflows/gap-tests.yml | 32 ------------------- .github/workflows/pet-tests.yml | 26 --------------- .github/workflows/soap-bpnn-tests.yml | 26 --------------- .github/workflows/tests.yml | 3 +- tox.ini | 4 ++- 6 files changed, 16 insertions(+), 89 deletions(-) rename .github/workflows/{alchemical-model-tests.yml => architecture-tests.yml} (57%) delete mode 100644 .github/workflows/gap-tests.yml delete mode 100644 .github/workflows/pet-tests.yml delete mode 100644 .github/workflows/soap-bpnn-tests.yml diff --git a/.github/workflows/alchemical-model-tests.yml b/.github/workflows/architecture-tests.yml similarity index 57% rename from .github/workflows/alchemical-model-tests.yml rename to .github/workflows/architecture-tests.yml index a542ef1f2..ea35f2950 100644 --- a/.github/workflows/alchemical-model-tests.yml +++ b/.github/workflows/architecture-tests.yml @@ -1,4 +1,4 @@ -name: Alchemical Model tests +name: Architecture tests on: push: @@ -8,6 +8,14 @@ on: jobs: tests: + strategy: + matrix: + include: + - architecture-name: alchemical-model + - architecture-name: gap + - architecture-name: soap-bpnn + - architecture-name: pet + runs-on: ubuntu-22.04 steps: @@ -19,8 +27,8 @@ jobs: python-version: "3.12" - run: pip install tox - - name: run Alchemical Model tests - run: tox -e alchemical-model-tests + - name: run architecture tests + run: tox -e ${{ matrix.architecture-name }}-tests env: # Use the CPU only version of torch when building/running the code PIP_EXTRA_INDEX_URL: https://download.pytorch.org/whl/cpu diff --git a/.github/workflows/gap-tests.yml b/.github/workflows/gap-tests.yml deleted file mode 100644 index 055bd3fa4..000000000 --- a/.github/workflows/gap-tests.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: GAP tests - -on: - push: - branches: [main] - pull_request: - # Check all PR - -jobs: - tests: - runs-on: ${{ matrix.os }} - strategy: - matrix: - include: - - os: ubuntu-22.04 - python-version: "3.11" - - steps: - - uses: actions/checkout@v4 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - run: pip install tox - - - name: run SparseGAP tests - run: tox -e gap-tests - env: - # Use the CPU only version of torch when building/running the code - PIP_EXTRA_INDEX_URL: https://download.pytorch.org/whl/cpu - diff --git a/.github/workflows/pet-tests.yml b/.github/workflows/pet-tests.yml deleted file mode 100644 index d1036accc..000000000 --- a/.github/workflows/pet-tests.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: PET tests - -on: - push: - branches: [main] - pull_request: - # Check all PR - -jobs: - tests: - runs-on: ubuntu-22.04 - - steps: - - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: "3.12" - - run: pip install tox - - - name: run PET tests - run: tox -e pet-tests - env: - # Use the CPU only version of torch when building/running the code - PIP_EXTRA_INDEX_URL: https://download.pytorch.org/whl/cpu diff --git a/.github/workflows/soap-bpnn-tests.yml b/.github/workflows/soap-bpnn-tests.yml deleted file mode 100644 index 85cdddbca..000000000 --- a/.github/workflows/soap-bpnn-tests.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: SOAP-BPNN tests - -on: - push: - branches: [main] - pull_request: - # Check all PR - -jobs: - tests: - runs-on: ubuntu-22.04 - - steps: - - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: "3.12" - - run: pip install tox - - - name: run SOAP-BPNN tests - run: tox -e soap-bpnn-tests - env: - # Use the CPU only version of torch when building/running the code - PIP_EXTRA_INDEX_URL: https://download.pytorch.org/whl/cpu diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3c7d739f3..2c4db005c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -8,7 +8,6 @@ on: jobs: tests: - runs-on: ${{ matrix.os }} strategy: matrix: include: @@ -22,6 +21,8 @@ jobs: # - os: windows-2019 # python-version: "3.12" + runs-on: ${{ matrix.os }} + steps: - uses: actions/checkout@v4 diff --git a/tox.ini b/tox.ini index 08b7b09dd..45ff107b7 100644 --- a/tox.ini +++ b/tox.ini @@ -105,7 +105,7 @@ deps = extras = alchemical-model changedir = src/metatrain/experimental/alchemical_model/tests/ commands = - pytest {posargs} + ; pytest {posargs} [testenv:pet-tests] description = Run PET tests with pytest @@ -115,6 +115,8 @@ deps = extras = pet changedir = src/metatrain/experimental/pet/tests/ commands = + python -m pip uninstall -y pet + python -m pip install "pet @ git+https://github.com/spozdn/pet.git@1a470c4" --no-build-isolation pytest {posargs} [testenv:gap-tests]