Skip to content

Commit 04abfc4

Browse files
authored
Add integration tests (#30)
* Adding integration tests, not running * Partial changes, broken * First attempt at integration tests * Rename job * Fix test name * Remove virtualenv * Fix test directory * Combine tests * Revert combining test groups to avoid broken pybamm tests
1 parent 8d80f1c commit 04abfc4

File tree

3 files changed

+63
-4
lines changed

3 files changed

+63
-4
lines changed

.github/workflows/build_wheels.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ env:
1616

1717
jobs:
1818
build_windows_wheels:
19-
name: Wheels (windows-latest)
19+
name: Wheels (Windows)
2020
runs-on: windows-latest
2121
steps:
2222
- uses: actions/checkout@v4
@@ -61,7 +61,7 @@ jobs:
6161
if-no-files-found: error
6262

6363
build_manylinux_wheels:
64-
name: Wheels (linux-amd64)
64+
name: Wheels (Linux)
6565
runs-on: ubuntu-latest
6666
steps:
6767
- uses: actions/checkout@v4
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Integration Tests
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- "main"
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
pybamm_tests:
14+
runs-on: ${{ matrix.os }}
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
os: [macos-latest]
19+
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
20+
21+
steps:
22+
- uses: actions/checkout@v4
23+
with:
24+
submodules: 'true'
25+
26+
- name: Set up Python ${{ matrix.python-version }}
27+
uses: actions/setup-python@v5
28+
with:
29+
python-version: ${{ matrix.python-version }}
30+
31+
- name: Install dependencies (MacOs)
32+
env:
33+
HOMEBREW_NO_INSTALL_CLEANUP: 1
34+
HOMEBREW_NO_AUTO_UPDATE: 1
35+
HOMEBREW_NO_COLOR: 1
36+
NONINTERACTIVE: 1
37+
run: |
38+
brew analytics off
39+
brew install libomp
40+
brew reinstall gcc
41+
42+
- name: Build and test
43+
run: |
44+
cd ..
45+
git clone https://github.com/pybamm-team/PyBaMM.git
46+
# Install PyBaMM
47+
cd PyBaMM
48+
pip install -e ".[all,dev,jax]"
49+
50+
# Replace PyBaMM solvers
51+
cd ../pybammsolvers
52+
pip uninstall pybammsolvers --yes
53+
python install_KLU_Sundials.py
54+
pip install .
55+
56+
# Run pybamm tests
57+
cd ../PyBaMM
58+
pytest tests/unit
59+
pytest tests/integration

noxfile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ def set_environment_variables(env_dict, session):
8484

8585
@nox.session(name="idaklu-requires")
8686
def run_pybamm_requires(session):
87-
"""Download, compile, and install the build-time requirements for Linux and macOS. Supports --install-dir for custom installation paths and --force to force installation."""
87+
"""Download, compile, and install the build-time requirements for Linux and macOS.
88+
Supports --install-dir for custom installation paths and --force to force installation."""
8889
set_environment_variables(PYBAMM_ENV, session=session)
8990
if sys.platform != "win32":
9091
session.run("python", "install_KLU_Sundials.py", *session.posargs)
@@ -117,7 +118,6 @@ def run_pybamm_requires(session):
117118

118119
@nox.session(name="unit")
119120
def run_unit(session):
120-
"""Run the unit tests."""
121121
set_environment_variables(PYBAMM_ENV, session=session)
122122
session.install("setuptools", silent=False)
123123
session.install("casadi", silent=False)

0 commit comments

Comments
 (0)