Skip to content
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

Executing a Singularity Test fails #1304

Closed
sylabskeith-zz opened this issue Feb 14, 2018 · 2 comments
Closed

Executing a Singularity Test fails #1304

sylabskeith-zz opened this issue Feb 14, 2018 · 2 comments

Comments

@sylabskeith-zz
Copy link

Version of Singularity:

2.4.2

Expected behavior

BootStrap: docker
From: alpine:latest

%test
[[ -z "$THIS_IS_A_TEST" ]] && echo "Environment is not loaded." >&2
echo "test: THIS_IS_A_TEST=$THIS_IS_A_TEST"

%runscript
[[ -z "$THIS_IS_A_TEST" ]] && echo "Environment is not loaded." >&2
echo "runscript: THIS_IS_A_TEST=$THIS_IS_A_TEST"

%post
apk update
apk add bash
echo 'export THIS_IS_A_TEST=TRUE' >> /environment

###Actual Behavior

  1. The environment is not loaded before test during bootstrap
  2. Singularity test command is failing with this msg: "No Singularity tests for contained app:"
This was referenced Feb 26, 2018
@dtrudg
Copy link
Contributor

dtrudg commented Mar 9, 2018

Hi @sylabskeith

  1. is fixed by the Fix test check #1335 that was merged into the 2.4.3 release:
$ singularity test test.img
test: THIS_IS_A_TEST=TRUE
  1. is not - the environment is not loaded for test during build:
Running test scriptlet
+ [[ -z  ]]
+ echo Environment is not loaded.
Environment is not loaded.
+ echo test: THIS_IS_A_TEST=
test: THIS_IS_A_TEST=

This is by design from a change implemented in #1071 where the rationale was discussed in #1053 - environment is no longer sourced during the build.

@dtrudg
Copy link
Contributor

dtrudg commented Apr 28, 2018

@sylabskeith - closing this as the fix for behaviour (2) has been merged, and (1) is by design, as above. Let us know if any further issue. Thanks.

@dtrudg dtrudg closed this as completed Apr 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants