diff --git a/.gitignore b/.gitignore index 5212a9a5..944edec6 100644 --- a/.gitignore +++ b/.gitignore @@ -66,6 +66,10 @@ fre/tests/test_files/outdirfre/ fre/pp/tests/configure_yaml_out/ fre/yamltools/tests/combine_yamls_out/ fre/app/generate_time_averages/tests/time_avg_test_files/ +fre/make/tests/null_example/combined-null_model.yaml +fre/make/tests/makefile_out +fre/make/tests/compile_out +fre/tests/fremake_out # Translations *.mo diff --git a/fre/gfdl_msd_schemas b/fre/gfdl_msd_schemas index 32b9d7ca..04c8150b 160000 --- a/fre/gfdl_msd_schemas +++ b/fre/gfdl_msd_schemas @@ -1 +1 @@ -Subproject commit 32b9d7ca00aa314b781341dda4d241d48e588d18 +Subproject commit 04c8150bc362304d82e60e765405135460b69f06 diff --git a/fre/make/create_compile_script.py b/fre/make/create_compile_script.py index 6b1bd94a..cd593021 100644 --- a/fre/make/create_compile_script.py +++ b/fre/make/create_compile_script.py @@ -15,7 +15,6 @@ def compile_create(yamlfile,platform,target,jobs,parallel,execute,verbose): name = yamlfile.split(".")[0] nparallel = parallel jobs = str(jobs) - run = execute if verbose: logging.basicCOnfig(level=logging.INFO) @@ -79,13 +78,14 @@ def compile_create(yamlfile,platform,target,jobs,parallel,execute,verbose): fremakeBuild.writeBuildComponents(c) fremakeBuild.writeScript() fremakeBuildList.append(fremakeBuild) - click.echo("\nCompile script created at " + bldDir + "/compile.sh" + "\n") - if run: + + if execute: + click.echo("\nCompile script created at " + bldDir + "/compile.sh" + "\n") if baremetalRun: pool = Pool(processes=nparallel) # Create a multiprocessing Pool pool.map(buildBaremetal.fremake_parallel,fremakeBuildList) # process data_inputs iterable with pool else: - sys.exit() + click.echo("\nCompile script created at " + bldDir + "/compile.sh" + "\n") @click.command() def _compile_create(yamlfile,platform,target,jobs,parallel,execute,verbose): diff --git a/fre/make/gfdlfremake/platformfre.py b/fre/make/gfdlfremake/platformfre.py index 69820d46..a5a3c4cf 100644 --- a/fre/make/gfdlfremake/platformfre.py +++ b/fre/make/gfdlfremake/platformfre.py @@ -57,7 +57,6 @@ def __init__(self,platforminfo): raise Exception("You must specify the program used to build the container (containerBuild) on the "+p["name"]+" platform in the file "+fname+"\n") if p["containerBuild"] != "podman" and p["containerBuild"] != "docker": raise ValueError("Container builds only supported with docker or podman, but you listed "+p["containerBuild"]+"\n") - print (p["containerBuild"]) ## Check for container environment set up for RUN commands try: p["containerBase"] diff --git a/fre/make/gfdlfremake/yamlfre.py b/fre/make/gfdlfremake/yamlfre.py index 0683ad4e..0fa91678 100644 --- a/fre/make/gfdlfremake/yamlfre.py +++ b/fre/make/gfdlfremake/yamlfre.py @@ -171,7 +171,6 @@ def __init__(self,combinedyaml,v): #get platform info self.platformsdict = self.freyaml.get("platforms") - print(self.platformsdict) self.platforms = platformfre.platforms(self.platformsdict) self.platformsyaml = self.platforms.getPlatformsYaml() diff --git a/fre/make/tests/AM5_example/am5.yaml b/fre/make/tests/AM5_example/am5.yaml deleted file mode 100644 index 359755ec..00000000 --- a/fre/make/tests/AM5_example/am5.yaml +++ /dev/null @@ -1,104 +0,0 @@ -# reusable variables -fre_properties: - - &AM5_VERSION "am5f7b12r1" - - &FRE_STEM !join [am5/, *AM5_VERSION] - - # amip - - &EXP_AMIP_START "1979" - - &EXP_AMIP_END "2020" - - &ANA_AMIP_START "1980" - - &ANA_AMIP_END "2020" - - - &PP_AMIP_CHUNK96 "1yr" - - &PP_AMIP_CHUNK384 "1yr" - - &PP_XYINTERP96 "180,288" - - &PP_XYINTERP384 "720,1152" - - # climo - - &EXP_CLIMO_START96 "0001" - - &EXP_CLIMO_END96 "0011" - - &ANA_CLIMO_START96 "0002" - - &ANA_CLIMO_END96 "0011" - - - &EXP_CLIMO_START384 "0001" - - &EXP_CLIMO_END384 "0006" - - &ANA_CLIMO_START384 "0002" - - &ANA_CLIMO_END384 "0006" - - # coupled - - &PP_CPLD_CHUNK_A "5yr" - - &PP_CPLD_CHUNK_B "20yr" - - # grids - - &GRID_SPEC96 "/archive/oar.gfdl.am5/model_gen5/inputs/c96_grid/c96_OM4_025_grid_No_mg_drag_v20160808.tar" - - # compile information - - &release "f1a1r1" - - &INTEL "intel-classic" - - &FMSincludes "-IFMS/fms2_io/include -IFMS/include -IFMS/mpp/include" - - &momIncludes "-Imom6/MOM6-examples/src/MOM6/pkg/CVMix-src/include" - -build: - # compile information - compileYaml: "compile.yaml" - platformYaml: "yaml_include/platforms.yaml" - -shared: - # directories shared across tools - directories: &shared_directories - history_dir: !join [/archive/$USER/, *FRE_STEM, /, *name, /, *platform, -, *target, /, history] - pp_dir: !join [/archive/$USER/, *FRE_STEM, /, *name, /, *platform, -, *target, /, pp] - analysis_dir: !join [/nbhome/$USER/, *FRE_STEM, /, *name] - ptmp_dir: "/xtmp/$USER/ptmp" - fre_analysis_home: "/home/fms/local/opt/fre-analysis/test" - - # shared pp settings - postprocess: - settings: &shared_settings - history_segment: "P1Y" - site: "ppan" - switches: &shared_switches - do_statics: True - do_timeavgs: True - clean_work: True - do_refinediag: False - do_atmos_plevel_masking: True - do_preanalysis: False - do_analysis: True - -experiments: - - name: "c96L65_am5f7b12r1_amip" - pp: - - "yaml_include/pp.c96_amip.yaml" - - name: "c96L65_am5f7b12r1_pdclim1850F" - pp: - - "yaml_include/pp.c96_clim.yaml" - - name: "c96L65_am5f7b12r1_pdclim2010F" - pp: - - "yaml_include/pp.c96_clim.yaml" - - name: "c96L65_am5f7b12r1_pdclim2010AERF" - pp: - - "yaml_include/pp.c96_clim.yaml" - - name: "c384L65_am5f7b12r1_amip" - pp: - - "yaml_include/pp.c384_amip.yaml" - - name: "c384L65_am5f7b12r1_pdclim2010F" - pp: - - "yaml_include/pp.c384_clim.yaml" - - name: "c384L65_am5f7b12r1_pdclim1850F" - pp: - - "yaml_include/pp.c384_clim.yaml" - - name: "c384L65_am5f7b12r1_pdclim2010AERF" - pp: - - "yaml_include/pp.c384_clim.yaml" - - name: "c384L65_am5f7b12r1_OM4_p25_piControl_noBLING_DynVeg" - pp: - - "yaml_include/pp.c384_amip.yaml" - - "yaml_include/pp.om4.yaml" - - name: "c96L65_am5f7b12r1_OM4_p25_piControl_noBLING_DynVeg" - pp: - - "yaml_include/pp.c96_amip.yaml" - - "yaml_include/pp.om4.yaml" - - name: "c96L65_am5f7b12r1_amip_cosp" - pp: - - "yaml_include/pp.c96_amip.yaml" diff --git a/fre/make/tests/AM5_example/compile.yaml b/fre/make/tests/AM5_example/compile.yaml deleted file mode 100644 index 5f9a361b..00000000 --- a/fre/make/tests/AM5_example/compile.yaml +++ /dev/null @@ -1,67 +0,0 @@ -compile: - experiment: "am5" - container_addlibs: - baremetal_linkerflags: - src: - - component: "FMS" - repo: "https://github.com/NOAA-GFDL/FMS.git" - cppdefs: "-DINTERNAL_FILE_NML -Duse_libMPI -Duse_netCDF" - branch: "2022.01" - cppdefs: "-DHAVE_GETTID -Duse_libMPI -Duse_netCDF" - otherFlags: *FMSincludes - - component: "am5_phys" - requires: ["FMS"] - repo: "https://gitlab.gfdl.noaa.gov/FMS/am5_phys.git" - branch: "2022.01" - otherFlags: *FMSincludes - - component: "GFDL_atmos_cubed_sphere" - requires: ["FMS", "am5_phys"] - repo: "https://github.com/NOAA-GFDL/GFDL_atmos_cubed_sphere.git" - cppdefs: "-DSPMD -DCLIMATE_NUDGE -DINTERNAL_FILE_NML" - branch: "2022.01" - paths: ["GFDL_atmos_cubed_sphere/driver/GFDL", - "GFDL_atmos_cubed_sphere/model", - "GFDL_atmos_cubed_sphere/driver/SHiELD/cloud_diagnosis.F90", - "GFDL_atmos_cubed_sphere/driver/SHiELD/gfdl_cloud_microphys.F90", - "GFDL_atmos_cubed_sphere/tools", - "GFDL_atmos_cubed_sphere/GFDL_tools"] - otherFlags: *FMSincludes - - component: "atmos_drivers" - requires: ["FMS", "am5_phys", "GFDL_atmos_cubed_sphere"] - repo: "https://github.com/NOAA-GFDL/atmos_drivers.git" - cppdefs: "-DSPMD -DCLIMATE_NUDGE" - branch: "2022.01" - paths: ["atmos_drivers/coupled"] - otherFlags: *FMSincludes - - component: "ice_sis" - requires: ["FMS", "ice_param", "mom6"] - repo: "https://gitlab.gfdl.noaa.gov/FMS/ice_sis.git" - branch: "2021.02" - otherFlags: !join [*FMSincludes, " ", *momIncludes] - - component: "ice_param" - repo: "https://github.com/NOAA-GFDL/ice_param.git" - cppdefs: "-Duse_yaml -Duse_libMPI -Duse_netCDF" - branch: "2021.02" - requires: ["FMS", "mom6"] - otherFlags: !join [*FMSincludes," ", *momIncludes] - - component: "land_lad2" - requires: ["FMS"] - repo: "https://gitlab.gfdl.noaa.gov/FMS/land_lad2.git" - branch: "2022.01" - branch: "land_lad2_2021.02" - doF90Cpp: True - cppdefs: "-DINTERNAL_FILE_NML" - otherFlags: *FMSincludes - - component: "mom6" - requires: ["FMS"] - paths: ["mom6/MOM6-examples/src/MOM6/config_src/dynamic", "mom6/MOM6-examples/src/MOM6/config_src/coupled_driver", "mom6/MOM6-examples/src/MOM6/src/*/", "mom6/MOM6-examples/src/MOM6/src/*/*/", "mom6/ocean_BGC/generic_tracers", "mom6/ocean_BGC/mocsy/src"] - branch: ["2021.02","dev/gfdl/2018.04.06"] - repo: ["https://github.com/NOAA-GFDL/ocean_BGC.git","https://github.com/NOAA-GFDL/MOM6-examples.git"] - makeOverrides: 'OPENMP=""' - otherFlags: !join [*FMSincludes, " ", *momIncludes] - - component: "FMScoupler" - paths: ["FMScoupler/full", "FMScoupler/shared"] - repo: "https://github.com/NOAA-GFDL/FMScoupler.git" - branch: "2022.01" - requires: ["FMS", "atmos_drivers", "am5_phys", "land_lad2", "ice_sis", "ice_param", "mom6"] - otherFlags: !join [*FMSincludes, " ", *momIncludes] diff --git a/fre/make/tests/AM5_example/yaml_include/platforms.yaml b/fre/make/tests/AM5_example/yaml_include/platforms.yaml deleted file mode 100644 index 0c8bac45..00000000 --- a/fre/make/tests/AM5_example/yaml_include/platforms.yaml +++ /dev/null @@ -1,28 +0,0 @@ -platforms: - - name: ncrc5.intel - compiler: intel - modulesInit: [" module use -a /ncrc/home2/fms/local/modulefiles \n","source $MODULESHOME/init/sh \n"] - modules: [ !join [*INTEL, "/2022.2.1"],"fre/bronx-20",cray-hdf5/1.12.2.3, cray-netcdf/4.9.0.3] - fc: ftn - cc: cc - mkTemplate: !join ["/ncrc/home2/fms/local/opt/fre-commands/bronx-20/site/ncrc5/", *INTEL, ".mk"] - modelRoot: ${HOME}/fremake_canopy/test - - name: ncrc5.intel23 - compiler: intel - modulesInit: [" module use -a /ncrc/home2/fms/local/modulefiles \n","source $MODULESHOME/init/sh \n"] - modules: [!join [*INTEL, "/2023.1.0"],"fre/bronx-20",cray-hdf5/1.12.2.3, cray-netcdf/4.9.0.3] - fc: ftn - cc: cc - mkTemplate: !join ["/ncrc/home2/fms/local/opt/fre-commands/bronx-20/site/ncrc5/", *INTEL, ".mk"] - modelRoot: ${HOME}/fremake_canopy/test - - name: hpcme.2023 - compiler: intel - RUNenv: [". /spack/share/spack/setup-env.sh", "spack load libyaml", "spack load netcdf-fortran@4.5.4", "spack load hdf5@1.14.0"] - modelRoot: /apps - fc: mpiifort - cc: mpiicc - container: True - containerBuild: "podman" - containerRun: "apptainer" - containerBase: "ecpe4s/noaa-intel-prototype:2023.09.25" - mkTemplate: "/apps/mkmf/templates/hpcme-intel21.mk" diff --git a/fre/make/tests/AM5_example/yaml_include/pp.c96_amip.yaml b/fre/make/tests/AM5_example/yaml_include/pp.c96_amip.yaml deleted file mode 100644 index 117c66c6..00000000 --- a/fre/make/tests/AM5_example/yaml_include/pp.c96_amip.yaml +++ /dev/null @@ -1,88 +0,0 @@ -# local reusable variable overrides -fre_properties: - - &custom_interp "180,360" - -# directory overrides -#c96_amip_directories: -directories: - <<: *shared_directories - ptmp_dir: "/ptmp/$USER" - pp_grid_spec: *GRID_SPEC96 - -#c96_amip_postprocess: -postprocess: - # pp setting overrides - settings: - <<: *shared_settings - pp_start: *ANA_AMIP_START - pp_stop: *ANA_AMIP_END - pp_chunk_a: *PP_AMIP_CHUNK96 - pp_components: "atmos atmos_scalar" - switches: - <<: *shared_switches - do_statics: False - - # main pp instructions - components: - - type: "atmos_cmip" - sources: "atmos_month_cmip atmos_8xdaily_cmip atmos_daily_cmip" - sourceGrid: "cubedsphere" - xyInterp: *custom_interp - interpMethod: "conserve_order2" - inputRealm: 'atmos' - - type: "atmos" - sources: "atmos_month" - sourceGrid: "cubedsphere" - xyInterp: *PP_XYINTERP96 - interpMethod: "conserve_order2" - inputRealm: 'atmos' - - type: "atmos_level_cmip" - sources: "atmos_level_cmip" - sourceGrid: "cubedsphere" - xyInterp: *PP_XYINTERP96 - interpMethod: "conserve_order2" - inputRealm: 'atmos' - - type: "atmos_level" - sources: "atmos_month" - sourceGrid: "cubedsphere" - xyInterp: *PP_XYINTERP96 - interpMethod: "conserve_order2" - inputRealm: 'atmos' - - type: "atmos_month_aer" - sources: "atmos_month_aer" - sourceGrid: "cubedsphere" - xyInterp: *PP_XYINTERP96 - interpMethod: "conserve_order1" - inputRealm: 'atmos' - - type: "atmos_diurnal" - sources: "atmos_diurnal" - sourceGrid: "cubedsphere" - xyInterp: *PP_XYINTERP96 - interpMethod: "conserve_order2" - inputRealm: 'atmos' - - type: "atmos_scalar" - sources: "atmos_scalar" - - type: "aerosol_cmip" - xyInterp: *PP_XYINTERP96 - sources: "aerosol_month_cmip" - sourceGrid: "cubedsphere" - interpMethod: "conserve_order1" - inputRealm: 'atmos' - - type: "land" - sources: "land_month" - sourceGrid: "cubedsphere" - xyInterp: *PP_XYINTERP96 - interpMethod: "conserve_order1" - inputRealm: 'land' - - type: "land_cmip" - sources: "land_month_cmip" - sourceGrid: "cubedsphere" - xyInterp: *PP_XYINTERP96 - interpMethod: "conserve_order1" - inputRealm: 'land' - - type: "tracer_level" - sources: "atmos_tracer" - sourceGrid: "cubedsphere" - xyInterp: *PP_XYINTERP96 - interpMethod: "conserve_order1" - inputRealm: 'atmos' diff --git a/fre/make/tests/test_create_compile.py b/fre/make/tests/test_create_compile.py new file mode 100644 index 00000000..ab73128d --- /dev/null +++ b/fre/make/tests/test_create_compile.py @@ -0,0 +1,163 @@ +""" +Test fre make create-compile +""" +import os +import shutil +import pytest +from pathlib import Path +from fre.make import create_compile_script + +## SET-UP +TEST_DIR = Path("fre/make/tests") +NM_EXAMPLE = Path("null_example") +YAMLFILE = "null_model.yaml" +PLATFORM = ["ci.gnu"] +TARGET = ["debug"] +EXPERIMENT = "null_model_full" + +# Multi-plat-targ +MULTI_TARGET = ["prod","repro"] + +# Bad plat/targ +BAD_PLATFORM=["no_plat"] +BAD_TARGET=["no_targ"] + +# Create output location +OUT = f"{TEST_DIR}/compile_out" +if Path(OUT).exists(): + # remove + shutil.rmtree(OUT) + # create output directory + Path(OUT).mkdir(parents=True,exist_ok=True) +else: + Path(OUT).mkdir(parents=True,exist_ok=True) + +def test_modelyaml_exists(): + """ + Check the model yaml exists + """ + assert Path(f"{TEST_DIR}/{NM_EXAMPLE}/{YAMLFILE}").exists() + +def test_compileyaml_exists(): + """ + Check the compile yaml exists + """ + assert Path(f"{TEST_DIR}/{NM_EXAMPLE}/compile.yaml").exists() + +def test_platformyaml_exists(): + """ + Check the platform yaml exists + """ + assert Path(f"{TEST_DIR}/{NM_EXAMPLE}/platforms.yaml").exists() + +def test_compile_creation(): + """ + Check for the creation of the compile script + """ + # Set environment variable for use in ci.gnu platform + os.environ["TEST_BUILD_DIR"] = OUT + + plat = PLATFORM[0] + targ = TARGET[0] + yamlfile_path = f"{TEST_DIR}/{NM_EXAMPLE}/{YAMLFILE}" + + # Create the compile script + create_compile_script.compile_create(yamlfile_path, PLATFORM, TARGET, 4, 1, False, False) + # Check for creation of compile script + assert Path(f"{OUT}/fremake_canopy/test/null_model_full/{plat}-{targ}/exec/compile.sh").exists() + +def test_compile_execution(): + """ + Check for the successful execution of the compile script + """ + # Set environment variable for use in ci.gnu platform + os.environ["TEST_BUILD_DIR"] = OUT + + plat = PLATFORM[0] + targ = TARGET[0] + yamlfile_path = f"{TEST_DIR}/{NM_EXAMPLE}/{YAMLFILE}" + + # Execute the compile script + create_compile_script.compile_create(yamlfile_path, PLATFORM, TARGET, 4, 1, True, False) + + # Check for creation of compile script + # Check for FMS directory + # Check for log.compile file + assert [Path(f"{OUT}/fremake_canopy/test/null_model_full/{plat}-{targ}/exec/compile.sh").exists(), + Path(f"{OUT}/fremake_canopy/test/null_model_full/{plat}-{targ}/exec/FMS").is_dir(), + Path(f"{OUT}/fremake_canopy/test/null_model_full/{plat}-{targ}/exec/log.compile")] + +@pytest.mark.xfail(raises=AttributeError) +def test_bad_platform(): + """ + Check for the failure of compile script creation + due to a bad platform passed. + """ + # Set environment variable for use in ci.gnu platform + os.environ["TEST_BUILD_DIR"] = OUT + + yamlfile_path = f"{TEST_DIR}/{NM_EXAMPLE}/{YAMLFILE}" + + # Create the compile script + create_compile_script.compile_create(yamlfile_path, BAD_PLATFORM, TARGET, 4, 1, False, False) + +def test_bad_platform_compilelog(): + """ + Check that compile log still created from the failure + of compile script creation due to a bad platform passed. + """ + # Set environment variable for use in ci.gnu platform + os.environ["TEST_BUILD_DIR"] = OUT + + yamlfile_path = f"{TEST_DIR}/{NM_EXAMPLE}/{YAMLFILE}" + + try: + # Create the compile script + create_compile_script.compile_create(yamlfile_path, BAD_PLATFORM, TARGET, 4, 1, False, False) + except: + assert Path(f"{OUT}/fremake_canopy/test/null_model_full/{BAD_PLATFORM}-{TARGET}/exec/log.compile") + +@pytest.mark.xfail(raises=ValueError) +def test_bad_target(): + """ + Check for the failure of compile script creation + due to a bad target passed. + """ + # Set environment variable for use in ci.gnu platform + os.environ["TEST_BUILD_DIR"] = OUT + + yamlfile_path = f"{TEST_DIR}/{NM_EXAMPLE}/{YAMLFILE}" + + # Create the compile script + create_compile_script.compile_create(yamlfile_path, PLATFORM, BAD_TARGET, 4, 1, False, False) + +def test_bad_target_compilelog(): + """ + Check that compile log still created from the failure + of compile script creation due to a bad target passed. + """ + # Set environment variable for use in ci.gnu platform + os.environ["TEST_BUILD_DIR"] = OUT + + yamlfile_path = f"{TEST_DIR}/{NM_EXAMPLE}/{YAMLFILE}" + + try: + # Create the compile script + create_compile_script.compile_create(yamlfile_path, PLATFORM, BAD_TARGET, 4, 1, False, False) + except: + assert Path(f"{OUT}/fremake_canopy/test/null_model_full/{BAD_PLATFORM}-{TARGET}/exec/log.compile") + +def test_multi_target(): + """ + Check for the creation of the compile script for each target passed + """ + # Set environment variable for use in ci.gnu platform + os.environ["TEST_BUILD_DIR"] = OUT + + yamlfile_path = f"{TEST_DIR}/{NM_EXAMPLE}/{YAMLFILE}" + + # Create the compile script + create_compile_script.compile_create(yamlfile_path, PLATFORM, MULTI_TARGET, 4, 1, False, False) + + assert [Path(f"{OUT}/fremake_canopy/test/null_model_full/{PLATFORM[0]}-{MULTI_TARGET[0]}/exec/compile.sh").exists(), + Path(f"{OUT}/fremake_canopy/test/null_model_full/{PLATFORM[0]}-{MULTI_TARGET[1]}/exec/compile.sh").exists()] diff --git a/fre/tests/test_fre_make_cli.py b/fre/tests/test_fre_make_cli.py index 279760b3..d96c41d7 100644 --- a/fre/tests/test_fre_make_cli.py +++ b/fre/tests/test_fre_make_cli.py @@ -23,10 +23,10 @@ def test_cli_fre_make_opt_dne(): assert result.exit_code == 2 def test_cli_fre_make_create_checkout_baremetal(): - ''' fre make create-checkout -y am5.yaml -p ncrc5.intel23 -t debug''' + ''' fre make create-checkout -y null_model.yaml -p ncrc5.intel23 -t debug''' # Set paths and click options test_dir = Path("fre/tests") - yamlfile = Path("fre/make/tests/AM5_example/") + yamlfile = Path("fre/make/tests/null_example") platform = "ncrc5.intel23" target = "debug" @@ -38,23 +38,23 @@ def test_cli_fre_make_create_checkout_baremetal(): os.environ["HOME"]=str(Path(out_path)) # run create-checkout - result = runner.invoke(fre.fre, args=["make", "create-checkout", "-y", f"{yamlfile}/am5.yaml", "-p", platform, "-t", target]) + result = runner.invoke(fre.fre, args=["make", "create-checkout", "-y", f"{yamlfile}/null_model.yaml", "-p", platform, "-t", target]) # Check for successful command, creation of checkout script, and that script is executable (os.access - checks is file has specific access mode, os.X_OK - checks executable permission) assert all ([result.exit_code == 0, - Path(f"{out_path}/fremake_canopy/test/am5/src/checkout.sh").exists(), - os.access(Path(f"{out_path}/fremake_canopy/test/am5/src/checkout.sh"), os.X_OK)]) + Path(f"{out_path}/fremake_canopy/test/null_model_full/src/checkout.sh").exists(), + os.access(Path(f"{out_path}/fremake_canopy/test/null_model_full/src/checkout.sh"), os.X_OK)]) def test_cli_fre_make_create_checkout_container(): - ''' fre make create-checkout -y am5.yaml -p hpcme.2023 -t debug''' + ''' fre make create-checkout -y null_model.yaml -p hpcme.2023 -t debug''' # Set paths and click options test_dir = Path("fre/tests") - yamlfile = Path("fre/make/tests/AM5_example/") + yamlfile = Path("fre/make/tests/null_example/") platform = "hpcme.2023" target = "debug" # run create-checkout - result = runner.invoke(fre.fre, args=["make", "create-checkout", "-y", f"{yamlfile}/am5.yaml", "-p", platform, "-t", target]) + result = runner.invoke(fre.fre, args=["make", "create-checkout", "-y", f"{yamlfile}/null_model.yaml", "-p", platform, "-t", target]) # Check for successful command, creation of checkout script, and that script is executable (os.access - checks is file has specific access mode, os.X_OK - checks executable permission) assert all ([result.exit_code == 0,