Skip to content

Commit

Permalink
source init script instead of running in compat layer
Browse files Browse the repository at this point in the history
  • Loading branch information
truib committed Feb 17, 2024
1 parent d56a9cd commit 359a457
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 54 deletions.
4 changes: 3 additions & 1 deletion run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
110 changes: 57 additions & 53 deletions test_suite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down

0 comments on commit 359a457

Please sign in to comment.