Skip to content

Run unit tests for user-side functions #1247

Run unit tests for user-side functions

Run unit tests for user-side functions #1247

name: Run unit tests for user-side functions
on:
workflow_run:
workflows: [Build OpenMPI cache]
types:
- completed
jobs:
unit_tests:
if: github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest
container: precice/precice:nightly
steps:
- uses: actions/checkout@v6
with:
path: micro-manager
ref: ${{ github.event.workflow_run.head_sha }}
- name: Install dependencies
run: |
apt-get -qq update
apt-get -qq install python3-dev python3-venv git pkg-config
- name: Load Cache OpenMPI 5
id: ompi-cache-load
uses: actions/cache/restore@v5
with:
path: ~/openmpi
key: openmpi-5.0.5-${{ runner.os }}-build
- name: Configure OpenMPI
run: |
if [ ! -d ~/openmpi ]; then
echo "::error::OpenMPI cache not found. The cache workflow may have failed."
exit 1
fi
cp -r ~/openmpi/* /usr/local/
ldconfig
which mpiexec
mpiexec --version
- name: Create a virtual environment and install Micro Manager in it
timeout-minutes: 6
working-directory: micro-manager
run: |
python3 -m venv .venv
. .venv/bin/activate
pip install .
- name: Run micro_manager unit test
working-directory: micro-manager
run: |
. .venv/bin/activate
pip uninstall -y pyprecice
cd tests/unit
python3 -m unittest test_micro_manager.py
- name: Run model adaptivity unit tests
working-directory: micro-manager
run: |
. .venv/bin/activate
cd tests/unit
python3 -m unittest test_model_adaptivity.py
- name: Install Micro Manager and run tasking unit test
working-directory: micro-manager
env:
OMPI_ALLOW_RUN_AS_ROOT: "1"
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: "1"
run: |
. .venv/bin/activate
cd tests/unit
python3 -m unittest test_tasking.py
- name: Install Micro Manager and run interpolation unit test
working-directory: micro-manager
run: |
. .venv/bin/activate
pip install .[sklearn]
pip uninstall -y pyprecice
cd tests/unit
python3 -m unittest test_interpolation.py
- name: Install Micro Manager and run micro simulation crash unit test
working-directory: micro-manager
run: |
. .venv/bin/activate
cd tests/unit
python3 -m unittest test_micro_simulation_crash_handling.py
- name: Install Micro Manager and run HDF5 read and write unit tests
working-directory: micro-manager/
run: |
. .venv/bin/activate
pip install .[snapshot]
pip uninstall -y pyprecice
cd tests/unit
python3 -m unittest test_hdf5_functionality.py
- name: Install Micro Manager and run snapshot_computation unit tests
working-directory: micro-manager
run: |
. .venv/bin/activate
cd tests/unit
python3 -m unittest test_snapshot_computation.py