Skip to content

Commit

Permalink
fixed lingering HPC_ACCOUT and cleaned up old setup xml test
Browse files Browse the repository at this point in the history
  • Loading branch information
Terry McGuinness committed Jun 28, 2024
1 parent 47735e6 commit 0e82a70
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 18 deletions.
1 change: 0 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
[submodule "sorc/wxflow"]
path = sorc/wxflow
url = https://github.com/NOAA-EMC/wxflow.git
branch = config_env_bash
[submodule "sorc/gfs_utils.fd"]
path = sorc/gfs_utils.fd
url = https://github.com/NOAA-EMC/gfs-utils
Expand Down
2 changes: 1 addition & 1 deletion ci/cases/yamls/atmaerosnowDA_defaults_ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ defaults:
!INC {{ HOMEgfs }}/parm/config/gfs/yaml/defaults.yaml
base:
DO_JEDISNOWDA: "YES"
ACCOUNT: {{ 'ACCOUNT' | getenv }}
ACCOUNT: {{ 'HPC_ACCOUNT' | getenv }}
2 changes: 1 addition & 1 deletion ci/cases/yamls/gfs_defaults_ci.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
defaults:
!INC {{ HOMEgfs }}/parm/config/gfs/yaml/defaults.yaml
base:
ACCOUNT: {{ 'ACCOUNT' | getenv }}
ACCOUNT: {{ 'HPC_ACCOUNT' | getenv }}
2 changes: 1 addition & 1 deletion ci/cases/yamls/gfs_extended_ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ defaults:
!INC {{ HOMEgfs }}/parm/config/gfs/yaml/defaults.yaml

base:
ACCOUNT: {{ 'ACCOUNT' | getenv }}
ACCOUNT: {{ 'HPC_ACCOUNT' | getenv }}
DO_GOES: "YES"
DO_BUFRSND: "YES"
DO_GEMPAK: "YES"
Expand Down
2 changes: 1 addition & 1 deletion ci/cases/yamls/soca_gfs_defaults_ci.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
defaults:
!INC {{ HOMEgfs }}/parm/config/gfs/yaml/defaults.yaml
base:
ACCOUNT: {{ 'ACCOUNT' | getenv }}
ACCOUNT: {{ 'HPC_ACCOUNT' | getenv }}
DO_JEDIOCNVAR: "YES"
2 changes: 1 addition & 1 deletion ci/cases/yamls/ufs_hybatmDA_defaults.ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ base:
DOIAU: "NO"
DO_JEDIATMVAR: "YES"
DO_JEDIATMENS: "YES"
ACCOUNT: {{ 'ACCOUNT' | getenv }}
ACCOUNT: {{ 'HPC_ACCOUNT' | getenv }}
atmanl:
LAYOUT_X_ATMANL: 4
LAYOUT_Y_ATMANL: 4
Expand Down
2 changes: 1 addition & 1 deletion ci/scripts/tests/test_create_experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ def test_create_experiment():
create_experment_script(env=env)
assert (create_experment_script.returncode == 0)

rmtree(RUNDIR)
rmtree(RUNDIR)
12 changes: 1 addition & 11 deletions ci/scripts/tests/test_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,8 @@ def test_setup_expt():

def test_setup_xml():

script_content = '''#!/usr/bin/env bash
#export ACCOUNT=fooman
#export HOMEgfs=foobar
../../../workflow/setup_xml.py "${1}"
'''
with open('run_setup_xml.sh', 'w') as file:
file.write(script_content)
os.chmod('run_setup_xml.sh', 0o755)

setup_xml_script = Executable(os.path.join(HOMEgfs, "ci", "scripts", "tests", "run_setup_xml.sh"))
setup_xml_script = Executable(os.path.join(HOMEgfs, "workflow/setup_xml.py"))
setup_xml_script.add_default_arg(f"{RUNDIR}/{pslot}")
setup_xml_script()
assert (setup_xml_script.returncode == 0)
Expand All @@ -45,14 +37,12 @@ def test_setup_xml():
base = cfg.parse_config('config.base')
assert base.ACCOUNT == account

assert foobar not in base.values()
assert "UNKOWN" not in base.values()

with open(f"{RUNDIR}/{pslot}/{pslot}.xml", 'r') as file:
contents = file.read()
assert contents.count(account) > 5

os.remove('run_setup_xml.sh')
rmtree(RUNDIR)


Expand Down

0 comments on commit 0e82a70

Please sign in to comment.