Merge lp:~lifeless/launchpad/doctest into lp:launchpad
Status: | Merged |
---|---|
Approved by: | Jonathan Lange |
Approved revision: | no longer in the source branch. |
Merged at revision: | 11723 |
Proposed branch: | lp:~lifeless/launchpad/doctest |
Merge into: | lp:launchpad |
Diff against target: |
302 lines (+28/-80) 15 files modified
lib/canonical/launchpad/mail/ftests/test_stub.py (+0/-4) lib/canonical/launchpad/mail/tests/test_commands.py (+1/-8) lib/canonical/launchpad/mail/tests/test_handlers.py (+0/-4) lib/canonical/launchpad/mail/tests/test_helpers.py (+1/-2) lib/canonical/launchpad/scripts/tests/test_rundoctests.py (+0/-4) lib/canonical/launchpad/testing/pages.py (+20/-13) lib/canonical/launchpad/testing/tests/test_pages.py (+3/-1) lib/canonical/launchpad/tests/test_datetimeutils.py (+1/-8) lib/canonical/launchpad/tests/test_helpers.py (+0/-4) lib/canonical/launchpad/webapp/tests/test_publisher.py (+0/-5) lib/canonical/testing/tests/test_doctestcodec.py (+1/-5) lib/canonical/tests/test_base.py (+0/-6) lib/canonical/tests/test_encoding.py (+0/-5) lib/canonical/widgets/ftests/test_widget_doctests.py (+0/-4) lib/lp/services/mail/tests/test_incoming.py (+1/-7) |
To merge this branch: | bzr merge lp:~lifeless/launchpad/doctest |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jonathan Lange (community) | Approve | ||
Review via email: mp+38182@code.launchpad.net |
Commit message
Change the reported test id for all elements of a story to be the id of the story.
Description of the change
Prep work for parallel testing. One of the main components of parallel testing is programmatic rearrangement of the tests to run, and story tests in particular were a problem.
Previously the test *id* for the whole story was pagetest: relname. This is ok, but I've changed it to story- to make it more clear that this is for *stories*, not just pagetests.
And now the problem bit: the delegated tests were reporting their own ids; those ids don't exist (naturally, the story appearing as a single test so it can't be split hides the components) - and even if they did exist in the full test list, they can't be run separately.
So this branch changes the ids of the individual doctests so that they all claim to be the story as far as subunit and testr is concerned. This makes the full test list able to be partitioned and parallel tested without skipping tests, and while we can make do when starting with a fresh test list(an unrun test list has the story ids), we need to be able to feed data from test runs back into the split algorithm so that we can take advantage of test performance data to make the partitions perform equally.
The downside is that when a test fails, the test *id* won't specify the exact text file for stories (01-foo-bar.txt). OTOH we're removing those incrementally, and the filename in the detailed error page will be correct. So its not a big deal IMO.
On Tue, Oct 12, 2010 at 6:43 AM, Robert Collins reviewers)
<email address hidden> wrote:
> Robert Collins has proposed merging lp:~lifeless/launchpad/doctest into lp:launchpad/devel.
>
> Requested reviews:
> Launchpad code reviewers (launchpad-
>
>
> Prep work for parallel testing. One of the main components of parallel testing is programmatic rearrangement of the tests to run, and story tests in particular were a problem.
>
> Previously the test *id* for the whole story was pagetest: relname. This is ok, but I've changed it to story- to make it more clear that this is for *stories*, not just pagetests.
>
You might be interested to know that some people insist on calling all
pagetests "stories". Nevertheless I take you to mean the silly
pagetests that must run in sequence (e.g. 01-foo.txt).
> And now the problem bit: the delegated tests were reporting their own ids; those ids don't exist (naturally, the story appearing as a single test so it can't be split hides the components) - and even if they did exist in the full test list, they can't be run separately.
>
> So this branch changes the ids of the individual doctests so that they all claim to be the story as far as subunit and testr is concerned. This makes the full test list able to be partitioned and parallel tested without skipping tests, and while we can make do when starting with a fresh test list(an unrun test list has the story ids), we need to be able to feed data from test runs back into the split algorithm so that we can take advantage of test performance data to make the partitions perform equally.
>
> The downside is that when a test fails, the test *id* won't specify the exact text file for stories (01-foo-bar.txt). OTOH we're removing those incrementally, and the filename in the detailed error page will be correct. So its not a big deal IMO.
This seems like a bearable solution.
> === modified file 'lib/canonical/ launchpad/ testing/ pages.py' launchpad/ testing/ pages.py 2010-10-04 20:46:55 +0000 launchpad/ testing/ pages.py 2010-10-12 05:43:43 +0000 countTestCases( ) n(self) : iption( ) numberedfilenam es) unnumberedfilen ames) TestSuite( ) ecker() ecker() uite( logging= False, ayer, setUp=setUp, join(storydir, filename) ames]) ames: LayeredDocFileS uite( logging= False, ayer, setUp=setUp, join(storydir, filename)
> --- lib/canonical/
> +++ lib/canonical/
> @@ -848,7 +848,7 @@
> return self._suite.
>
> def shortDescriptio
> - return "pagetest: %s" % self._description
> + return self._description
>
> def id(self):
> return self.shortDescr
> @@ -910,20 +910,27 @@
> numberedfilenames = sorted(
> unnumberedfilenames = sorted(
>
> + suite = unittest.
> + checker = SpecialOutputCh
> # Add unnumbered tests to the suite individually.
> - checker = SpecialOutputCh
> - suite = LayeredDocFileS
> - package=package, checker=checker, stdout_
> - layer=PageTestL
> - *[os.path.
> - for filename in unnumberedfilen
> + if unnumberedfilen
> + suite.addTest(
> + package=package, checker=checker, stdout_
> + layer=PageTestL
> + *[os.path.
> + for filename in unnumberedfil...