Bundletester "passes" and exits cleanly when passed a test filename that does not exist #54

Closed
ryan-beisner opened this Issue Aug 9, 2016 · 3 comments

Comments

Projects
None yet
2 participants
Contributor

ryan-beisner commented Aug 9, 2016

Bundletester "passes" and exits cleanly when passed a test filename that does not exist. It essentially bootstrapped then destroyed and exited 0.

I would expect it to fail early in this case.

func27-smoke runtests: commands[0] | bundletester -vl DEBUG -r json -o func-results.json gate-basic-xenial-mitaka --no-destroy
DEBUG:bundletester.utils:Updating JUJU_ENV: "" -> "osci-sv14"
DEBUG:root:Bootstrap environment: osci-sv14
INFO:root:Bootstrapping Juju Environment...
INFO:deployer.env:bootstrapping, this might take a while...
INFO:deployer.env: Bootstrap complete
DEBUG:deployer.env:Connecting to environment...
/var/lib/jenkins/workspace/test_charm_amulet_smoke/asset/barbican/.tox/py27/local/lib/python2.7/site-packages/jujuclient/connector.py:18: RuntimeWarning: This version of Python does not support TLSv1.2. Please use Python 2.7.9+ or 3.4+ instead. Attempting to use TLSv1 - may not work with all versions of Juju.
  'all versions of Juju.', RuntimeWarning)
DEBUG:deployer.env:Connected to environment
DEBUG:deployer.env: Terminating machines forcefully
DEBUG:root:Waiting for applications to be removed...
DEBUG:runner:call ['/var/lib/jenkins/workspace/test_charm_amulet_smoke/asset/barbican/.tox/py27/bin/charm-proof'] (cwd: /tmp/bundletester-DM9iEv/barbican)
DEBUG:runner:I: No icon.svg file.
DEBUG:runner:I: all charms should provide at least one thing
DEBUG:runner:I: config.yaml: option ssl_key has no default value
DEBUG:runner:I: config.yaml: option os-public-hostname has no default value
DEBUG:runner:I: config.yaml: option vip has no default value
DEBUG:runner:I: config.yaml: option ssl_cert has no default value
DEBUG:runner:I: config.yaml: option os-internal-network has no default value
DEBUG:runner:I: config.yaml: option os-admin-network has no default value
DEBUG:runner:I: config.yaml: option ssl_ca has no default value
DEBUG:runner:I: config.yaml: option os-public-network has no default value
DEBUG:runner:Exit Code: 0
DEBUG:bundletester.utils:Updating JUJU_ENV: "osci-sv14" -> ""
Contributor

ryan-beisner commented Aug 9, 2016

The impact to test automation is that an author can declare named test to run at gate, not include a test file at all, and have a test pass.

ryan-beisner added a commit to ryan-beisner/bundletester that referenced this issue Aug 9, 2016

Ensure test arguments and/or test patterns match when specified
This addresses issues where bundletester false test success is
occurring: when one or more specific test names are declared
as arguments, or a glob is defined as a test pattern, and
no executable files match, that should be expected to fail.

Closes #54

@tvansteenburgh tvansteenburgh closed this in #55 Aug 9, 2016

openstack-gerrit pushed a commit to openstack/charm-percona-cluster that referenced this issue Sep 8, 2016

Rename amulet smoke test file name
With tox.ini standardization in os-charms, it is
necessary for amulet smoke test file names to be
consistent.

Resolves issue introduced at:
https://review.openstack.org/#/c/366393/1/tox.ini

Which unexpectedly passed bundletester because of:
juju-solutions/bundletester#54

Change-Id: I7de92c8cf0a5233a5bb7e620522eee78f6ae0889
Contributor

chuckbutler commented Sep 20, 2016

Right but theres 3 things currently that bother me about this.

  1. Excludes dont appear to work, and we have some localized tests that are getting included when building charms. This means we have to sit through these tests even though they should only be run in specific contexts. Slow tests are better than no tests i guess?

  2. Our default base layer template includes 00-setup, which isn't encouraging the right behavior either.

  3. I should have the option to say NO TESTS IN THIS CHARM, LOOK AT THE BUNDLE and bundletester should respect that instead of failing me.

Contributor

ryan-beisner commented Sep 20, 2016

  1. Excludes aren't a bundletester bug. That should be addressed where the bug lives.

  2. 00-setup should go away altogether imho. Tests should not assume the test user can sudo anything.

  3. I believe you do have the option to say no tests in bundletester.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment