Skip to content

Commit

Permalink
test(distribution): use no_parallel marker for dist tests, update pix…
Browse files Browse the repository at this point in the history
…i.lock (#1724)

* use no_parallel marker in distribution tests
* upgrade modflow-devtools and flopy for pixi
  • Loading branch information
wpbonelli authored Apr 12, 2024
1 parent b2b9c47 commit 4a08efc
Show file tree
Hide file tree
Showing 6 changed files with 194 additions and 158 deletions.
6 changes: 5 additions & 1 deletion distribution/build_dist.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import pytest
from modflow_devtools.build import meson_build
from modflow_devtools.download import download_and_unzip, get_release
from modflow_devtools.markers import requires_exe
from modflow_devtools.markers import no_parallel, requires_exe
from modflow_devtools.misc import get_model_paths

from build_docs import build_documentation
Expand Down Expand Up @@ -84,6 +84,7 @@ def copy_sources(output_path: PathLike):
copytree(src_path, dst_path, ignore=ignore_patterns(*ignored))


@no_parallel
def test_copy_sources(tmp_path):
copy_sources(tmp_path)

Expand Down Expand Up @@ -202,6 +203,7 @@ def build_programs_meson(
print(f"Execute permission set for {target}")


@no_parallel
def test_build_programs_meson(tmp_path):
build_programs_meson(tmp_path / "builddir", tmp_path / "bin")

Expand Down Expand Up @@ -245,6 +247,7 @@ def build_makefiles(output_path: PathLike):
)


@no_parallel
def test_build_makefiles(tmp_path):
build_makefiles(tmp_path)

Expand Down Expand Up @@ -307,6 +310,7 @@ def build_distribution(
)


@no_parallel
@requires_exe("pdflatex")
@pytest.mark.skip(reason="manual testing")
@pytest.mark.parametrize("full", [True, False])
Expand Down
9 changes: 8 additions & 1 deletion distribution/build_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
get_release,
list_artifacts,
)
from modflow_devtools.markers import requires_exe, requires_github
from modflow_devtools.markers import no_parallel, requires_exe, requires_github
from modflow_devtools.misc import is_in_ci, run_cmd, set_dir

from benchmark import run_benchmarks
Expand Down Expand Up @@ -141,6 +141,7 @@ def github_user() -> Optional[str]:


@flaky
@no_parallel
@requires_github
def test_download_benchmarks(tmp_path, github_user):
path = download_benchmarks(
Expand Down Expand Up @@ -189,6 +190,7 @@ def build_benchmark_tex(


@flaky
@no_parallel
@requires_github
def test_build_benchmark_tex(tmp_path):
benchmarks_path = _benchmarks_dir_path / "run-time-comparison.md"
Expand Down Expand Up @@ -266,6 +268,7 @@ def files_match(tex_path, dfn_path, ignored):
assert files_match(tex_pth, dfn_pth, ignored)


@no_parallel
@pytest.mark.parametrize("overwrite", [True, False])
def test_build_mf6io_tex_from_dfn(overwrite):
mf6ivar_path = _project_root_path / "doc" / "mf6io" / "mf6ivar"
Expand Down Expand Up @@ -311,6 +314,7 @@ def build_tex_folder_structure(overwrite: bool = False):
assert path.is_file(), f"Failed to create {path}"


@no_parallel
def test_build_tex_folder_structure():
path = _project_root_path / "doc" / "ReleaseNotes" / "folder_struct.tex"
try:
Expand Down Expand Up @@ -384,6 +388,7 @@ def build_mf6io_tex_example(
f.write("}\n")


@no_parallel
@pytest.mark.skip(reason="todo")
def test_build_mf6io_tex_example():
pass
Expand Down Expand Up @@ -439,6 +444,7 @@ def build_pdfs_from_tex(
built_paths.add(tgt_path)


@no_parallel
@requires_exe("pdflatex")
def test_build_pdfs_from_tex(tmp_path):
tex_paths = [
Expand Down Expand Up @@ -540,6 +546,7 @@ def build_documentation(
assert (output_path / "mf6examples.pdf").is_file()


@no_parallel
@requires_exe("pdflatex")
# skip if in CI so we don't have to build/process example models,
# example model docs can be tested in the modflow6-examples repo
Expand Down
8 changes: 7 additions & 1 deletion distribution/build_makefiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import pymake
import pytest
from flaky import flaky
from modflow_devtools.markers import requires_exe
from modflow_devtools.markers import no_parallel, requires_exe
from modflow_devtools.misc import set_dir

from utils import get_modified_time, get_project_root_path
Expand Down Expand Up @@ -104,6 +104,7 @@ def build_mf5to6_makefile():


@flaky
@no_parallel
@pytest.mark.skipif(FC == "ifort", reason=_fc_reason)
def test_build_mf6_makefile():
makefile_paths = [
Expand All @@ -124,6 +125,7 @@ def test_build_mf6_makefile():


@flaky
@no_parallel
@pytest.mark.skipif(FC == "ifort", reason=_fc_reason)
def test_build_zbud6_makefile():
util_path = _project_root_path / "utils" / "zonebudget"
Expand All @@ -145,6 +147,7 @@ def test_build_zbud6_makefile():


@flaky
@no_parallel
@pytest.mark.skipif(FC == "ifort", reason=_fc_reason)
def test_build_mf5to6_makefile():
util_path = _project_root_path / "utils" / "mf5to6"
Expand All @@ -166,6 +169,7 @@ def test_build_mf5to6_makefile():


@flaky
@no_parallel
@requires_exe("make")
@pytest.mark.skipif(FC == "ifort", reason=_fc_reason)
def test_build_mf6_with_make():
Expand All @@ -185,6 +189,7 @@ def test_build_mf6_with_make():


@flaky
@no_parallel
@requires_exe("make")
@pytest.mark.skipif(FC == "ifort", reason=_fc_reason)
def test_build_zbud6_with_make():
Expand All @@ -204,6 +209,7 @@ def test_build_zbud6_with_make():


@flaky
@no_parallel
@requires_exe("make")
@pytest.mark.skipif(FC == "ifort", reason=_fc_reason)
def test_build_mf5to6_with_make():
Expand Down
9 changes: 9 additions & 0 deletions distribution/check_dist.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

import pytest

from modflow_devtools.markers import no_parallel


# OS-specific extensions
_system = platform.system()
Expand Down Expand Up @@ -66,11 +68,13 @@ def skip():
return path


@no_parallel
def test_directories(dist_dir_path, full):
for dir_path in _included_dir_paths["full" if full else "minimal"]:
assert (dist_dir_path / dir_path).is_dir()


@no_parallel
def test_sources(dist_dir_path, releasemode, full):
if not full:
pytest.skip(reason="sources not included in minimal distribution")
Expand Down Expand Up @@ -102,6 +106,7 @@ def test_sources(dist_dir_path, releasemode, full):
assert not (dist_dir_path / "utils" / "idmloader").is_dir()


@no_parallel
@pytest.mark.skipif(not _fc, reason="needs Fortran compiler")
def test_makefiles(dist_dir_path, full):
if not full:
Expand Down Expand Up @@ -129,6 +134,7 @@ def test_makefiles(dist_dir_path, full):
)


@no_parallel
def test_msvs(dist_dir_path, full):
if not full:
pytest.skip(reason="MSVS files not included in minimal distribution")
Expand All @@ -140,6 +146,7 @@ def test_msvs(dist_dir_path, full):
assert (dist_dir_path / "msvs" / "mf6core.vfproj").is_file()


@no_parallel
def test_docs(dist_dir_path, full):
# mf6io should always be included
assert (dist_dir_path / "doc" / "mf6io.pdf").is_file()
Expand All @@ -163,6 +170,7 @@ def test_docs(dist_dir_path, full):
assert (dist_dir_path / "doc" / f"{pub}.pdf").is_file()


@no_parallel
def test_examples(dist_dir_path, full):
if not full:
pytest.skip(reason="examples not included in minimal distribution")
Expand All @@ -183,6 +191,7 @@ def test_examples(dist_dir_path, full):
break


@no_parallel
def test_binaries(dist_dir_path, approved):
bin_path = dist_dir_path / "bin"
assert (bin_path / f"mf6{_eext}").is_file()
Expand Down
4 changes: 4 additions & 0 deletions distribution/update_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@

from utils import get_modified_time

from modflow_devtools.markers import no_parallel


project_name = "MODFLOW 6"
project_root_path = Path(__file__).resolve().parent.parent
version_file_path = project_root_path / "version.txt"
Expand Down Expand Up @@ -377,6 +380,7 @@ def update_version(
_current_version = Version(version_file_path.read_text().strip())


@no_parallel
@pytest.mark.skip(reason="reverts repo files on cleanup, tread carefully")
@pytest.mark.parametrize(
"version",
Expand Down
Loading

0 comments on commit 4a08efc

Please sign in to comment.