Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial testing framework simplified #1284

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

islas
Copy link
Contributor

@islas islas commented Jan 29, 2025

This PR introduces testing capabilities through a series of compartmentalized commits :

  1. Setting up helper scripts to handle environment loading
  2. Compilation test script able to exercise the make build
  3. A git submodule to the hpc-workflows testing framework
  4. A test definition config using hpc-workflows

The tests can be run using the following command :
.ci/hpc-workflows/.ci/runner.py .ci/mpas_compilation.jsonc -t gnu

If this is run in an environment noted to have PBS/SLURM (as seen by the line in mpas_compilation.jsonc : "hsn.de.hpc" : { "submission" : "PBS" } ) an account key must be provided to utilize job submission. Local testing in within the login node can be forced but should be used with caution.

This PR is meant to supersede PR #1218 as a smaller incremental change.

islas added 4 commits January 29, 2025 15:22
In order to run test scripts outside of a testing framework, handling of
the environment setup should not be solely dependent on running within a
dedicated test framework. This has the added benefit of
compartmentalizing the duties of environment and dependency solving from
running the tests.

These environment scripts allow for the selection of a particular
environment with the default being the fqdn of the current host. From
there, arguments are routed using standard POSIX-sh to a respective
script. In the case of Derecho (applicable to any system using lmod) all
subsequent argument are treated as modules to load into the current
session.

The hostenv.sh script relies on one "argument" $AS_HOST being passed in
via variable setting to facilitate selection.

The helpers.sh script provides convenience features for substring
checking in sh, delayed environment variable expansion via eval, and
quick banner creation.

The derecho.sh script is included as the first supported environment.
This script will facilitate the first tests. There are only three
requirements of any given test script with the planned testing framework

If a different testing framework is used in the future, these
requirements of the test scripts can and should be re-evaluated.

The test script should :
1. Take the intended host / configuration env as the first argument
2. Take the working directory which we cd to as the second argument
3. Output some key phrase at the end of the test to denote success,
   anything else (non-zero exit code, no phrase but return zero) is
   considered failure

This particular compilation test script satisfies the above while also
providing enough flexibility to select core, target, parallel jobs, and
other command-line options into the make build. Additionally, for
convenience environment variables can be passed in as command-line
options to the test script to modularize certain inputs.
Following the documentation of the hpc-workflows testing framework and
the testing structure found in .ci/, a JSON file for a GNU compilation
test was added.

This test will compile the atmosphere core using gnu + single precision.
If this test is run using the derecho configuration the appropriate
modules will attempt to be loaded. For non-derecho environments, per the
testing structure under .ci/, if no configuration exists in
.ci/hostenv.sh then the current environment will be used verbatim.
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.

1 participant