Skip to content

Testing: BUILD and WORK macros for controlling test output#563

Closed
marshallward wants to merge 3 commits into
NOAA-GFDL:dev/gfdlfrom
marshallward:test_cfg_build_work
Closed

Testing: BUILD and WORK macros for controlling test output#563
marshallward wants to merge 3 commits into
NOAA-GFDL:dev/gfdlfrom
marshallward:test_cfg_build_work

Conversation

@marshallward
Copy link
Copy Markdown
Member

This patch replaces the WORKSPACE macro with two macros for BUILD and WORK. It also makes the following smaller changes:

  • deps/ is now defined by the DEPS macro. If unset, deps/ is placed in the BUILD directory.

  • results/ is moved into WORK,

  • Compiler flags which track directories now use $(abspath ...) to allow for arbitrary paths.

  • GitHub CI paths were adjusted to support these new settings.

This work will enable testing of multiple FMS libraries in our CI.

There are additional changes to the DO_* user control flags of .testing/Makefile. Now, any value is regarded as "true", rather than just the value true. This is more consistent with how Make interprets macro flags.

Finally, an old macro for setting up mkmf in the coupled build tests has been removed. Since I was unsure if this would break anything outside of my control, I moved it to a separate commit.

This patch replaces the WORKSPACE macro with two macros for BUILD and
WORK.  It also makes the following smaller changes:

* deps/ is now defined by the DEPS macro.  If unset, deps/ is placed in
  the BUILD directory.

* results/ is moved into WORK,

* Compiler flags which track directories now use $(abspath ...) to
  allow for arbitrary paths.

* GitHub CI paths were adjusted to support these new settings.

This work will enable testing of multiple FMS libraries in our CI.
Refactor the various DO_* flags to use ifdef, which checks if the flags
have any value, rather than explicitly looking for "true".  This follows
the Make convention of an unset value corresponding to False.

There is also some minor refactoring, such as pruning of redundant
comments.
There appears to be a legacy macro and comments related to building the
coupled driver object files with mkmf.  To the best of my knowledge,
this is no longer used, and it appears to build correctly when removed,
so I am removing all reference to mkmf from this section.

However, I will pack it into a separate commit, in case it is actually
needed somewhere ^_^.
@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (5ca70ba) 36.88% compared to head (2095b8e) 37.20%.
Report is 1 commits behind head on dev/gfdl.

Additional details and impacted files
@@             Coverage Diff              @@
##           dev/gfdl     #563      +/-   ##
============================================
+ Coverage     36.88%   37.20%   +0.31%     
============================================
  Files           271      271              
  Lines         79231    80353    +1122     
  Branches      14712    14985     +273     
============================================
+ Hits          29228    29894     +666     
- Misses        44587    44902     +315     
- Partials       5416     5557     +141     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@marshallward marshallward requested a review from adcroft February 28, 2024 15:52
@marshallward marshallward assigned adcroft and unassigned adcroft Feb 28, 2024
@marshallward marshallward requested review from Hallberg-NOAA and removed request for adcroft February 29, 2024 16:31
Comment thread .testing/Makefile

# Default is to place work/ and results/ in current directory
WORKSPACE ?= .
BUILD ?= build
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For a user on gaea keeping the source in /home, I think this now requires providing two macros. Instead if you kept WORKSPACE and adding BUILD and WORK like this:

WORKSPACE ?= 
BUILD ?= $(WORKSPACE)build
WORK ?= $(WORKSPACE)work

You would retain the old functionality and provide the fine-grain control you want for the CI

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is anyone else using WORKSPACE? I am asking because I deliberately do not want to anchor these paths together in any way.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do, but I could also achieve the same with config.mk ...

@marshallward
Copy link
Copy Markdown
Member Author

There are several errors in this PR; the deps builds correctly but the MOM6 executables do not if BUILD is set to an external directory.

If I can't sort it out quickly, then I will close this and address it at a later time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants