Closed yardasol closed 1 year ago
Hello @yardasol! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
There are currently no PEP 8 issues detected in this Pull Request. Cheers! :beers:
"68 files changed" 👁️ 👄 👁️
This all looks fine to me. I made a take-it-or-leave-it suggestion in part of the documentation. Otherwise, my only comment is if you're moving files to use
git mv
, which I think would reduce the total number of files in the PR.
That's a great suggestion about git mv
! I hadn't really thought about the implications of not using that. Will do this in the future.
I'd like at least one more review from @munkm or @smpark7 since this is a pretty major overhaul of the test suite.
@munkm bump
Ok, I think I'm done reviewing now! Thank you so much for these changes @yardasol !! I think there are lots of great improvements to the test suite here.
Thanks!
I am a little worried about calling the files used to and in the serpent/openmc runs
test_
, as it sort of implies that's a file that's doing the test, not used by the test. Does that make sense? Maybe we could call themsample_
or something? I'm trying to come up with an alternative that would make them more differentiable from the actual test files.
Which files are you talking about?
Do you think there could be any issues by moving the tests folder out of the saltproc dir? I think this means it could be harder for a wheel build install to run the tests (which we don't use yet so it's not an issue) but I haven't double checked that so I could be wrong.
I don't know. I've never used wheel.
Thanks for the review @munkm
I'm talking about the
.ini
and.json
files that start withtest_
. Since they are specific designs and configurations, maybe we could name them with the functionality first, then say they're for tests. That way it doesn't seem like those files alone are test files. e.g. something likemsr_input_test
.
I somewhat agree with you, and somewhat don't. I think it's perfectly valid to prefix the input files with test_
because that elucidates their purpose (the intended purpose is that they are associated with tests). I'm not convinced that renaming the files to correspond to a specific design/configuration is particularly useful because we only have one such design/configuration right now for our unit tests. If down the road we are working with more than one configuration/design, then I think it makes sense to add more detail to those file names.
@munkm if you don't have any further comments, can this be merged?
Summary of changes
This PR cleans up and overhauls the test suite to increase readability and future extensibility.
Specifically, this PR:
eliminates the
saltproc.tests
package and moves thetests
directory to the base directory of the repomoves
pytest.ini
to the base directory of the repoadds a
conftest.py
file totests/
Makes the following changes to the source files:
app.py
:read_main_input()
_print_simulation_input_info()
_create_depcode_object()
_create_simulation_object()
_create_reactor_object()
_process_main_input_reactor_params()
reprocess_materials()
get_paths()
refill_materials()
depcode.py
:materials.xml
from default value fortemplate_input_file_path
store depletion-code specific inputs data in new directories:
serpent_data
openmc_data
Changes to integration tests
runsim_no_reproc
->run_no_reprocessing
: make datafile naming consistent, rely on a saltproc input file instead of module-level variables, internal variable name adjusments.cons_reproc
->run_constant_reprocessing
: make datafile naming consistent, internal variable name adjustments, use previously implemented but unused functions for testing reference results and test results.simple_reprocessing
: reprocessing-related tests fromtest_app.py
database_storage
: database related tests fromtest-simulation.py
file_interface_openmc
: OpenMC file-related tests fromtest_depcode.py
file_interface_serpent
: Serpent file-related tests fromtest_depcode.py
Changes to specific unit tests:
test_app.py
: Move testing ofrefill
andreprocessing
to an integration test,simple_reprocessing
test_depcode.py
: Move testing of file writing to integration tests,file_interface_openmc
andfile_interface_serpent
; split up into serpent and openmc tests.test_ materialflow.py
: Simplify file, syntax updatestest_process.py
: Simplify file, syntax updatestest_separator.py
: Simplify file, syntax updatestest_simulation.py
: Move testing of database accuracy to an integration test,database_storage
test_sparger.py
: Simplify file, syntax updatesupdates references to changed function names in the docpages with their new names.
Types of changes
[ ] Bug fix (non-breaking change which fixes an issue)
[x] New feature (non-breaking change which adds functionality)
[x] Breaking change (fix or feature that would cause existing functionality to change)
Required for Merging
[x] I have read the CONTRIBUTING document.
[x] My code follows the code style of this project.
[x] My change requires a change to the documentation.
[x] My change is a source code change
[x] My change is a user-facing change
[ ] My change is exclusively related to the repository (e.g. GitHub actions workflows, PR/issue templates, etc.)
[x] All new and existing tests passed.
Associated Issues and PRs
Issue: #155
Associated Developers
Checklist for Reviewers
Reviewers should use this link to get to the Review Checklist before they begin their review.