Skip to content

Commit

Permalink
improve naming of slurm integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bcumming committed Aug 26, 2024
1 parent 3e534e4 commit 55ab5f3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion test/integration/common.bash
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function run_sbatch_unchecked() {
logf "+ job log (${slurm_log}):\n$(cat ${slurm_log})"
rm -f "${slurm_log}"

echo "+ exit status: ${status}"
echo "+ exit status from sbatch: ${status}"
}

function run_sbatch() {
Expand Down
16 changes: 8 additions & 8 deletions test/integration/slurm.bats
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ function setup() {
load ./common

export REPOS=$(realpath ../scratch/repos)

unset UENV_MOUNT_LIST
}

function teardown() {
Expand All @@ -16,12 +18,12 @@ function teardown() {
@test "noargs" {
# nothing is done if no --uenv is present and UENV_MOUNT_LIST is empty
unset UENV_MOUNT_LIST
unset UENV_REPO_PATH
run_srun_unchecked bash -c 'findmnt -r | grep /user-environment'
refute_output --partial '/user-environment'
}

@test "mount uenv" {
unset UENV_MOUNT_LIST
export UENV_REPO_PATH=$REPOS/apptool

# if no mount point is provided the default provided by the uenv's meta
Expand Down Expand Up @@ -61,7 +63,6 @@ function teardown() {
}

@test "views" {
unset UENV_MOUNT_LIST
export UENV_REPO_PATH=$REPOS/apptool

# if the view is mounted, the app should be visible
Expand Down Expand Up @@ -107,24 +108,21 @@ function teardown() {
}

@test "custom mount point" {
unset UENV_MOUNT_LIST
export UENV_REPO_PATH=$REPOS/apptool

run_srun_unchecked --uenv=app/42.0:/user-environment bash -c 'findmnt -r | grep /user-environment'
assert_output --partial "/user-environment"
}

@test "duplicate_mount_fails" {
unset UENV_MOUNT_LIST
@test "duplicate mount fails" {
export UENV_REPO_PATH=$REPOS/apptool

# duplicate images fail
run_srun_unchecked --uenv=tool:/user-environment,app/42.0:/user-environment true
assert_output --partial "more than one image mounted at the mount point '/user-environment'"
}

@test "duplicate_image_fails" {
unset UENV_MOUNT_LIST
@test "duplicate image fails" {
export UENV_REPO_PATH=$REPOS/apptool

# duplicate images fail
Expand All @@ -133,11 +131,13 @@ function teardown() {
}

@test "empty --uenv argument" {
export UENV_REPO_PATH=$REPOS/apptool
run_srun_unchecked --uenv='' true
assert_output --partial 'invalid uenv description'
}

@test "sbatch_override_in_srun" {
@test "sbatch override in srun" {
export UENV_REPO_PATH=$REPOS/apptool
# check that images mounted via sbatch --uenv are overriden when `--uenv` flag is given to srun
run_sbatch <<EOF
#!/bin/bash
Expand Down

0 comments on commit 55ab5f3

Please sign in to comment.