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

Allow CI case to exclude running on certain platforms #2001

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions workflow/create_experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"""

import os
import sys

from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter
from pathlib import Path
Expand All @@ -27,6 +28,7 @@
import setup_expt
import setup_xml

from hosts import Host

TerrenceMcGuinness-NOAA marked this conversation as resolved.
Show resolved Hide resolved
_here = os.path.dirname(__file__)
_top = os.path.abspath(os.path.join(os.path.abspath(_here), '..'))
Expand Down Expand Up @@ -75,6 +77,12 @@ def input_args():
data.update(os.environ)
testconf = parse_j2yaml(path=user_inputs.yaml, data=data)

if 'exclude' in testconf:
Copy link
Contributor

Choose a reason for hiding this comment

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

While exclude is fine, IMO, it is not descriptive in its intent.
The purpose here is to skip CI on the excluded host.
Would a key such as skip_ci_on_hosts: be descriptive to include in the yamls?
Thoughts?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oh yes completely agree!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

let me make the changes in a push

host = Host()
if host.machine.lower() in [excluded_host.lower() for excluded_host in testconf.exclude]:
logger.info(f'Skipping creation of case: {testconf.arguments.pslot} on {host.machine.capitalize()}')
sys.exit(0)

# Create a list of arguments to setup_expt.py
setup_expt_args = [testconf.experiment.system, testconf.experiment.mode]
for kk, vv in testconf.arguments.items():
Expand Down