Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
f664dcd
Added changes from 45-only-run-the-unit-tests-which-touch-changed-cod…
max-models Oct 31, 2025
ece6661
Merge branch 'devel' into clean-45-only-run-the-unit-tests-which-touc…
max-models Nov 5, 2025
7be9d6e
Merge branch 'devel' into clean-45-only-run-the-unit-tests-which-touc…
max-models Nov 12, 2025
09e67b7
Merge branch 'devel' into clean-45-only-run-the-unit-tests-which-touc…
max-models Nov 14, 2025
23c23d6
Restored to devel
max-models Nov 14, 2025
a8958a2
Removed src/struphy/tests
max-models Nov 14, 2025
c1145d9
Removed docker/mpcdf-gcc-openmpi-with-struphy.dockerfile
max-models Nov 14, 2025
7cb0002
Reset some workflow files
max-models Nov 14, 2025
127c521
Merge branch 'devel' into clean-45-only-run-the-unit-tests-which-touc…
spossann Nov 19, 2025
8771345
add pytest-testmon to dependencies
spossann Nov 19, 2025
f41dc2c
add list of unit tests to be executed
spossann Nov 19, 2025
3cd5c5c
remove src/struphy/pic/tests/test_accumulation.py
spossann Nov 19, 2025
f562b61
dont use MPI.Abort in unit test, it doesnt work with --testmon
spossann Nov 19, 2025
7ade57e
new test sections in struphy/models: default_params and verification
spossann Nov 19, 2025
e8af8a8
remove old utilities for testing; move model tests to tests/default_p…
spossann Nov 19, 2025
1400b03
move verification test to new folder
spossann Nov 19, 2025
7159dfe
remove mpi mark restrictions for Maxwell and MHD verif tests
spossann Nov 19, 2025
7f806dc
adapt console/test.py; use --testmon-forceselect to work with pytest …
spossann Nov 19, 2025
df7b216
try PR unit tests with testmon
spossann Nov 19, 2025
eca8a0b
test PR model tests with testmon
spossann Nov 19, 2025
24732e6
Update .github/workflows/test-PR-models.yml
spossann Nov 19, 2025
281eca3
Update .github/workflows/test-PR-unit.yml
spossann Nov 19, 2025
cc8fc4c
remove multiline comments, I dont know how to comment a multiline string
spossann Nov 19, 2025
263413c
split model tests in multiple steps
spossann Nov 19, 2025
8f45fb4
try other path for .testmon file
spossann Nov 19, 2025
7c75872
Update test-PR-models.yml
max-models Nov 19, 2025
4d1de20
go back to correct path
spossann Nov 20, 2025
e78fdfa
install sqlite
spossann Nov 20, 2025
740465e
remove which python3
spossann Nov 20, 2025
f8db2b9
do not use -forceselect
spossann Nov 20, 2025
b7018c2
only run bsplines unit tests, remove -m flag from test toy
spossann Nov 20, 2025
0776733
re-add -forceselect
spossann Nov 20, 2025
774a35e
add another unit test, add -s flag to toy tests
spossann Nov 20, 2025
b70f885
add another unit test, remove -forceselect and -m
spossann Nov 20, 2025
d06a365
remove testmon data for model tests
spossann Nov 20, 2025
4ff86ba
remove the remove of testmon; test all unit
spossann Nov 20, 2025
c623fb3
add sqlite install to docker images
spossann Nov 20, 2025
d2add98
test toy twice in same step
spossann Nov 20, 2025
66dbcf7
use event-number instead of sha in cache key
spossann Nov 20, 2025
434374c
remove again -forceselect
spossann Nov 20, 2025
46459d6
remove .testmon data, try running with -forceselect
spossann Nov 20, 2025
0884e29
comment some unit tests
spossann Nov 20, 2025
9a390d7
add more unit tests, run toy twice
spossann Nov 20, 2025
daba2c6
remove restore-keys for models, ne wname for unit test cache
spossann Nov 20, 2025
e9153ee
add a unit test folder more
spossann Nov 20, 2025
1b12a2b
new cache name for model tests
spossann Nov 20, 2025
f5592cf
remove if:always for cache uploading
spossann Nov 20, 2025
b24ca96
use run-attempt in cache name, use restore-keys
spossann Nov 20, 2025
d9d867a
add unit test
spossann Nov 20, 2025
6322dcf
change to run_number
spossann Nov 20, 2025
a996652
add new unit test
spossann Nov 20, 2025
aedcc2f
remove explicit upload step (I think it is included in the default ca…
spossann Nov 20, 2025
efd55d6
check testmon data before loading cache
spossann Nov 20, 2025
f4d509b
dont use env
spossann Nov 20, 2025
16a39dc
check .testmondata after test
spossann Nov 20, 2025
7af165d
launch tests in cwd
spossann Nov 20, 2025
0501dc4
use env, run tests twice in same step
spossann Nov 20, 2025
2de8a66
add -shm and -wal files to cache
spossann Nov 20, 2025
03edaf4
add all unit tests
spossann Nov 20, 2025
5aaaeff
try solution from https://github.com/tarpas/pytest-testmon/issues/233…
spossann Nov 20, 2025
38a722f
remove model testmon files
spossann Nov 20, 2025
0406e30
remove the remove
spossann Nov 20, 2025
4d20b82
new module utils_testing.py, it removes non-test routines from test_m…
spossann Nov 21, 2025
bd2e105
forgot to add module
spossann Nov 21, 2025
dafdb6a
use cache again
spossann Nov 21, 2025
1ac2b21
comment call test
spossann Nov 21, 2025
fdef6fb
use cache again
spossann Nov 21, 2025
57679a0
in call_test, return before generate_default_param file
spossann Nov 21, 2025
4c29081
return after generate default
spossann Nov 21, 2025
b413212
return after main.run
spossann Nov 21, 2025
95a5c6a
run full call_test
spossann Nov 21, 2025
7aeb6b2
by default, do not test pproc
spossann Nov 21, 2025
0059289
return after pproc
spossann Nov 21, 2025
7ece74c
also do load data
spossann Nov 21, 2025
a5f9cf6
load cache from previous workflow
spossann Nov 21, 2025
68a2782
rm for real
spossann Nov 21, 2025
5dcbc51
remove test_folder after model test
spossann Nov 21, 2025
6aa6d77
add struphy test model
spossann Nov 21, 2025
7e03b6e
formatting
spossann Nov 21, 2025
a4a2019
add verification tests
spossann Nov 21, 2025
b3f9cd3
add MPI tests
spossann Nov 21, 2025
dafabbd
add correct envs
spossann Nov 21, 2025
406d7a8
crate testmondata-...-mpi files
spossann Nov 21, 2025
b775270
re-add mpi envs
spossann Nov 21, 2025
d564cd6
new pure python test
spossann Nov 21, 2025
2ff253b
change model base class for testing
spossann Nov 21, 2025
38a827f
add separate workflow for test with clones
spossann Nov 21, 2025
9bf4827
seed testmondata-clones
spossann Nov 21, 2025
0ef6e40
real clone tests
spossann Nov 21, 2025
a9d286b
revert models base
spossann Nov 21, 2025
fca5adb
formatting
spossann Nov 21, 2025
dc37588
remove workflow testing.yml
spossann Nov 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/actions/install/install-struphy/action.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Clone and install struphy"
name: "Install struphy in env"

inputs:
optional-deps:
Expand All @@ -12,6 +12,8 @@ runs:
- name: Install struphy
shell: bash
run: |
python3 -m venv env
source env/bin/activate
pip install --upgrade pip
pip install ".[${{ inputs.optional-deps }}]"
pip list
Expand Down
9 changes: 9 additions & 0 deletions .github/actions/tests/unit-mpi/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: "Run unit tests with MPI"

runs:
using: composite
steps:
- name: Run unit tests with MPI
shell: bash
run: |
struphy test unit --mpi 2
2 changes: 2 additions & 0 deletions .github/actions/tests/unit/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ runs:
steps:
- name: Run unit tests with MPI
shell: bash
env:
TESTMON_DATAFILE: ${{ github.workspace }}/.testmondata-${{ matrix.test-type }}
run: |
struphy compile --status
# run: |
Expand Down
74 changes: 74 additions & 0 deletions .github/workflows/test-PR-models-clones.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: PR - domain cloning in Container

on:
pull_request:
branches:
- devel
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

defaults:
run:
shell: bash

permissions:
contents: read

jobs:
model-tests-in-container-with-struphy:
runs-on: ubuntu-latest

container:
image: ghcr.io/struphy-hub/struphy/ubuntu-with-struphy:latest
credentials:
username: spossann
password: ${{ secrets.GHCR_TOKEN }}

steps:
- name: Check for dockerenv file
run: (ls /.dockerenv && echo Found dockerenv) || (echo No dockerenv)

- name: Checkout repo
uses: actions/checkout@v4

- name: Check .testmondata 1
run: |
ls .testmon* || echo "No .testmondata"

- name: Setup cache for testmon
uses: actions/cache@v4
with:
path: |
.testmondata-clones
key: testmon-clones-${{ github.event.number }}-${{ github.run_number }}
restore-keys: |
testmon-clones-${{ github.event.number }}-
testmon-clones-

- name: Check .testmondata 2
run: |
ls .testmon* || echo "No .testmondata"

# This step can be removed when the updated ghcr images are pushed
- name: Install sqlite
shell: bash
run: apt install -y sqlite3

- name: Install Struphy in Container
uses: ./.github/actions/install/struphy_in_container

- name: Compile Struphy
run: |
source /struphy_c_/env_c_/bin/activate
struphy compile

- name: Verification tests with clones
shell: bash
env:
TESTMON_DATAFILE: ${{ github.workspace }}/.testmondata-clones
run: |
source /struphy_c_/env_c_/bin/activate
struphy test verification --mpi 4 --nclones 2
77 changes: 61 additions & 16 deletions .github/workflows/test-PR-models.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,51 +20,96 @@ permissions:
jobs:
model-tests-in-container-with-struphy:
runs-on: ubuntu-latest

container:
image: ghcr.io/struphy-hub/struphy/ubuntu-with-struphy:latest
credentials:
username: spossann
password: ${{ secrets.GHCR_TOKEN }}
steps:

steps:
- name: Check for dockerenv file
run: (ls /.dockerenv && echo Found dockerenv) || (echo No dockerenv)

- name: Checkout repo
uses: actions/checkout@v4

- name: Check .testmondata 1
run: |
ls .testmon* || echo "No .testmondata"

- name: Setup cache for testmon
uses: actions/cache@v4
with:
path: |
.testmondata-model
.testmondata-model-mpi
key: testmon-model-${{ github.event.number }}-${{ github.run_number }}
restore-keys: |
testmon-model-${{ github.event.number }}-
testmon-model-

- name: Check .testmondata 2
run: |
ls .testmon* || echo "No .testmondata"

# This step can be removed when the updated ghcr images are pushed
- name: Install sqlite
shell: bash
run: apt install -y sqlite3

- name: Install Struphy in Container
uses: ./.github/actions/install/struphy_in_container

- name: Compile Struphy
run: |
which python3
source /struphy_c_/env_c_/bin/activate
which python3
struphy compile

- name: Model tests
- name: LinearMHD test
shell: bash
env:
TESTMON_DATAFILE: ${{ github.workspace }}/.testmondata-model
run: |
which python3
source /struphy_c_/env_c_/bin/activate
which python3
struphy compile --status
struphy test LinearMHD

- name: Toy test
shell: bash
env:
TESTMON_DATAFILE: ${{ github.workspace }}/.testmondata-model
run: |
source /struphy_c_/env_c_/bin/activate
struphy test toy

- name: Model tests
shell: bash
env:
TESTMON_DATAFILE: ${{ github.workspace }}/.testmondata-model
run: |
source /struphy_c_/env_c_/bin/activate
struphy test models
struphy test verification

- name: Verification tests
shell: bash
env:
TESTMON_DATAFILE: ${{ github.workspace }}/.testmondata-model
run: |
source /struphy_c_/env_c_/bin/activate
struphy test verification

- name: Model tests with MPI
shell: bash
env:
TESTMON_DATAFILE: ${{ github.workspace }}/.testmondata-model-mpi
run: |
which python3
source /struphy_c_/env_c_/bin/activate
which python3
struphy compile --status
struphy test models
struphy test models --mpi 2
struphy test verification --mpi 1
struphy test verification --mpi 4
struphy test verification --mpi 4 --nclones 2
struphy test VlasovAmpereOneSpecies --mpi 2 --nclones 2

- name: Verification tests with 2 MPI
shell: bash
env:
TESTMON_DATAFILE: ${{ github.workspace }}/.testmondata-model-mpi
run: |
source /struphy_c_/env_c_/bin/activate
struphy test verification --mpi 2
102 changes: 102 additions & 0 deletions .github/workflows/test-PR-pure-python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: PR - pure Python tests in Container

on:
pull_request:
branches:
- devel
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

defaults:
run:
shell: bash

permissions:
contents: read

jobs:
model-tests-in-container-with-reqs:
runs-on: ubuntu-latest

container:
image: ghcr.io/struphy-hub/struphy/ubuntu-with-reqs:latest
credentials:
username: spossann
password: ${{ secrets.GHCR_TOKEN }}

steps:
- name: Check for dockerenv file
run: (ls /.dockerenv && echo Found dockerenv) || (echo No dockerenv)

- name: Checkout repo
uses: actions/checkout@v4

- name: Check .testmondata 1
run: |
ls .testmon* || echo "No .testmondata"

- name: Setup cache for testmon
uses: actions/cache@v4
with:
path: |
.testmondata-pure-python
key: testmon-pure-python-${{ github.event.number }}-${{ github.run_number }}
restore-keys: |
testmon-pure-python-${{ github.event.number }}-
testmon-pure-python-

- name: Check .testmondata 2
run: |
ls .testmon* || echo "No .testmondata"

# This step can be removed when the updated ghcr images are pushed
- name: Install sqlite
shell: bash
run: apt install -y sqlite3

- name: Install Struphy
uses: ./.github/actions/install/install-struphy

- name: LinearMHD test
shell: bash
env:
TESTMON_DATAFILE: ${{ github.workspace }}/.testmondata-pure-python
run: |
source env/bin/activate
struphy compile --status
struphy test LinearMHD

- name: Vlasov test
shell: bash
env:
TESTMON_DATAFILE: ${{ github.workspace }}/.testmondata-pure-python
run: |
source env/bin/activate
struphy test Vlasov

- name: GuidingCenter test
shell: bash
env:
TESTMON_DATAFILE: ${{ github.workspace }}/.testmondata-pure-python
run: |
source env/bin/activate
struphy test GuidingCenter

- name: VlasovAmpere test
shell: bash
env:
TESTMON_DATAFILE: ${{ github.workspace }}/.testmondata-pure-python
run: |
source env/bin/activate
struphy test VlasovAmpereOneSpecies

- name: EulerSPH test
shell: bash
env:
TESTMON_DATAFILE: ${{ github.workspace }}/.testmondata-pure-python
run: |
source env/bin/activate
struphy test EulerSPH
Loading