Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 27 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,39 @@ jobs:
echo "export PATH=$PREFIX/bin:$PATH" >> ~/env
echo "export PYTHONPATH=$(ls -d $PREFIX/lib/python*/site-packages)" >> ~/env

- name: Test init (without EESSI mounted)
- name: Test 'eessi init' (without EESSI mounted)
run: |
source ~/env
eessi init 2>&1 | grep "^ERROR: /cvmfs/software.eessi.io/versions/2023.06 does not exist"

- name: Mount EESSI
uses: eessi/github-action-eessi@e1f8f20638ea417a18d23ab29443ee34794ff900 # v3.1.0
- name: Test 'eessi shell' (without EESSI mounted)
run: |
source ~/env
eessi shell --eessi-version 2023.06 2>&1 | tee shell.out
grep "No such file or directory" shell.out
grep "^ERROR: Non-zero exit code detected for interactive shell" shell.out

- name: Test init
- name: Mount EESSI CernVM-FS repository
uses: cvmfs-contrib/github-action-cvmfs@bc6dae3b3c00a732994bacfac8f0902a3e422c53 # v5.4
with:
cvmfs_repositories: 'software.eessi.io'

- name: Test 'eessi init'
run: |
source ~/env
eessi init
eval "$(eessi init)"

- name: Test 'eessi shell'
run: |
source ~/env

echo ">>> checking behaviour of 'eessi shell' without specifying EESSI version to use..."
eessi shell 2>&1 | tee shell.out
grep "EESSI version to use is not specified" shell.out

echo ">>> checking environment of subshell created with 'eessi shell' for EESSI 2023.06"
eessi shell --eessi-version 2023.06 <<< 'env | grep ^EESSI' 2>&1 | tee shell.out
grep '^Found EESSI repo @ /cvmfs/software.eessi.io/versions/2023.06' shell.out
grep '^Environment set up to use EESSI (2023.06), have fun' shell.out
grep '^EESSI_VERSION=2023.06' shell.out
2 changes: 1 addition & 1 deletion src/eessi/cli/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ def shell(
with open(init_file, 'w') as fp:
fp.write(f"set -e; source /cvmfs/software.eessi.io/versions/{eessi_version}/init/bash")

res = subprocess.run(['/bin/bash', '--init-file', init_file])
res = subprocess.run(['/bin/bash', '--init-file', init_file, '-i'])
if res.returncode != 0:
report_error("ERROR: Non-zero exit code detected for interactive shell!", exit_code=res.returncode)