Skip to content
Merged
Show file tree
Hide file tree
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
28 changes: 28 additions & 0 deletions cime_config/customize/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# CIME customization
This directory contains the code for customizing CIME's runtime and provenance collection.

## flags.py
Contains the flags that alter CIME's runtime behavior.

## provenance.py
Contains the code for capturing build and pre/post run provenance.

Implements three provenance hooks.
- `save_build_provenance`
- `save_prerun_provenance`
- `save_postrun_provenance`

## Testing
The `tests/` directory contains unit tests for provenance code.

Requirements:
- `pytest`

### Example
```bash
pip install pytest
# or
# conda install -c conda-forge pytest

pytest -vvv --machine docker tests/
```
35 changes: 35 additions & 0 deletions cime_config/customize/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import os
import sys

# Sets path for "import CIME", etc
CIMEROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "cime"))
sys.path.insert(0, CIMEROOT)
# Sets path for "import provenance"
sys.path.insert(1, os.getcwd())

import pytest

from CIME import utils
from CIME.tests import scripts_regression_tests

os.environ["SRCROOT"] = os.path.join(os.getcwd(), "..", "..")
os.environ["CIME_GLOBAL_WALLTIME"] = "0:05:00"


def pytest_addoption(parser):
# set addoption as add_argument to use common argument setup
# pytest's addoption has same signature as add_argument
setattr(parser, "add_argument", parser.addoption)

scripts_regression_tests.setup_arguments(parser)

# verbose and debug flags already exist
parser.addoption("--silent", action="store_true", help="Disable all logging")


def pytest_configure(config):
kwargs = vars(config.option)

utils.configure_logging(kwargs["verbose"], kwargs["debug"], kwargs["silent"])

scripts_regression_tests.configure_tests(**kwargs)
43 changes: 43 additions & 0 deletions cime_config/customize/flags.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
verbose_run_phase = True
baseline_store_teststatus = False
common_sharedlibroot = False
archive_drv_component = True
archive_dart_component = False
cesm_create_test_flags = False
use_kokkos = True
shared_clm_component = False
ufs_alternative_config = False
enable_smp = True
enable_titan_cam_target = True
build_model_use_cmake = True
build_cime_component_lib = False
default_short_term_archiving = False
copy_e3sm_tools = True
copy_cesm_tools = False
copy_cism_source_mods = False
make_case_run_batch_script = True
case_setup_generate_namelist = True
create_bless_log = True
allow_unsupported = False
check_machine_name_from_test_name = False
sort_tests = True
skip_print_compset = False
calculate_mode_build_cost = True
share_exes = True
serialize_sharedlib_builds = False
use_testreporter_template = True
check_invalid_args = False
skip_walltime_tests = False
skip_xml_test_management_tests = True
skip_performance_archive_tests = False
skip_success_recording_tests = False
skip_cdash_tests = False
skip_checksum_tests = True
skip_gen_domain_tests = False
skip_jenkins_tests = False
skip_single_submit_test = False
xml_component_key = "CONFIG_{}_FILE"
set_comp_root_dir_cpl = False
use_nems_comp_root_dir = False
gpus_use_set_device_rank = False
test_custom_project_machine = "mappy"
Loading