Add BaseTestRunner in djblet
Review Request #7932 — Created Jan. 30, 2016 and discarded
Creates a test runner class called BaseTestRunner which uses the nose unit test framework. Then apps can subclass to run their test suites.
I have tested the test runner in the real and fake extensions.
I add the document to introduce how to use the test extension framework
in reviewboard/docs/manual/extending/extensions/testing.rst
Description | From | Last Updated |
---|---|---|
'pkg_resources' imported but unused |
reviewbot | |
'ExtensionInfo' imported but unused |
reviewbot | |
'RegisteredExtension' imported but unused |
reviewbot | |
'ExtensionHookPoint' imported but unused |
reviewbot | |
'ExtensionHook' imported but unused |
reviewbot | |
'Settings' imported but unused |
reviewbot | |
FakeEntryPoint, FakeDistribution, TestExtensionManager, TestExtension, TestExtensionWithRegistration... I'm guessing this you're using this to test your testing framework? Very Matryoshka doll. :) … |
mike_conley | |
Col: 1 W191 indentation contains tabs |
reviewbot | |
Col: 1 W191 indentation contains tabs |
reviewbot | |
Col: 1 W191 indentation contains tabs |
reviewbot | |
Col: 1 W191 indentation contains tabs |
reviewbot | |
Col: 1 W191 indentation contains tabs |
reviewbot | |
Col: 1 W191 indentation contains tabs |
reviewbot | |
Col: 1 W191 indentation contains tabs |
reviewbot | |
Col: 1 W191 indentation contains tabs |
reviewbot | |
Col: 1 W191 indentation contains tabs |
reviewbot | |
Col: 1 W191 indentation contains tabs |
reviewbot | |
Col: 1 W191 indentation contains tabs |
reviewbot | |
Col: 1 W191 indentation contains tabs |
reviewbot | |
Col: 1 W191 indentation contains tabs |
reviewbot | |
Col: 1 W191 indentation contains tabs |
reviewbot | |
Col: 1 W191 indentation contains tabs |
reviewbot | |
Col: 1 W191 indentation contains tabs |
reviewbot | |
Col: 1 W191 indentation contains tabs |
reviewbot | |
Col: 1 W191 indentation contains tabs |
reviewbot | |
Col: 1 W191 indentation contains tabs |
reviewbot | |
Col: 1 W191 indentation contains tabs |
reviewbot | |
Col: 1 W191 indentation contains tabs |
reviewbot | |
Col: 5 E101 indentation contains mixed spaces and tabs |
reviewbot | |
Col: 6 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 1 W191 indentation contains tabs |
reviewbot | |
Col: 5 E101 indentation contains mixed spaces and tabs |
reviewbot | |
Col: 6 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 1 W191 indentation contains tabs |
reviewbot | |
Col: 5 E101 indentation contains mixed spaces and tabs |
reviewbot | |
Col: 6 E128 continuation line under-indented for visual indent |
reviewbot | |
Col: 1 W191 indentation contains tabs |
reviewbot | |
'tempfile' imported but unused |
reviewbot | |
'execute_from_command_line' imported but unused |
reviewbot | |
'generate_media_serial' imported but unused |
reviewbot | |
'tempfile' imported but unused |
reviewbot | |
'execute_from_command_line' imported but unused |
reviewbot | |
'generate_media_serial' imported but unused |
reviewbot | |
Col: 80 E501 line too long (91 > 79 characters) |
reviewbot | |
Col: 30 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
Col: 32 E251 unexpected spaces around keyword / parameter equals |
reviewbot | |
I talked to david, and he said we should probably just drop this license block. There's already a COPYING that's … |
mike_conley | |
I imagine we'll want RBTestRunner to extend this in reviewboard/reviewboard/test.py, right? |
mike_conley | |
What's this? |
mike_conley | |
test_labels isn't actually be used here, btw. What's it for? Can we just remove it? |
mike_conley | |
Out of curiosity, why do you not need the --with-id argument that is being used by RBTestRunner? |
mike_conley | |
There shouldn't be anything reviewboard specific in here. RBTestRunner will still want this though, so you either need to have … |
mike_conley | |
Please remove this. |
mike_conley | |
Please remove this print |
mike_conley | |
This stuff got yanked out of RBTestRunner in https://github.com/reviewboard/reviewboard/commit/001415dfaedb4a7db355e7547e4bf0497d3b3cd5 - you should probably do the same. |
mike_conley | |
Instead of this inline documentation fragment, it'd probably be best to have a docstring. Same goes for the other methods … |
mike_conley | |
Why is this environment variable needed? |
mike_conley |
-
-
FakeEntryPoint, FakeDistribution, TestExtensionManager, TestExtension, TestExtensionWithRegistration... I'm guessing this you're using this to test your testing framework? Very Matryoshka doll. :)
I want to make sure the mental model is correct here - the framework you're building is to help extension developers test the extensions they've built for Review Board. That's very important to focus on. I don't want you to fall into the trap of writing tests for the extension framework itself.
-
Tool: PEP8 Style Checker Processed Files: djblets/testing/testrunner.py Tool: Pyflakes Processed Files: djblets/testing/testrunner.py
-
-
-
-
-
-
-
Tool: PEP8 Style Checker Processed Files: djblets/testing/testrunner.py Tool: Pyflakes Processed Files: djblets/testing/testrunner.py
-
Thanks for your work Weijie! See below.
-
I talked to david, and he said we should probably just drop this license block. There's already a COPYING that's applied to the whole project except for special cases, and this can just inherit that if we remove this entire license block.
-
-
-
-
There shouldn't be anything reviewboard specific in here.
RBTestRunner will still want this though, so you either need to have this base class use something it already knows to fill this field out, or have subclasses provide something that can be put in here.
-
-
-
This stuff got yanked out of RBTestRunner in https://github.com/reviewboard/reviewboard/commit/001415dfaedb4a7db355e7547e4bf0497d3b3cd5 - you should probably do the same.
-
Instead of this inline documentation fragment, it'd probably be best to have a docstring. Same goes for the other methods in here.
-
Tool: PEP8 Style Checker Processed Files: djblets/testing/testrunner.py Tool: Pyflakes Processed Files: djblets/testing/testrunner.py
-
Tool: PEP8 Style Checker Processed Files: djblets/testing/testrunner.py Tool: Pyflakes Processed Files: djblets/testing/testrunner.py
-
Tool: PEP8 Style Checker Processed Files: djblets/testing/testrunner.py Tool: Pyflakes Processed Files: djblets/testing/testrunner.py
-
Sorry, weijei - a few more non-code things just caught my eye.
In the summary, "djblet" -> "djblets". Also, you're not actually adding an extension testing framework to Djblets; you're adding a BaseTestRunner.
The description of this review request is going to be used to create the commit message that this lands with, so can you please update the description so that it's phrased in the present tense?
Example:
"Create a test runner class in Djblets, called BaseTestRunner in the djblets/testing/testrunner.py"
should be
"Creates a test runner class called BaseTestRunner which apps can subclass to run their test suites", or something along those lines.
'something still confused "have it run nose, but allow a subclass to define the more specific options to pass in (like, let it define the list of modules and such)'
^-- I'm not sure what this means, and it probably shouldn't be in here. If this is a question, you should ask it in Slack and get it answered.'Build a testcase class for the extension testing stuff that registers/enables the extension in setUp , and shuts it down in tearDown'
^-- this isn't part of this patch.
- Summary:
-
Add Extension testing framework in reviewboard in djbletAdd BaseTestRunner in djblet
- Description:
-
~ - Create a test runner class in Djblets, called BaseTestRunner in the djblets/testing/testrunner.py
~ Creates a test runner class called BaseTestRunner which uses the nose unit test framework. Then apps can subclass to run their test suites.
- - something still confused "have it run nose, but allow a subclass to define the more specific options to pass in (like, let it define the list of modules and such)"
- - - Build a testcase class for the extension testing stuff that registers/enables the extension in setUp , and shuts it down in tearDown