diff --git a/.github/common/download-examples.sh b/.github/common/download-examples.sh deleted file mode 100755 index 9a8b444c..00000000 --- a/.github/common/download-examples.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -cd autotest -python ci_setup.py -cd .. - diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ac5cf265..947ddf95 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -42,20 +42,21 @@ jobs: .github/common/install-python.sh - name: Download examples for pytest runs + working-directory: ./autotest run: | - .github/common/download-examples.sh + pytest -v -n=auto -m="base or regression" --durations=0 ci_setup.py - name: test on Linux if: runner.os == 'Linux' working-directory: ./autotest run: | - pytest -v -n=auto --dist=loadfile -m="base or regression" --durations=0 --cov=pymake --cov-report=xml + pytest -v -n=auto -m="base or regression" --durations=0 --cov=pymake --cov-report=xml - name: test on MacOS if: runner.os == 'macOS' working-directory: ./autotest run: | - pytest -v -n=auto --dist=loadfile -m="base" --durations=0 --cov=pymake --cov-report=xml + pytest -v -n=auto -m="base" --durations=0 --cov=pymake --cov-report=xml - name: test on Windows if: runner.os == 'Windows' diff --git a/.github/workflows/pymake-gcc.yml b/.github/workflows/pymake-gcc.yml index 0ac85a7b..9cb0e03e 100644 --- a/.github/workflows/pymake-gcc.yml +++ b/.github/workflows/pymake-gcc.yml @@ -42,13 +42,14 @@ jobs: uses: modflowpy/install-gfortran-action@v1 - name: Download examples for pytest runs + working-directory: ./autotest run: | - .github/common/download-examples.sh + pytest -v -n=auto -m="regression" --durations=0 ci_setup.py - name: Run pytest working-directory: ./autotest run: | - pytest -v --dist=loadfile -n=auto -m="base or regression" --durations=0 --cov=pymake --cov-report=xml + pytest -v -n=auto -m="base or regression" --durations=0 --cov=pymake --cov-report=xml - name: Print coverage report before upload working-directory: ./autotest @@ -100,13 +101,14 @@ jobs: g++ --version - name: Download examples for pytest runs + working-directory: ./autotest run: | - .github/common/download-examples.sh + pytest -v -n=auto -m="base" --durations=0 ci_setup.py - name: Run pytest working-directory: ./autotest run: | - pytest -v --dist=loadfile -n=auto -m="base" --durations=0 --cov=pymake --cov-report=xml + pytest -v -n=auto -m="base" --durations=0 --cov=pymake --cov-report=xml - name: Print coverage report before upload working-directory: ./autotest @@ -152,4 +154,4 @@ jobs: - name: Run pytest working-directory: ./autotest run: | - pytest -v --dist=loadfile -n=auto -m="base" --durations=0 + pytest -v -n=auto -m="base" --durations=0 diff --git a/autotest/ci_setup.py b/autotest/ci_setup.py index ef260774..a10b22d3 100644 --- a/autotest/ci_setup.py +++ b/autotest/ci_setup.py @@ -1,7 +1,13 @@ import os import shutil +import pytest +from flaky import flaky + import pymake +from autotest.conftest import get_pymake_appdir + +RERUNS = 3 temp_pth = "temp" if not os.path.exists(temp_pth): @@ -10,6 +16,8 @@ if os.path.isdir(mf6_exdir): shutil.rmtree(mf6_exdir) +targets = ["mf6"] + def download_mf6_examples(verbose=False): """Download mf6 examples and return location of folder""" @@ -84,6 +92,25 @@ def examples_list(verbose=False): return -if __name__ == "__main__": +@flaky(max_runs=RERUNS) +@pytest.mark.regression +def test_initialize(): mf6pth = download_mf6_examples(verbose=True) examples_list(verbose=True) + + +@flaky(max_runs=RERUNS) +@pytest.mark.regression +@pytest.mark.parametrize("target", targets) +def test_build_apps(function_tmpdir, target): + assert ( + pymake.build_apps( + target, + verbose=True, + clean=True, + workingdir=function_tmpdir, + meson=True, + appdir=get_pymake_appdir(), + ) + == 0 + ), f"could not compile {target}" diff --git a/autotest/conftest.py b/autotest/conftest.py index 655d39a9..5df2876b 100644 --- a/autotest/conftest.py +++ b/autotest/conftest.py @@ -1,10 +1,10 @@ +import contextlib +import os import re from importlib import metadata from pathlib import Path -import matplotlib.pyplot as plt import pytest -from modflow_devtools.misc import is_in_ci # import modflow-devtools fixtures @@ -15,6 +15,21 @@ # misc utilities +@contextlib.contextmanager +def working_directory(path): + """Changes working directory and returns to previous on exit.""" + prev_cwd = os.getcwd() + os.chdir(path) + try: + yield + finally: + os.chdir(prev_cwd) + + +def get_pymake_appdir(): + appdir = Path.home() / ".pymake" + appdir.mkdir(parents=True, exist_ok=True) + return appdir def get_project_root_path() -> Path: diff --git a/autotest/test_build.py b/autotest/test_build.py index 63636970..36bebbee 100644 --- a/autotest/test_build.py +++ b/autotest/test_build.py @@ -1,4 +1,3 @@ -import contextlib import os import sys import time @@ -7,30 +6,28 @@ from flaky import flaky import pymake +from autotest.conftest import working_directory RERUNS = 3 targets = pymake.usgs_program_data.get_keys(current=True) -targets_make = pymake.usgs_program_data.get_keys(current=True) -for target in targets_make: - if target in ("triangle", "libmf6", "gridgen", "mf2000", "mflgr", "swtv4"): - targets_make.remove(target) - - -@contextlib.contextmanager -def working_directory(path): - """Changes working directory and returns to previous on exit.""" - prev_cwd = os.getcwd() - os.chdir(path) - try: - yield - finally: - os.chdir(prev_cwd) +targets_make = [ + t + for t in pymake.usgs_program_data.get_keys(current=True) + if t + not in ( + "triangle", + "libmf6", + "gridgen", + "mf2000", + "mflgr", + "swtv4", + ) +] def build_with_makefile(target, path, fc): success = True - errmsg = "" with working_directory(path): if os.path.isfile("makefile"): # wait to delete on windows diff --git a/autotest/test_gridgen.py b/autotest/test_gridgen_run.py similarity index 97% rename from autotest/test_gridgen.py rename to autotest/test_gridgen_run.py index 61b3f3e1..e7483b11 100644 --- a/autotest/test_gridgen.py +++ b/autotest/test_gridgen_run.py @@ -112,7 +112,7 @@ def run_gridgen(cmd): return success -@pytest.mark.base +@pytest.mark.skip @flaky(max_runs=RERUNS) def test_download(): # Remove the existing target download directory if it exists @@ -124,18 +124,18 @@ def test_download(): assert pm.download, f"could not download {target} distribution" -@pytest.mark.base +@pytest.mark.skip def test_compile(): assert pm.build() == 0, f"could not compile {target}" -@pytest.mark.regression +@pytest.mark.skip @pytest.mark.parametrize("cmd", biscayne_cmds) def test_gridgen(cmd): assert run_gridgen(cmd), f"could not run {cmd}" -@pytest.mark.base +@pytest.mark.skip def test_clean_up(): clean_up() diff --git a/autotest/test_gsflow.py b/autotest/test_gsflow_run.py similarity index 87% rename from autotest/test_gsflow.py rename to autotest/test_gsflow_run.py index 6374b553..6b374f26 100644 --- a/autotest/test_gsflow.py +++ b/autotest/test_gsflow_run.py @@ -1,5 +1,3 @@ -import sys - import flopy import pytest from flaky import flaky @@ -11,8 +9,6 @@ # define program data target = "gsflow" -if sys.platform.lower() == "win32": - target += ".exe" # get program dictionary prog_dict = pymake.usgs_program_data.get_target(target) @@ -94,22 +90,11 @@ def run_gsflow(exe, path, example, control_file, normal_message): return success -@pytest.mark.base -@flaky(max_runs=RERUNS) -def test_gsflow_build(function_tmpdir): - pm.appdir = function_tmpdir - pm.download_target(target, download_path=function_tmpdir) - assert pm.download, f"could not download {target} distribution" - assert pm.build() == 0, f"could not compile {target}" - - @pytest.mark.regression @flaky(max_runs=RERUNS) def test_gsflow_build_run(function_tmpdir): - pm.appdir = function_tmpdir pm.download_target(target, download_path=function_tmpdir) assert pm.download, f"could not download {target} distribution" - assert pm.build() == 0, f"could not compile {target}" example_path = function_tmpdir / f"{prog_dict.dirname}/data" assert modify_examples(example_path) for example, control_file, msg in examples: diff --git a/autotest/test_mf2005.py b/autotest/test_mf2005_run.py similarity index 97% rename from autotest/test_mf2005.py rename to autotest/test_mf2005_run.py index d9a6ce61..266c4ac4 100644 --- a/autotest/test_mf2005.py +++ b/autotest/test_mf2005_run.py @@ -116,7 +116,7 @@ def cleanup(): return -@pytest.mark.base +@pytest.mark.skip def test_download(): # Remove the existing target download directory if it exists if os.path.isdir(mfpth): @@ -127,19 +127,19 @@ def test_download(): assert pm.download, f"could not download {target}" -@pytest.mark.base +@pytest.mark.skip def test_compile(): assert pm.build() == 0, f"could not compile {target}" -@pytest.mark.regression +@pytest.mark.skip @pytest.mark.parametrize("fn", name_files) def test_mf2005(fn): run_mf2005(fn) return -@pytest.mark.base +@pytest.mark.skip def test_cleanup(): cleanup() diff --git a/autotest/test_mf6.py b/autotest/test_mf6.py deleted file mode 100644 index 6f59b0d3..00000000 --- a/autotest/test_mf6.py +++ /dev/null @@ -1,216 +0,0 @@ -import contextlib -import os -import shutil -import sys -import time - -import flopy -import pytest - -import pymake - -# define program data -target = "mf6" -if sys.platform.lower() == "win32": - target += ".exe" - -sharedobject_target = "libmf6" -if sys.platform.lower() == "win32": - sharedobject_target += ".dll" -elif sys.platform.lower() == "darwin": - sharedobject_target += ".dylib" -else: - sharedobject_target += ".so" - -# get program dictionary -prog_dict = pymake.usgs_program_data.get_target(target) - -# set up paths -dstpth = os.path.join(f"temp_{os.path.basename(__file__).replace('.py', '')}") -if not os.path.exists(dstpth): - os.makedirs(dstpth, exist_ok=True) - -mf6ver = prog_dict.version -mf6pth = os.path.join(dstpth, prog_dict.dirname) -epth = os.path.join(dstpth, target) - -# set fpth based on current path -if os.path.basename(os.path.normpath(os.getcwd())) == "autotest": - fpth = os.path.abspath( - os.path.join("temp", "mf6examples", "mf6examples.txt") - ) -else: - fpth = os.path.abspath( - os.path.join("autotest", "temp", "mf6examples", "mf6examples.txt") - ) -if os.path.isfile(fpth): - with open(fpth) as f: - lines = f.read().splitlines() - sim_dirs = [line for line in lines if len(line) > 0] -else: - sim_dirs = [] - -pm = pymake.Pymake(verbose=True) -pm.target = target -pm.appdir = dstpth -pm.makefile = True -pm.makeclean = True -pm.makefiledir = dstpth -pm.inplace = True -pm.networkx = True - - -@contextlib.contextmanager -def working_directory(path): - """Changes working directory and returns to previous on exit.""" - prev_cwd = os.getcwd() - os.chdir(path) - try: - yield - finally: - os.chdir(prev_cwd) - - -def build_with_makefile(makefile_target): - success = False - with working_directory(dstpth): - if os.path.isfile("makefile"): - # wait to delete on windows - if sys.platform.lower() == "win32": - time.sleep(6) - - # clean prior to make - print(f"clean {makefile_target} with makefile") - os.system("make clean") - - # build MODFLOW 6 with makefile - print(f"build {makefile_target} with makefile") - return_code = os.system("make") - - # test if running on Windows with ifort, if True the makefile - # should fail - if sys.platform.lower() == "win32" and pm.fc == "ifort": - if return_code != 0: - success = True - else: - success = False - # verify that target was made - else: - success = os.path.isfile(makefile_target) - - return success - - -def clean_up(): - # clean up makefile - print("Removing makefile") - files = [ - os.path.join(dstpth, file_name) - for file_name in ("makefile", "makedefaults") - ] - for fpth in files: - if os.path.isfile(fpth): - os.remove(fpth) - - # finalize pymake object - pm.finalize() - - if os.path.isfile(epth): - print("Removing " + target) - os.remove(epth) - - print("Removing temporary build directories") - dirs_temp = [dstpth] - for d in dirs_temp: - if os.path.isdir(d): - shutil.rmtree(d) - return - - -def run_mf6(workspace): - success = False - exe_name = os.path.abspath(epth) - if os.path.exists(exe_name): - # run test models - print(f"running model...{os.path.basename(workspace)}") - success, buff = flopy.run_model( - exe_name, None, model_ws=workspace, silent=False - ) - return success - - -@pytest.mark.dependency(name="download") -@pytest.mark.base -def test_download(): - # Remove the existing mf6 directory if it exists - if os.path.isdir(mf6pth): - shutil.rmtree(mf6pth) - - # download the modflow 6 release - pm.download_target(target, download_path=dstpth) - assert pm.download, f"could not download {target} distribution" - - -@pytest.mark.dependency(name="build", depends=["download"]) -@pytest.mark.base -def test_compile(): - assert pm.build() == 0, f"could not compile {target}" - - -@pytest.mark.dependency(name="test", depends=["build"]) -@pytest.mark.regression -@pytest.mark.parametrize("ws", sim_dirs) -def test_mf6(ws): - assert run_mf6(ws), f"could not run {ws}" - - -@pytest.mark.dependency(name="makefile", depends=["build"]) -@pytest.mark.base -def test_makefile(): - assert build_with_makefile( - target - ), f"could not compile {target} with makefile" - - -@pytest.mark.dependency(name="shared", depends=["makefile"]) -@pytest.mark.base -def test_sharedobject(): - pm.target = sharedobject_target - prog_dict = pymake.usgs_program_data.get_target(pm.target) - pm.appdir = dstpth - pm.srcdir = os.path.join(mf6pth, prog_dict.srcdir) - pm.srcdir2 = os.path.join(mf6pth, "src") - pm.excludefiles = [os.path.join(pm.srcdir2, "mf6.f90")] - pm.makefile = True - pm.makeclean = True - pm.sharedobject = True - pm.inplace = True - pm.dryrun = False - assert pm.build() == 0, f"could not compile {pm.target}" - - -@pytest.mark.dependency(name="shared_makefile", depends=["shared", "makefile"]) -@pytest.mark.base -def test_sharedobject_makefile(): - assert build_with_makefile( - sharedobject_target - ), f"could not compile {sharedobject_target} with makefile" - - -@pytest.mark.dependency( - name="clean", depends=["build", "makefile", "shared_makefile"] -) -@pytest.mark.base -def test_clean_up(): - clean_up() - - -if __name__ == "__main__": - test_download() - test_compile() - for ws in sim_dirs: - run_mf6(ws) - test_makefile() - test_sharedobject() - test_sharedobject_makefile() - test_clean_up() diff --git a/autotest/test_mf6_run.py b/autotest/test_mf6_run.py new file mode 100644 index 00000000..6c62b478 --- /dev/null +++ b/autotest/test_mf6_run.py @@ -0,0 +1,48 @@ +import os + +import flopy +import pytest +from flaky import flaky + +import pymake +from autotest.conftest import get_pymake_appdir + +RERUNS = 3 + +# define program data +target = "mf6" + +# set fpth based on current path +if os.path.basename(os.path.normpath(os.getcwd())) == "autotest": + fpth = os.path.abspath( + os.path.join("temp", "mf6examples", "mf6examples.txt") + ) +else: + fpth = os.path.abspath( + os.path.join("autotest", "temp", "mf6examples", "mf6examples.txt") + ) +if os.path.isfile(fpth): + with open(fpth) as f: + lines = f.read().splitlines() + sim_dirs = [line for line in lines if len(line) > 0] +else: + sim_dirs = [] + + +def run_mf6(exe, workspace): + success = False + exe = os.path.abspath(exe) + if os.path.exists(exe): + # run test models + print(f"running model...{os.path.basename(workspace)}") + success, buff = flopy.run_model( + exe, None, model_ws=workspace, silent=False + ) + return success + + +@pytest.mark.regression +@pytest.mark.parametrize("ws", sim_dirs) +def test_mf6_run(ws): + exe = get_pymake_appdir() / f"{target}" + assert run_mf6(exe, ws), f"could not run {ws}" diff --git a/autotest/test_mflgr.py b/autotest/test_mflgr.py deleted file mode 100644 index 0e272d3f..00000000 --- a/autotest/test_mflgr.py +++ /dev/null @@ -1,78 +0,0 @@ -import os -import shutil - -import pytest -from flaky import flaky - -import pymake - -RERUNS = 3 - -# define program data -target = "mflgr" - -# get program dictionary -prog_dict = pymake.usgs_program_data.get_target(target) - -# set up paths -dstpth = os.path.join(f"temp_{os.path.basename(__file__).replace('.py', '')}") -if not os.path.exists(dstpth): - os.makedirs(dstpth, exist_ok=True) - -mflgrpth = os.path.join(dstpth, prog_dict.dirname) - - -def compile_code(): - # Remove the existing mfusg directory if it exists - if os.path.isdir(mflgrpth): - shutil.rmtree(mflgrpth) - - # compile MODFLOW-LGR - return pymake.build_apps( - target, download_dir=dstpth, appdir=dstpth, verbose=True - ) - - -def clean_up(): - print("Removing test files and directories") - - # clean up download directory - print("Removing folder " + mflgrpth) - if os.path.isdir(mflgrpth): - shutil.rmtree(mflgrpth) - - # get list of files with target in name - epths = [] - for file in os.listdir(dstpth): - fpth = os.path.join(dstpth, file) - if os.path.isfile(fpth): - if target in file: - epths.append(fpth) - - # clean up the executable - for epth in epths: - print("removing...'" + epth + "'") - os.remove(epth) - - dirs_temp = [dstpth] - for d in dirs_temp: - if os.path.isdir(d): - shutil.rmtree(d) - - return - - -@pytest.mark.base -@flaky(max_runs=RERUNS) -def test_compile(): - assert compile_code() == 0, f"could not compile {target}" - - -@pytest.mark.base -def test_clean_up(): - clean_up() - - -if __name__ == "__main__": - compile_code() - clean_up() diff --git a/autotest/test_mfnwt.py b/autotest/test_mfnwt.py deleted file mode 100644 index 334ada88..00000000 --- a/autotest/test_mfnwt.py +++ /dev/null @@ -1,148 +0,0 @@ -import contextlib -import os -import shutil -import sys -import time - -import pytest -from flaky import flaky - -import pymake - -RERUNS = 3 - -# define program data -target = "mfnwt" -if sys.platform.lower() == "win32": - target += ".exe" - -# get program dictionary -prog_dict = pymake.usgs_program_data.get_target(target) - -# set up paths -dstpth = os.path.join(f"temp_{os.path.basename(__file__).replace('.py', '')}") -if not os.path.exists(dstpth): - os.makedirs(dstpth, exist_ok=True) - -mfnwtpth = os.path.join(dstpth, prog_dict.dirname) - -srcpth = os.path.join(mfnwtpth, prog_dict.srcdir) -epth = os.path.join(dstpth, target) - -pm = pymake.Pymake(verbose=True) -pm.target = target -pm.appdir = dstpth -pm.makefile = True -pm.makefiledir = dstpth -pm.inplace = True -pm.dryrun = False - - -@contextlib.contextmanager -def working_directory(path): - """Changes working directory and returns to previous on exit.""" - prev_cwd = os.getcwd() - os.chdir(path) - try: - yield - finally: - os.chdir(prev_cwd) - - -def build_with_makefile(): - success = True - with working_directory(dstpth): - if os.path.isfile("makefile"): - # wait to delete on windows - if sys.platform.lower() == "win32": - time.sleep(6) - - # clean prior to make - print(f"clean {target} with makefile") - os.system("make clean") - - # build MODFLOW-NWT with makefile - print(f"build {target} with makefile") - return_code = os.system("make") - - # test if running on Windows with ifort, if True the makefile - # should fail - errmsg = f"{target} created by makefile does not exist." - if sys.platform.lower() == "win32" and pm.fc == "ifort": - if return_code != 0: - success = True - else: - success = False - # verify that MODFLOW-NWT was made - else: - success = os.path.isfile(target) - else: - errmsg = "makefile does not exist" - - assert success, errmsg - - return - - -def clean_up(): - print("Removing test files and directories") - - # clean up make file - print("Removing makefile") - files = [ - os.path.join(dstpth, file_name) - for file_name in ("makefile", "makedefaults") - ] - for fpth in files: - if os.path.isfile(fpth): - os.remove(fpth) - - # finalize pymake object - pm.finalize() - - # clean up MODFLOW-NWT - if os.path.isfile(epth): - print("Removing " + target) - os.remove(epth) - - print("Removing temporary build directories") - dirs_temp = [dstpth] - for d in dirs_temp: - if os.path.isdir(d): - shutil.rmtree(d) - - return - - -@pytest.mark.base -@flaky(max_runs=RERUNS) -def test_download(): - # Remove the existing mf2005 directory if it exists - if os.path.isdir(mfnwtpth): - shutil.rmtree(mfnwtpth) - - # download the modflow 2005 release - pm.download_target(target, download_path=dstpth) - assert pm.download, f"could not download {target} distribution" - - -@pytest.mark.base -def test_compile(): - assert pm.build() == 0, f"could not compile {target}" - - -@pytest.mark.base -def test_makefile(): - build_with_makefile() - - -@pytest.mark.base -def test_clean_up(): - clean_up() - - -if __name__ == "__main__": - test_download() - test_compile() - build_with_makefile() - clean_up() diff --git a/autotest/test_mfusg.py b/autotest/test_mfusg_run.py similarity index 97% rename from autotest/test_mfusg.py rename to autotest/test_mfusg_run.py index d7783b67..d4d698ec 100644 --- a/autotest/test_mfusg.py +++ b/autotest/test_mfusg_run.py @@ -118,7 +118,7 @@ def run_mfusg(fn, exe): return -@pytest.mark.base +@pytest.mark.skip @flaky(max_runs=RERUNS) @pytest.mark.parametrize("idx,pmobj", usg_versions) def test_download(idx, pmobj): @@ -132,20 +132,20 @@ def test_download(idx, pmobj): assert pmobj.download, f"could not download {pmobj.target}" -@pytest.mark.base +@pytest.mark.skip @pytest.mark.parametrize("idx,pmobj", usg_versions) def test_compile(idx, pmobj): assert pmobj.build() == 0, f"could not compile {pmobj.target}" return -@pytest.mark.regression +@pytest.mark.skip @pytest.mark.parametrize("usg_path,fn", run_parameters) def test_mfusg(usg_path, fn): run_mfusg(fn, usg_path) -@pytest.mark.base +@pytest.mark.skip def test_clean_up(): clean_up() diff --git a/autotest/test_misc_programs.py b/autotest/test_misc_programs.py deleted file mode 100644 index 562a8ad5..00000000 --- a/autotest/test_misc_programs.py +++ /dev/null @@ -1,22 +0,0 @@ -import pytest - -import pymake - -targets = [ - "crt", - "vs2dt", - "zonbud3", -] - - -@pytest.mark.base -@pytest.mark.parametrize("target", targets) -def test_compile(function_tmpdir, target): - dstpth = str(function_tmpdir) - appdir = function_tmpdir / "bin" - assert ( - pymake.build_apps( - target, download_dir=dstpth, appdir=appdir, verbose=True - ) - == 0 - ), f"could not compile {target}" diff --git a/autotest/test_mp6.py b/autotest/test_mp6_run.py similarity index 97% rename from autotest/test_mp6.py rename to autotest/test_mp6_run.py index 2c782b61..98db4eb8 100644 --- a/autotest/test_mp6.py +++ b/autotest/test_mp6_run.py @@ -89,7 +89,7 @@ def clean_up(): return -@pytest.mark.base +@pytest.mark.skip @flaky(max_runs=RERUNS) def test_download(): if os.path.isdir(mp6pth): @@ -99,18 +99,18 @@ def test_download(): assert pm.download, f"could not download {target} distribution" -@pytest.mark.base +@pytest.mark.skip def test_compile(): assert pm.build() == 0, f"could not compile {target}" -@pytest.mark.regression +@pytest.mark.skip @pytest.mark.parametrize("fn", sim_files) def test_modpath6(fn): assert run_modpath6(fn), f"could not run {fn}" -@pytest.mark.base +@pytest.mark.skip def test_clean_up(): clean_up() diff --git a/autotest/test_mp7.py b/autotest/test_mp7_run.py similarity index 98% rename from autotest/test_mp7.py rename to autotest/test_mp7_run.py index fa0eb8cf..63f558e1 100644 --- a/autotest/test_mp7.py +++ b/autotest/test_mp7_run.py @@ -206,7 +206,7 @@ def clean_up(): return -@pytest.mark.base +@pytest.mark.skip @flaky(max_runs=RERUNS) def test_download(): # Remove the existing target download directory if it exists @@ -218,23 +218,23 @@ def test_download(): assert pm.download, f"could not download {target} distribution" -@pytest.mark.base +@pytest.mark.skip def test_compile(): assert pm.build() == 0, f"could not compile {target}" -@pytest.mark.regression +@pytest.mark.skip def test_download_exes(): pymake.getmfexes(dstpth, exes=("mf2005", "mfusg", "mf6"), verbose=True) -@pytest.mark.regression +@pytest.mark.skip @pytest.mark.parametrize("fn", name_files) def test_modpath7(fn): assert run_modpath7(fn), f"could not run {fn}" -@pytest.mark.base +@pytest.mark.skip def test_clean_up(): clean_up() diff --git a/autotest/test_mt3d.py b/autotest/test_mt3d_run.py similarity index 97% rename from autotest/test_mt3d.py rename to autotest/test_mt3d_run.py index 62776d74..e08787b4 100644 --- a/autotest/test_mt3d.py +++ b/autotest/test_mt3d_run.py @@ -164,7 +164,7 @@ def clean_up(): return -@pytest.mark.base +@pytest.mark.skip @flaky(max_runs=RERUNS) def test_download_mt3dms(): # Remove the existing target download directory if it exists @@ -176,12 +176,12 @@ def test_download_mt3dms(): assert pm.download, f"could not download {pm.target} distribution" -@pytest.mark.base +@pytest.mark.skip def test_compile_mt3dms(): assert pm.build() == 0, f"could not compile {pm.target}" -@pytest.mark.base +@pytest.mark.skip @flaky(max_runs=RERUNS) def test_download(): # Remove the existing target download directory if it exists @@ -196,19 +196,19 @@ def test_download(): assert pm.download, f"could not download {target} distribution" -@pytest.mark.base +@pytest.mark.skip def test_compile(): assert pm.build() == 0, f"could not compile {target}" -@pytest.mark.regression +@pytest.mark.skip @pytest.mark.skipif(sys.platform == "darwin", reason="do not run on OSX") def test_download_exes(): pymake.getmfexes(dstpth, exes=("mfnwt", "mf6"), verbose=True) return -@pytest.mark.regression +@pytest.mark.skip @pytest.mark.skipif(sys.platform == "darwin", reason="do not run on OSX") @pytest.mark.skipif(sys.platform == "win32", reason="do not run on Windows") @pytest.mark.parametrize("ws", sim_dirs) @@ -216,7 +216,7 @@ def test_mt3dusgs(ws): assert run_mt3dusgs(ws), f"could not run {ws}" -@pytest.mark.base +@pytest.mark.skip def test_clean_up(): clean_up() diff --git a/autotest/test_seawat.py b/autotest/test_seawat_run.py similarity index 97% rename from autotest/test_seawat.py rename to autotest/test_seawat_run.py index 8d3bf484..c24d1328 100644 --- a/autotest/test_seawat.py +++ b/autotest/test_seawat_run.py @@ -130,7 +130,7 @@ def build_seawat_dependency_graphs(): return -@pytest.mark.base +@pytest.mark.skip @flaky(max_runs=RERUNS) def test_download(): # Remove the existing seawat directory if it exists @@ -142,23 +142,23 @@ def test_download(): assert pm.download, f"could not download {target}" -@pytest.mark.base +@pytest.mark.skip def test_compile(): assert pm.build() == 0, f"could not compile {target}" -@pytest.mark.regression +@pytest.mark.skip @pytest.mark.parametrize("fn", name_files) def test_seawat(fn): run_seawat(fn) -@pytest.mark.regression +@pytest.mark.skip def test_dependency_graphs(): build_seawat_dependency_graphs() -@pytest.mark.base +@pytest.mark.skip @pytest.mark.regression def test_clean_up(): clean_up()