Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 2 additions & 2 deletions .github/workflows/ex-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ jobs:
- name: Create example models
working-directory: modflow6-examples/autotest
# run the scripts via pytest without running the models, just build input files
run: pixi run pytest -v -n=auto --durations=0 test_scripts.py --init
run: pixi run pytest -v -n=auto --dist=worksteal --durations=0 test_scripts.py --init

- name: Make zipfile
working-directory: modflow6-examples
Expand Down Expand Up @@ -184,7 +184,7 @@ jobs:

- name: Run examples, make plots
working-directory: modflow6-examples/autotest
run: pixi run pytest -v -n=auto --durations=0 test_scripts.py --plot
run: pixi run pytest -v -n=auto --dist=worksteal --durations=0 test_scripts.py --plot

- name: Run postprocessing
working-directory: modflow6-examples/scripts
Expand Down
12 changes: 12 additions & 0 deletions autotest/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
pytest_plugins = ["modflow_devtools.fixtures", "modflow_devtools.snapshots"]

EXCLUDE = []
# slowest first, so they don't straggle at the end of parallel runs
SLOW = ["ex-gwf-sagehen", "ex-gwt-rotate", "ex-gwt-uzt-2d", "ex-gwt-hecht-mendez"]
PROJ_ROOT = Path(__file__).parents[1]
SCRIPTS_PATH = PROJ_ROOT / "scripts"
TABLES_PATH = PROJ_ROOT / "tables"
Expand Down Expand Up @@ -157,3 +159,13 @@ def pytest_generate_tests(metafunc):
if file.stem not in EXCLUDE
}
metafunc.parametrize("example_script", scripts.values(), ids=scripts.keys())


def pytest_collection_modifyitems(items):
def rank(item):
for i, name in enumerate(SLOW):
if f"[{name}.py]" in item.nodeid:
return i
return len(SLOW)

items.sort(key=rank)
Loading