From 359a4571d3e424a13c0fb9ff3704f55d8a0a385b Mon Sep 17 00:00:00 2001 From: Thomas Roeblitz Date: Sat, 17 Feb 2024 21:50:49 +0100 Subject: [PATCH] source init script instead of running in compat layer --- run_tests.sh | 4 +- test_suite.sh | 110 ++++++++++++++++++++++++++------------------------ 2 files changed, 60 insertions(+), 54 deletions(-) diff --git a/run_tests.sh b/run_tests.sh index 677f078593..b622af4be3 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -21,4 +21,6 @@ source ${base_dir}/init/eessi_defaults ./run_in_compat_layer_env.sh "git clone https://github.com/EESSI/test-suite EESSI-test-suite" # Run the test suite -./run_in_compat_layer_env.sh ./test_suite.sh +#./run_in_compat_layer_env.sh ./test_suite.sh +# source init script instead of running in compat layer +./test_suite.sh diff --git a/test_suite.sh b/test_suite.sh index ba4975e2cb..87c52d3b64 100755 --- a/test_suite.sh +++ b/test_suite.sh @@ -74,60 +74,64 @@ fi TMPDIR=$(mktemp -d) echo ">> Setting up environment..." - -source $TOPDIR/init/minimal_eessi_env - -if [ -d $EESSI_CVMFS_REPO ]; then - echo_green "$EESSI_CVMFS_REPO available, OK!" -else - fatal_error "$EESSI_CVMFS_REPO is not available!" -fi - -# avoid that pyc files for EasyBuild are stored in EasyBuild installation directory -export PYTHONPYCACHEPREFIX=$TMPDIR/pycache - -echo ">> Determining software subdirectory to use for current build/test host..." -if [ -z $EESSI_SOFTWARE_SUBDIR_OVERRIDE ]; then - export EESSI_SOFTWARE_SUBDIR_OVERRIDE=$(python3 $TOPDIR/eessi_software_subdir.py $DETECTION_PARAMETERS) - echo ">> Determined \$EESSI_SOFTWARE_SUBDIR_OVERRIDE via 'eessi_software_subdir.py $DETECTION_PARAMETERS' script" -else - echo ">> Picking up pre-defined \$EESSI_SOFTWARE_SUBDIR_OVERRIDE: ${EESSI_SOFTWARE_SUBDIR_OVERRIDE}" -fi - -# Set all the EESSI environment variables (respecting $EESSI_SOFTWARE_SUBDIR_OVERRIDE) -# $EESSI_SILENT - don't print any messages -# $EESSI_BASIC_ENV - give a basic set of environment variables -EESSI_SILENT=1 EESSI_BASIC_ENV=1 source $TOPDIR/init/eessi_environment_variables - -if [[ -z ${EESSI_SOFTWARE_SUBDIR} ]]; then - fatal_error "Failed to determine software subdirectory?!" -elif [[ "${EESSI_SOFTWARE_SUBDIR}" != "${EESSI_SOFTWARE_SUBDIR_OVERRIDE}" ]]; then - fatal_error "Values for EESSI_SOFTWARE_SUBDIR_OVERRIDE (${EESSI_SOFTWARE_SUBDIR_OVERRIDE}) and EESSI_SOFTWARE_SUBDIR (${EESSI_SOFTWARE_SUBDIR}) differ!" -else - echo_green ">> Using ${EESSI_SOFTWARE_SUBDIR} as software subdirectory!" -fi - -echo ">> Initializing Lmod..." -source $EPREFIX/usr/share/Lmod/init/bash -ml_version_out=$TMPDIR/ml.out -ml --version &> $ml_version_out -if [[ $? -eq 0 ]]; then - echo_green ">> Found Lmod ${LMOD_VERSION}" -else - fatal_error "Failed to initialize Lmod?! (see output in ${ml_version_out}" -fi - -echo ">> Setting up \$MODULEPATH..." -# make sure no modules are loaded +#### +####source $TOPDIR/init/minimal_eessi_env +#### +####if [ -d $EESSI_CVMFS_REPO ]; then +#### echo_green "$EESSI_CVMFS_REPO available, OK!" +####else +#### fatal_error "$EESSI_CVMFS_REPO is not available!" +####fi +#### +##### avoid that pyc files for EasyBuild are stored in EasyBuild installation directory +####export PYTHONPYCACHEPREFIX=$TMPDIR/pycache +#### +####echo ">> Determining software subdirectory to use for current build/test host..." +####if [ -z $EESSI_SOFTWARE_SUBDIR_OVERRIDE ]; then +#### export EESSI_SOFTWARE_SUBDIR_OVERRIDE=$(python3 $TOPDIR/eessi_software_subdir.py $DETECTION_PARAMETERS) +#### echo ">> Determined \$EESSI_SOFTWARE_SUBDIR_OVERRIDE via 'eessi_software_subdir.py $DETECTION_PARAMETERS' script" +####else +#### echo ">> Picking up pre-defined \$EESSI_SOFTWARE_SUBDIR_OVERRIDE: ${EESSI_SOFTWARE_SUBDIR_OVERRIDE}" +####fi +#### +##### Set all the EESSI environment variables (respecting $EESSI_SOFTWARE_SUBDIR_OVERRIDE) +##### $EESSI_SILENT - don't print any messages +##### $EESSI_BASIC_ENV - give a basic set of environment variables +####EESSI_SILENT=1 EESSI_BASIC_ENV=1 source $TOPDIR/init/eessi_environment_variables +#### +####if [[ -z ${EESSI_SOFTWARE_SUBDIR} ]]; then +#### fatal_error "Failed to determine software subdirectory?!" +####elif [[ "${EESSI_SOFTWARE_SUBDIR}" != "${EESSI_SOFTWARE_SUBDIR_OVERRIDE}" ]]; then +#### fatal_error "Values for EESSI_SOFTWARE_SUBDIR_OVERRIDE (${EESSI_SOFTWARE_SUBDIR_OVERRIDE}) and EESSI_SOFTWARE_SUBDIR (${EESSI_SOFTWARE_SUBDIR}) differ!" +####else +#### echo_green ">> Using ${EESSI_SOFTWARE_SUBDIR} as software subdirectory!" +####fi +#### +####echo ">> Initializing Lmod..." +####source $EPREFIX/usr/share/Lmod/init/bash +####ml_version_out=$TMPDIR/ml.out +####ml --version &> $ml_version_out +####if [[ $? -eq 0 ]]; then +#### echo_green ">> Found Lmod ${LMOD_VERSION}" +####else +#### fatal_error "Failed to initialize Lmod?! (see output in ${ml_version_out}" +####fi +#### +####echo ">> Setting up \$MODULEPATH..." +##### make sure no modules are loaded +####module --force purge +##### ignore current $MODULEPATH entirely +####module unuse $MODULEPATH +####module use ${EESSI_SOFTWARE_PATH}/modules/all +####if [[ -z ${MODULEPATH} ]]; then +#### fatal_error "Failed to set up \$MODULEPATH?!" +####else +#### echo_green ">> MODULEPATH set up: ${MODULEPATH}" +####fi +#### module --force purge -# ignore current $MODULEPATH entirely -module unuse $MODULEPATH -module use ${EESSI_SOFTWARE_PATH}/modules/all -if [[ -z ${MODULEPATH} ]]; then - fatal_error "Failed to set up \$MODULEPATH?!" -else - echo_green ">> MODULEPATH set up: ${MODULEPATH}" -fi +source $TOPDIR/init/minimal_eessi_env +source /cvmfs/${EESSI_CVMFS_REPO}/versions/${EESSI_VERSION}/init/bash # Load the ReFrame module # Currently, we load the default version. Maybe we should somehow make this configurable in the future?