Merge lp:~alexei-kornienko/testrepository/bug-1271133 into lp:~testrepository/testrepository/trunk

Proposed by Alexei Kornienko
Status: Needs review
Proposed branch: lp:~alexei-kornienko/testrepository/bug-1271133
Merge into: lp:~testrepository/testrepository/trunk
Diff against target: 36 lines (+9/-4)
2 files modified
testrepository/testcommand.py (+8/-4)
testrepository/ui/cli.py (+1/-0)
To merge this branch: bzr merge lp:~alexei-kornienko/testrepository/bug-1271133
Reviewer Review Type Date Requested Status
Robert Collins Needs Fixing
Review via email: mp+205628@code.launchpad.net

Description of the change

To post a comment you must log in.
Revision history for this message
Alexei Kornienko (alexei-kornienko) wrote :
Revision history for this message
Alexei Kornienko (alexei-kornienko) wrote :

s/subunit/testtools/

Revision history for this message
Robert Collins (lifeless) wrote :

The data is already available in in the file attachment 'import errors' from subunit - the reason for the inscrutable error from testr is that I hadn't finished gluing the layers together fully.

Whats needed, if you want to work on it - and please do! - is to take 'out', run it through subunit's parser to separate structured data from unstructured, and show all packets that are not test enumerations.

That will show the error strings from testtools cleanly, immediately.

review: Needs Fixing
Revision history for this message
Robert Collins (lifeless) wrote :

Hi! Could you repropose this to master - https://github.com/testing-cabal/testrepository? Thanks!

That said I believe I corrected this already in trunk.

Unmerged revisions

238. By Alexei Kornienko

Added stderr processing for testcommand.

Unescaped newline in cli output

Partial-Fix for https://bugs.launchpad.net/testrepository/+bug/1271133

237. By Robert Collins

Release 0.0.18.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'testrepository/testcommand.py'
2--- testrepository/testcommand.py 2013-07-17 03:17:17 +0000
3+++ testrepository/testcommand.py 2014-02-10 17:04:50 +0000
4@@ -291,12 +291,16 @@
5 try:
6 self.ui.output_values([('running', list_cmd)])
7 run_proc = self.ui.subprocess_Popen(list_cmd, shell=True,
8- stdout=subprocess.PIPE, stdin=subprocess.PIPE)
9+ stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.PIPE)
10 out, err = run_proc.communicate()
11 if run_proc.returncode != 0:
12- raise ValueError(
13- "Non-zero exit code (%d) from test listing."
14- " stdout=%r, stderr=%r" % (run_proc.returncode, out, err))
15+ message = "Non-zero exit code (%d) from test listing."
16+ if err:
17+ raise ValueError((message + " stderr=%r") % (
18+ run_proc.returncode, err))
19+ else:
20+ raise ValueError((message + " stdout=%r") % (
21+ run_proc.returncode, out))
22 ids = parse_enumeration(out)
23 return ids
24 finally:
25
26=== modified file 'testrepository/ui/cli.py'
27--- testrepository/ui/cli.py 2013-04-13 16:40:43 +0000
28+++ testrepository/ui/cli.py 2014-02-10 17:04:50 +0000
29@@ -147,6 +147,7 @@
30 # XX: Python2.
31 if type(error_type) is bytes:
32 error_type = error_type.decode('utf8')
33+ error_type = error_type.replace("\\n", '\n')
34 self._stderr.write(error_type + _u('\n'))
35
36 def output_rest(self, rest_string):

Subscribers

People subscribed via source and target branches