refactor(tests):#1066
Merged
christianlangevin merged 4 commits intoMODFLOW-ORG:developfrom Jan 18, 2023
Merged
Conversation
This was referenced Oct 31, 2022
137a898 to
83800f5
Compare
14b5ffb to
9ecfa7f
Compare
bb89caa to
6ec7fcb
Compare
df367b6 to
6ec7fcb
Compare
* use keepable temporary dirs instead of manually managed temp folder * use pytest-order and add optional --path arg to update_flopy.py CLI * remove binary_file_writer.py, disu_util.py, budget_file_compare.py * rename Simulation -> TestSimulation and Framework -> TestFramework * partially refactor gwf test scripts with pytest-cases * remove mfpymake as a testing dependency
08ea367 to
33d7e9b
Compare
33d7e9b to
5cfeb20
Compare
19c9b14 to
deb90f4
Compare
christianlangevin
approved these changes
Jan 18, 2023
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Follows up on #1130 and picks up some threads originally in #1052
modflow-devtoolsci.yml, only trigger matrix jobs if smoke tests passdisu_util.pybinary_file_writer.pybudget_file_compare.pyautotest/scripts/cross_section_functions.py->autotest/cross_section_functions.pyfor import without alteringsys.path--path(short-p) argument toupdate_flopy.pyCLI, defaults to existing locationdoc/mf6io/mf6ivar/dfnpytest-orderis used for orderingpytest-cases. This is a proof of concept for decoupling test cases from test functions, meant to demo how existing test cases could be incrementally refactored to plug into a shared test function. Implementations range from a minimal switch topytest-cases, keeping things in the original file, to more extensive refactoring using theCaseutility from devtools. Affected files include:test_gwf_buy_lak02.py: cases and test function both kept in original scripttest_gwf_csub_sk01.py: cases and test function both kept in original scripttest_gwf_maw04.py: cases defined in original script, plugged into shared test functiontest_gwf_maw_cases.py: broadly refactored cases previously intest_gwf_maw0[1-3].py, plugged into shared functiontest_gwf.py: shared test function, cases testing any package can be plugged inSimulationtoTestSimulationto disambiguate from Flopy and ModflowAPItesting_frameworktoTestFramework(shared test function could replace framework class if refactor proceeds)flopy(removetry/exceptimports) since it's documented inDEVELOPER.mdand included inenvironment.ymlpython(without pytest) — tests depend on several pytest features so it seems reasonable to require it as a testing dependency, and--original-regression,--modeland--packagefiltering options are now supported bypytest.REPOS_PATHenv var to testing steps in CI. This is not strictly required since the repos are checked out to the default search location used by devtools (level withmodflow6) but probably still best to be explicit.DEVELOPER.mdto reflect updates described here. The recent changes should be mostly transparent but if errors are encountered in a local development environment, some things to check include:modflow-devtools>=0.1.4should be installedflopymust be installed from a recent version of thedevelopbranch (at least modflowpy/flopy@94cd19d)MODFLOW-USGS/modflow6-testmodels,MODFLOW-USGS/modflow6-largetestmodelsandMODFLOW-USGS/modflow6-examplesare not cloned side-by-side with themodflow6repo, theREPOS_PATHenvironment variable must point to the folder containing the model repositories--pak,--simand--matchoptions previously used for external model tests are converted to--modeland--packageoptions supported bypytest— for finer-grained control the utility functions with which the CLI opts are implemented may be used directly