Feature/unit tests #28

Merged
merged 8 commits into from Jul 27, 2016

Conversation

Projects
None yet
2 participants

petevg commented Jul 1, 2016

No longer a Work In Progress; this is ready for review!

These are basic tests for layer-apache-bigtop-base. I'd appreciate feedback on technique (too mock-y, just mock-y enough?).

@juju-solutions/bigdata

+ def site_yaml(self):
+ '''Path to the site_yaml config file.'''
+ return self._site_yaml
+
@petevg

petevg Jul 6, 2016

Moved these here to make them override-able in the tests. Also helps with introspection.

@petevg petevg changed the title from [WIP] Feature/unit tests to Feature/unit tests Jul 7, 2016

Member

kwmonroe commented Jul 27, 2016

This looks great for the bigtop base layer, but we have a problem for any charm built from it. The tox.ini here is overwritten by the tox.ini in layer-basic, which clobbers stuff like the -runit_test_requiresments.txt dep handler.

This is a problem because tox on a built charm will fail when it tries to run py.test -v and hits the ./tests/unit/* stuff brought in by the bigtop base layer. I suggest adding ./tests/unit to the ignores for the bigtop-base layer so these tests don't wind up in the built charms.

--- a/layer.yaml
+++ b/layer.yaml
@@ -2,6 +2,8 @@ includes:
   - 'layer:basic'
   - 'layer:puppet-agent'
   - 'interface:java'
+ignore:
+  - 'tests/unit'
 options:
   basic:
     packages:
Added unit test dir to "ignore" list in layer.yaml.
Also changed tox.ini -> tox-unit.ini, and updated the README
instructions on running unit tests to match.

This fixes an issue where the unit tests were clobbering tests in layers
that used this layer.
-making the tests more or less verbose, edit tox.ini.
+To run unit tests for this layer, change to the root directory of the
+layer in a terminal, and run "tox -c tox_unit.ini". To tweak settings,
+such as making the tests more or less verbose, edit tox-unit.ini.
@kwmonroe

kwmonroe Jul 27, 2016

Member

tox-unit.ini? file not found.

:)

Member

kwmonroe commented Jul 27, 2016

LGTM

@kwmonroe kwmonroe merged commit b4d64ba into master Jul 27, 2016

@kwmonroe kwmonroe deleted the feature/unit-tests branch Mar 29, 2017

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