Skip to content

Commit 0511d6f

Browse files
committed
check for EasyBuild instead of Python in the given EESSI version
1 parent 698d6a5 commit 0511d6f

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

.github/workflows/scripts/test_init_scripts.sh

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ if [ -z ${EESSI_VERSION} ] || [ ! -d /cvmfs/software.eessi.io/versions/${EESSI_V
66
exit 1
77
fi
88

9+
declare -A EXPECTED_EASYBUILD_VERSION_IN_EESSI=(
10+
["2023.06"]="5.1.1"
11+
["2025.06"]="5.1.1"
12+
)
13+
914
# initialize assert framework
1015
if [ ! -d assert.sh ]; then
1116
echo "assert.sh not cloned."
@@ -34,15 +39,17 @@ for shell in ${SHELLS[@]}; do
3439
assert_raises 'echo "${MODULE_SECTIONS[1]}" | grep -E "$PATTERN"'
3540
# TEST 3: Check if module overviews second section is the EESSI init module
3641
assert "echo ${MODULE_SECTIONS[4]}" "/cvmfs/software.eessi.io/versions/$EESSI_VERSION/init/modules"
37-
# Test 4: Load Python module and check version
38-
command="$shell -c 'source init/lmod/$shell 2>/dev/null; module load Python/3.10.8-GCCcore-12.2.0; python --version'"
39-
expected="Python 3.10.8"
40-
assert "$command" "$expected"
41-
# Test 5: Load Python module and check path
42-
PYTHON_PATH=$($shell -c "source init/lmod/$shell 2>/dev/null; module load Python/3.10.8-GCCcore-12.2.0; which python")
43-
PATTERN="/cvmfs/software\.eessi\.io/versions/$EESSI_VERSION/software/linux/x86_64/(intel/haswell|amd/zen3)/software/Python/3\.10\.8-GCCcore-12\.2\.0/bin/python"
44-
echo "$PYTHON_PATH" | grep -E "$PATTERN"
45-
assert_raises 'echo "$PYTHON_PATH" | grep -E "$PATTERN"'
42+
# Test 4: Load EasyBuild module and check version
43+
EASYBUILD_VERSION=${EXPECTED_EASYBUILD_VERSION_IN_EESSI[${EESSI_VERSION}]}
44+
# eb --version outputs: "This is EasyBuild 5.1.1 (framework: 5.1.1, easyblocks: 5.1.1) on host ..."
45+
command="$shell -c 'source init/lmod/$shell 2>/dev/null; module load EasyBuild/${EASYBUILD_VERSION}; eb --version | cut -d \" \" -f4'"
46+
assert "$command" "$EASYBUILD_VERSION"
47+
# Test 5: Load EasyBuild module and check path
48+
EASYBUILD_PATH=$($shell -c "source init/lmod/$shell 2>/dev/null; module load EasyBuild/${EASYBUILD_VERSION}; which eb")
49+
# escape the dots in ${EASYBUILD_VERSION}
50+
PATTERN="/cvmfs/software\.eessi\.io/versions/$EESSI_VERSION/software/linux/x86_64/(intel/haswell|amd/zen3)/software/EasyBuild/${EASYBUILD_VERSION//./\\.}/bin/eb"
51+
echo "$EASYBUILD_PATH" | grep -E "$PATTERN"
52+
assert_raises 'echo "$EASYBUILD_PATH" | grep -E "$PATTERN"'
4653

4754
#End Test Suite
4855
assert_end "source_eessi_$shell"

0 commit comments

Comments
 (0)