-
Notifications
You must be signed in to change notification settings - Fork 5
Better modularisation #162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
jwallwork23
wants to merge
7
commits into
main
Choose a base branch
from
better-modularisation
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
e2436ac
Specific import for test_spring
jwallwork23 d29ff38
Specific import for laplacian_smoothing
jwallwork23 e2a1659
Specific imports for test_forced_movement
jwallwork23 d1e81e0
Modular workflow handling
jwallwork23 742424c
TODO
jwallwork23 245df41
Fix docker image and core workflow name
jwallwork23 86d23c4
Loop over test files
jwallwork23 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
name: 'Core tests' | ||
|
||
on: | ||
# Run tests whenever commits modifying relevant files are pushed to an open PR | ||
pull_request: | ||
paths: | ||
- 'movement/math.py' | ||
- 'movement/monitor.py' | ||
- 'movement/tangling.py' | ||
- 'test/test_math.py' | ||
- 'test/test_monitor.py' | ||
- 'test/test_tangling.py' | ||
- '.github/workflows/test_core.yml' | ||
- 'pyproject.toml' | ||
|
||
# Cancel jobs running if new commits are pushed | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
test_suite: | ||
name: 'Test suite' | ||
runs-on: ubuntu-latest | ||
container: | ||
image: ghcr.io/mesh-adaptation/firedrake-parmmg:latest | ||
options: --user root | ||
env: | ||
TESTS: 'test/test_math.py test/test_monitor.py test/test_tangling.py' | ||
# Allow executing mpiexec as root | ||
OMPI_ALLOW_RUN_AS_ROOT: '1' | ||
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: '1' | ||
# Since we are root we need to set PYTHONPATH to find the installed packages | ||
PYTHONPATH: /home/firedrake/firedrake:/home/firedrake/movement:/home/firedrake/.local/lib/python3.12/site-packages | ||
|
||
steps: | ||
- name: 'Check out the repo' | ||
id: checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
|
||
- name: 'Install package' | ||
run: pip install --break-system-packages -e .[dev] | ||
|
||
- name: 'Run serial tests' | ||
run: | | ||
python3 $(which firedrake-clean) | ||
for TEST in ${TESTS}; do | ||
python3 -m pytest -v -k "parallel[1] or not parallel" "${TEST}" | ||
done | ||
|
||
- name: 'Run parallel tests (nprocs = 2)' | ||
run: | | ||
for TEST in ${TESTS}; do | ||
if pytest --collect-only -m parallel[2] "${TEST}" | grep -q 'no tests collected'; then | ||
echo "No parallel[2] tests found." | ||
else | ||
mpiexec -n 2 python3 -m pytest -v -m parallel[2] "${TEST}" | ||
fi | ||
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
name: 'Run Movement coverage test suite' | ||
|
||
on: | ||
# Run test suite every Sunday at 1AM | ||
schedule: | ||
- cron: '0 1 * * 0' | ||
|
||
jobs: | ||
test_suite: | ||
uses: mesh-adaptation/docs/.github/workflows/reusable_test_suite.yml@main |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: 'Integration test suite' | ||
|
||
on: | ||
# Run demo tests whenever commits are pushed to an open PR | ||
pull_request: | ||
paths: | ||
- '**.py' | ||
- '.github/workflows/test_demos.yml' | ||
- 'pyproject.toml' | ||
|
||
# Cancel jobs running if new commits are pushed | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
test_suite: | ||
name: 'Test suite' | ||
runs-on: ubuntu-latest | ||
container: | ||
image: ghcr.io/mesh-adaptation/firedrake-parmmg:latest | ||
options: --user root | ||
env: | ||
# Allow executing mpiexec as root | ||
OMPI_ALLOW_RUN_AS_ROOT: '1' | ||
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: '1' | ||
# Since we are root we need to set PYTHONPATH to find the installed packages | ||
PYTHONPATH: /home/firedrake/firedrake:/home/firedrake/movement:/home/firedrake/.local/lib/python3.12/site-packages | ||
|
||
steps: | ||
- name: 'Check out the repo' | ||
id: checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
|
||
- name: 'Install package' | ||
run: pip install --break-system-packages -e .[dev] | ||
|
||
- name: 'Run serial tests' | ||
run: | | ||
python3 $(which firedrake-clean) | ||
python3 -m pytest -v -k "parallel[1] or not parallel" test/test_demos.py | ||
|
||
- name: 'Run parallel tests (nprocs = 2)' | ||
run: | | ||
if pytest --collect-only -m parallel[2] test/test_demos.py | grep -q 'no tests collected'; then | ||
echo "No parallel[2] tests found." | ||
else | ||
mpiexec -n 2 python3 -m pytest -v -m parallel[2] test/test_demos.py | ||
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: 'Laplacian smoothing tests' | ||
|
||
on: | ||
# Run tests whenever commits modifying relevant files are pushed to an open PR | ||
pull_request: | ||
paths: | ||
- 'movement/laplacian_smoothing.py' | ||
- 'test/test_forced_movement.py' | ||
- 'test/test_laplacian_smoothing.py' | ||
- '.github/workflows/test_laplacian_smoothing.yml' | ||
- 'pyproject.toml' | ||
|
||
# Cancel jobs running if new commits are pushed | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
test_suite: | ||
name: 'Test suite' | ||
runs-on: ubuntu-latest | ||
container: | ||
image: ghcr.io/mesh-adaptation/firedrake-parmmg:latest | ||
options: --user root | ||
env: | ||
TESTS: 'test/test_forced_movement.py test/test_laplacian_smoothing.py' | ||
# Allow executing mpiexec as root | ||
OMPI_ALLOW_RUN_AS_ROOT: '1' | ||
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: '1' | ||
# Since we are root we need to set PYTHONPATH to find the installed packages | ||
PYTHONPATH: /home/firedrake/firedrake:/home/firedrake/movement:/home/firedrake/.local/lib/python3.12/site-packages | ||
|
||
steps: | ||
- name: 'Check out the repo' | ||
id: checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
|
||
- name: 'Install package' | ||
run: pip install --break-system-packages -e .[dev] | ||
|
||
- name: 'Run serial tests' | ||
run: | | ||
python3 $(which firedrake-clean) | ||
for TEST in ${TESTS}; do | ||
python3 -m pytest -v -k "parallel[1] or not parallel" "${TEST}" | ||
done | ||
|
||
- name: 'Run parallel tests (nprocs = 2)' | ||
run: | | ||
for TEST in ${TESTS}; do | ||
if pytest --collect-only -m parallel[2] "${TEST}" | grep -q 'no tests collected'; then | ||
echo "No parallel[2] tests found." | ||
else | ||
mpiexec -n 2 python3 -m pytest -v -m parallel[2] "${TEST}" | ||
fi | ||
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: 'Monge-Ampere tests' | ||
|
||
on: | ||
# Run tests whenever commits modifying relevant files are pushed to an open PR | ||
pull_request: | ||
paths: | ||
- 'movement/monge_ampere.py' | ||
- 'test/test_monge_ampere.py' | ||
- '.github/workflows/test_monge_ampere.yml' | ||
- 'pyproject.toml' | ||
|
||
# Cancel jobs running if new commits are pushed | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
test_suite: | ||
name: 'Test suite' | ||
runs-on: ubuntu-latest | ||
container: | ||
image: ghcr.io/mesh-adaptation/firedrake-parmmg:latest | ||
options: --user root | ||
env: | ||
TESTS: 'test/test_monge_ampere.py' | ||
# Allow executing mpiexec as root | ||
OMPI_ALLOW_RUN_AS_ROOT: '1' | ||
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: '1' | ||
# Since we are root we need to set PYTHONPATH to find the installed packages | ||
PYTHONPATH: /home/firedrake/firedrake:/home/firedrake/movement:/home/firedrake/.local/lib/python3.12/site-packages | ||
|
||
steps: | ||
- name: 'Check out the repo' | ||
id: checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
|
||
- name: 'Install package' | ||
run: pip install --break-system-packages -e .[dev] | ||
|
||
- name: 'Run serial tests' | ||
run: | | ||
python3 $(which firedrake-clean) | ||
for TEST in ${TESTS}; do | ||
python3 -m pytest -v -k "parallel[1] or not parallel" "${TEST}" | ||
done | ||
|
||
- name: 'Run parallel tests (nprocs = 2)' | ||
run: | | ||
for TEST in ${TESTS}; do | ||
if pytest --collect-only -m parallel[2] "${TEST}" | grep -q 'no tests collected'; then | ||
echo "No parallel[2] tests found." | ||
else | ||
mpiexec -n 2 python3 -m pytest -v -m parallel[2] "${TEST}" | ||
fi | ||
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: 'Spring-based tests' | ||
|
||
on: | ||
# Run tests whenever commits modifying relevant files are pushed to an open PR | ||
pull_request: | ||
paths: | ||
- 'movement/laplacian_smoothing.py' | ||
- 'test/test_forced_movement.py' | ||
- 'test/test_spring.py' | ||
- '.github/workflows/test_spring.yml' | ||
- 'pyproject.toml' | ||
|
||
# Cancel jobs running if new commits are pushed | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
test_suite: | ||
name: 'Test suite' | ||
runs-on: ubuntu-latest | ||
container: | ||
image: ghcr.io/mesh-adaptation/firedrake-parmmg:latest | ||
options: --user root | ||
env: | ||
TESTS: 'test/test_forced_movement.py test/test_spring.py' | ||
# Allow executing mpiexec as root | ||
OMPI_ALLOW_RUN_AS_ROOT: '1' | ||
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: '1' | ||
# Since we are root we need to set PYTHONPATH to find the installed packages | ||
PYTHONPATH: /home/firedrake/firedrake:/home/firedrake/movement:/home/firedrake/.local/lib/python3.12/site-packages | ||
|
||
steps: | ||
- name: 'Check out the repo' | ||
id: checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
|
||
- name: 'Install package' | ||
run: pip install --break-system-packages -e .[dev] | ||
|
||
- name: 'Run serial tests' | ||
run: | | ||
python3 $(which firedrake-clean) | ||
for TEST in ${TESTS}; do | ||
python3 -m pytest -v -k "parallel[1] or not parallel" "${TEST}" | ||
done | ||
|
||
- name: 'Run parallel tests (nprocs = 2)' | ||
run: | | ||
for TEST in ${TESTS}; do | ||
if pytest --collect-only -m parallel[2] "${TEST}" | grep -q 'no tests collected'; then | ||
echo "No parallel[2] tests found." | ||
else | ||
mpiexec -n 2 python3 -m pytest -v -m parallel[2] "${TEST}" | ||
fi | ||
done |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please clarify why you're looping over individual tests, instead of just running them all at once with
python3 -m pytest -v -k "parallel[1] or not parallel" ${TESTS}
? Same elsewhere.