Skip to content

Commit

Permalink
error review
Browse files Browse the repository at this point in the history
  • Loading branch information
Avery Kiihne authored and Avery Kiihne committed Dec 16, 2024
1 parent 2c41baf commit 3f04df9
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions fre/make/tests/null_example/test_checkout_null_yaml.py
Original file line number Diff line number Diff line change
@@ -1,36 +1,34 @@
#tests for the create-checkout step of fre-make, for null_model.yaml
import os
from fre import fre
from pathlib import Path
from fre.pp import configure_script_yaml as csy
from click.testing import CliRunner
import os
import subprocess
from fre.make import createCheckout

# Set example yaml paths, input directory
test_dir = Path("fre/make/tests/null_example")
yamlfile = Path(f"{test_dir}/null_model.yaml")
TEST_DIR = Path("fre/make/tests")
YAMLFILE = Path(f"{TEST_DIR}/null_example/null_model.yaml")

#set platform and target
platform = ["ncrc5.intel"]
target = ["debug"]
PLATFORM = "ncrc5.intel"
TARGET = "debug"

#set output directory
#out_dir = Path(f"fre/make/tests/null_example/fre_make_out")
#Path(out_dir).mkdir(parents=True,exist_ok=True)

# Set home for ~/cylc-src location in script
#os.environ["HOME"]=str(Path(f"{out_dir}"))
HOME_DIR = os.environ["HOME"]
OUT = f"{TEST_DIR}/checkout_out"
def_home = str(os.environ["HOME"])
os.environ["HOME"]=OUT#str(Path(OUT))

#run checkout command
runner = CliRunner()

def test_checkout_script_exists():
"""
Make sure checkout file exists
"""
result = runner.invoke(fre.fre, args=["make","create-checkout","-y",yamlfile,"-p",platform,"-t",target])
#createCheckout.checkout_create(["null_model.yaml","ncrc5.intel","debug"])
result = createCheckout.checkout_create(YAMLFILE,PLATFORM,TARGET,no_parallel_checkout=False, jobs=False, verbose=False, execute=False)
assert result.exit_code == 0
assert Path(f"{HOME_DIR}/fremake_canopy/test/null_model_full/src/checkout.sh").exists()

Expand All @@ -40,6 +38,6 @@ def test_checkout_execute():
"""
#subprocess.run(["rm","-rf",f"{out_dir}"])
subprocess.run(["rm","-rf"])
result = runner.invoke(fre.fre, args=["make","create-checkout","-y",yamlfile,"-p",platform,"-t",target,"--execute"])
result = createCheckout.checkout_create(YAMLFILE,PLATFORM,TARGET,no_parallel_checkout=False, jobs=False, verbose=False, execute=False)
assert (result.exit_code == 0)

0 comments on commit 3f04df9

Please sign in to comment.