-
Notifications
You must be signed in to change notification settings - Fork 16
BF: workaround singularity bug to be able to run under /tmp/subdirectory #27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
7238c5e
BF: workaround to not use -c in singularity if under /tmp + bind updi…
yarikoptic 997de88
ENH(TST): add a test to verify ability to exec and have clean mounts …
yarikoptic 6781ad9
RF/ENH: create and use test_helpers with assert_equal etc
yarikoptic bd60efb
BF+ENH: assert_python_re_match to tollerate singularity WARNING msg i…
yarikoptic 7c8da3d
ENH: bind mount /etc/localtime if present locally
yarikoptic 81a9c3c
ENH: make test for being able to run under /tmp and /home parametric …
yarikoptic ad6130e
ENH: tabify bash tests code for consistent diff/formatting
yarikoptic d8959d9
[DATALAD RUNCMD] Replace ##/tmp with ##/tmp/ to avoid matches like /t…
yarikoptic 7f5aecf
Merge branch 'master' into yarikoptic/bf-sing-c
chaselgrove f11af65
skipping travis osx directory tests
chaselgrove 0d77eca
BF: tabify indentation in bats scripts/tests
yarikoptic File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# Messaging | ||
debug () { | ||
[ -z "$DEBUG_BATS" ] || echo " DEBUG: $@" >&3 | ||
} | ||
|
||
debug_run () { | ||
debug "> lines=${lines[@]}" | ||
debug "> STATUS=$status" | ||
} | ||
|
||
fail_msg () { | ||
echo -e "FAIL: $@" >&3 | ||
} | ||
|
||
fail () { | ||
fail_msg "$@" | ||
exit 1 | ||
} | ||
|
||
error () { | ||
echo -e "ERROR: $@" >&3 | ||
exit 2 | ||
} | ||
|
||
# Assertion helpers | ||
|
||
assert_equal () { | ||
if [ "$#" != 2 ]; then | ||
error "Got $# arguments to eq whenever expected 2" | ||
fi | ||
if [ "$1" != "$2" ]; then | ||
fail "Arguments are not equal.\n #1=<<$1>>\n #2=<<$2>>" | ||
fi | ||
} | ||
|
||
assert_python_re_match () { | ||
if ! python -c 'import re, sys; assert re.match(sys.argv[1], sys.argv[2], flags=re.DOTALL)' "$1" "$2"; then | ||
fail "<<$2>>\ndid not match\n<<$1>>" | ||
fi | ||
} | ||
|
||
assert_clean_exit () { | ||
assert_equal "$status" 0 | ||
} | ||
|
||
|
||
# Misc helpers | ||
|
||
pull_singularity_shim () { | ||
# make sure that we have our shim docker image so its pulling does not | ||
# leak into output of scripts/singularity_cmd | ||
if ! docker pull mjtravers/singularity-shim:latest; then | ||
skip "Failed to pull singularity shim" | ||
fi | ||
} | ||
|
||
skip_if_travis_osx() { | ||
if [ "$TRAVIS_OS_NAME" = osx ] | ||
then | ||
skip "$@" | ||
fi | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general I'm not thrilled about referencing globals, but I can see the utility here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, me neither -- but here I liked how succinct test code then looks ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the plan to replace these custom assert functions with the ones that duplicate in the ztombol/bats-assert library?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so -- better to reuse than to rebrew ;)