MOM_file_parser unit test implementation#119
Conversation
Codecov Report
@@ Coverage Diff @@
## dev/gfdl #119 +/- ##
============================================
+ Coverage 28.81% 33.52% +4.71%
============================================
Files 249 262 +13
Lines 72934 71175 -1759
Branches 0 13284 +13284
============================================
+ Hits 21015 23861 +2846
+ Misses 51919 42844 -9075
- Partials 0 4470 +4470
Continue to review full report at Codecov.
|
| use MOM_error_handler, only : disable_fatal_errors | ||
| use MOM_error_handler, only : enable_fatal_errors | ||
|
|
||
| implicit none |
There was a problem hiding this comment.
The convention documented at https://github.com/NOAA-GFDL/MOM6/wiki/Code-style-guide is to have implicit none ; private on the same line in every file that is not a driver (i.e., has main). This help us to easily detect files that do not make these important declarations at the topmost level; otherwise the private declaration might apply to the contents of a type or something else. The same comment also applies to lines 31 and 32 of MOM_file_parser_tests.F90.
There was a problem hiding this comment.
I don't understand, I am using private already.
There was a problem hiding this comment.
Doing grep -L implicit none ; private would flag this file as potentially problematic if this convention is not followed.
There was a problem hiding this comment.
I have added the Hallberg semicolons.
|
I have examined the changes to the F90 files, and apart from one minor concern, they look good to me. However, I am not well versed with .yml, .ac, or Makefile syntax, and would like to have someone else comment on those changes. |
b004668 to
9eda7fd
Compare
Hallberg-NOAA
left a comment
There was a problem hiding this comment.
I have examined these changes, and despite not being fluent in the syntax of .yml, .ac, or Makefiles, all of the changes here seem sensible. I will trigger the pipeline testing of these changes after this PR comes to the top of the queue, and after updating the base branch.
|
The PGI build step in the pipeline is failing, apparently at lines 761 and 780 of MOM_file_parser_tests.F90. I have tried this 3 times, with the same result each time. It appears that the pgi compiler is interpreting the " /'" construct as an escape on the closing quote, leading to the erroneous error messages about mismatched quotes., @marshallward, please see what needs to be done to get these changes to compile with the pgi compiler. |
Hallberg-NOAA
left a comment
There was a problem hiding this comment.
I thought that these changes looked good, but apparently the pgi compiler disagrees. Please make the changes that are needed to get the pgi compiler to work.
This patch introduces new features to support unit testing of the MOM6 source code. The patch includes two new modules (MOM_unit_testing, MOM_file_parser_tests), two new classes (UnitTest, TestSuite), and a new driver (unit_testing). A UnitTest object consists of the following: * The test subroutine * Test name (for reporting) * A flag indicating whether the test should fail (FATAL) * An optional cleanup subroutine The UnitTest objects are gathered into a TestSuite object, which provides a batch job for running all of its tests. The use of these features is demonstrated in a driver, unit_tests, which runs the tests provided in the MOM_file_parser_tests module This patch also includes changes to the ".testing" build system. * The optional FCFLAGS_COVERAGE has been removed from the testing Makefile. Instead, a new "cov" target is optionally built if one wants to check the coverage. It is currently based on "symmetric". * A new "unit" target has been added to run the unit testing driver and report its code coverage. * GitHub Actions has been modified to include the unit driver test. * The gcov output now includes branching (-b), which allows reporting of partial line coverage in some cases. * codecov.io "smart" report searching has been replaced with an explicit setting of the root directory (-R) and *.gcda paths. Other minor changes: * MOM_coms include an infra-level sync function (sync_PEs) as a wrapper to mpp_sync (or others in the future).
|
We should be building with PGI |
|
With the updates, this PR has now passed the pipeline testing at https://gitlab.gfdl.noaa.gov/ogrp/MOM6/-/pipelines/15555. |
update to MOM6 main 20230731 and 20230811 updating
This patch introduces new features to support unit testing of the MOM6
source code. The patch includes two new modules (MOM_unit_testing,
MOM_file_parser_tests), two new classes (UnitTest, TestSuite), and a new
driver (unit_testing).
A UnitTest object consists of the following:
The UnitTest objects are gathered into a TestSuite object, which
provides a batch job for running all of its tests.
The use of these features is demonstrated in a driver, unit_tests, which
runs the tests provided in the MOM_file_parser_tests module
This patch also includes changes to the ".testing" build system.
The optional FCFLAGS_COVERAGE has been removed from the testing
Makefile. Instead, a new "cov" target is optionally built if one
wants to check the coverage. It is currently based on "symmetric".
A new "unit" target has been added to run the unit testing driver and
report its code coverage.
GitHub Actions has been modified to include the unit driver test.
The gcov output now includes branching (-b), which allows reporting of
partial line coverage in some cases.
codecov.io "smart" report searching has been replaced with an explicit
setting of the root directory (-R) and *.gcda paths.
Other minor changes:
to mpp_sync (or others in the future).