Need an option to preserve specified environment variables, a la 'juju test -p' #17

Closed
ryan-beisner opened this Issue Apr 30, 2015 · 1 comment

Comments

Projects
None yet
2 participants
Contributor

ryan-beisner commented Apr 30, 2015

With the current juju test tools, the -p option can be used to specify environment variables to be preserved and passed into each test. CI automation environments sometimes rely on that functionality. Please consider adding a comparable feature to bundletester.

@ryan-beisner ryan-beisner changed the title from Need an option to preserve specified environment variables, a la 'juju test -P' to Need an option to preserve specified environment variables, a la 'juju test -p' May 4, 2015

@tvansteenburgh tvansteenburgh self-assigned this Mar 16, 2016

Member

tvansteenburgh commented Mar 16, 2016

All env vars are preserved by default, and made available to each test that is run. I tested this by printing $AMULET_SETUP_TIMEOUT from within both a bash and python test file in the following test:

(.venv)tvansteenburgh@trusty-vm:~/src/charms/trusty/meteor> AMULET_SETUP_TIMEOUT=300 bundletester -Fvl DEBUG
DEBUG:bundletester.utils:Updating JUJU_ENV: "" -> "local"
DEBUG:root:Bootstrap environment: local
DEBUG:deployer.env:Connecting to environment...
DEBUG:deployer.env:Connected to environment
DEBUG:deployer.env: Terminating machines forcefully
DEBUG:root:Waiting for services to be removed...
DEBUG:runner:call ['/home/tvansteenburgh/src/bundletester/.venv/bin/charm-proof'] (cwd: /tmp/bundletester-LyVB46/meteor)
DEBUG:runner:E: Unknown root metadata field (series)
DEBUG:runner:Exit Code: 200
meteor
    charm-proof                                                            FAIL
DEBUG:deployer.env: Terminating machines forcefully
DEBUG:root:Waiting for services to be removed...
DEBUG:runner:call ['/tmp/bundletester-LyVB46/meteor/tests/00-setup'] (cwd: /tmp/bundletester-LyVB46/meteor)
DEBUG:runner:AMULET_SETUP_TIMEOUT=300
DEBUG:runner:Exit Code: 0
    00-setup                                                               PASS
DEBUG:deployer.env: Terminating machines forcefully
DEBUG:root:Waiting for services to be removed...
DEBUG:runner:call ['/tmp/bundletester-LyVB46/meteor/tests/10-deploy'] (cwd: /tmp/bundletester-LyVB46/meteor)
DEBUG:runner:AMULET_SETUP_TIMEOUT=300
DEBUG:runner:Exit Code: 0
    10-deploy                                                              PASS
DEBUG:bundletester.utils:Updating JUJU_ENV: "local" -> ""

------------------------------------------------------------------------------
FAIL: meteor::charm-proof
[/home/tvansteenburgh/src/bundletester/.venv/bin/charm-proof exit 200]
E: Unknown root metadata field (series)

FAIL: 1 PASS: 2 Total: 3 (0.182784 sec)
(.venv)1 tvansteenburgh@trusty-vm:~/src/charms/trusty/meteor> 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment