Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Added test harness for Bigtop. #59
Conversation
|
I like it, nice and clean. I'm glad that you were able to avoid patching One question I have is why you went with mocking during As for where it should live, I think this is reasonable for sorting out the approach, but I think our goal should be to make the common bits available to others, perhaps in a For reference, the goal here is to be able to unit test layers pre-charm-build, getting around the fact that the API code for the base layers isn't available by mocking the modules provided by base layers. The caveat of this approach is that the charm code that imports the mocked modules must be imported at run-time in |
petevg
commented
Jul 7, 2016
•
|
@johnsca Thanks for the feedback. I'm not sure that this is the right place for this code to live -- I'm open to suggestions for other places to put it. To answer you question: I mocked out during setUp, because I wanted to make sure that that last_status handler got cleared between tests, and I wasn't too worried about efficiency -- I think that it's usually better to spend a bit of extra time in setUp and tearDown, if you can guarantee clean mocks for people, especially when the mocks live in a harness, instead of being created by the person writing the tests. |
petevg
commented
Jul 7, 2016
|
Come to think of it, I should maybe move the cleanup of the unit state db in to tearDown -- it's another thing that should probably be reset between tests :-) |
|
I was thinking that mocking the imports in For resetting the statuses, you could always add |
ktsakalozos
reviewed
Jul 8, 2016
| +import unittest | ||
| + | ||
| + | ||
| +class BigtopHarness(unittest.TestCase): |
petevg
commented
Jul 19, 2016
|
Closing, as we are actually putting this in its own repo (jujusolutions/charms.unit) |
petevg commentedJul 6, 2016
Assists in writing unit tests for layer-apache-bigtop-base, and for
layers that inherit from it.
What do people think. Is this the right place for the test harness to live? @juju-solutions/bigdata