Merge lp:~vila/ubuntu-ci-services-itself/1290401-doc-subunit into lp:ubuntu-ci-services-itself

Proposed by Vincent Ladeuil
Status: Merged
Approved by: Francis Ginther
Approved revision: 383
Merged at revision: 382
Proposed branch: lp:~vila/ubuntu-ci-services-itself/1290401-doc-subunit
Merge into: lp:ubuntu-ci-services-itself
Diff against target: 84 lines (+77/-0)
1 file modified
docs/usage.rst (+77/-0)
To merge this branch: bzr merge lp:~vila/ubuntu-ci-services-itself/1290401-doc-subunit
Reviewer Review Type Date Requested Status
Francis Ginther Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+210876@code.launchpad.net

Commit message

Document subunit usage from the streams produced by the test runner.

Description of the change

Document subunit usage from the streams produced by the test runner.

To post a comment you must log in.
Revision history for this message
Francis Ginther (fginther) wrote :

76 +Converting to the junixml format (used by jenkins)

One typo in this line (junixml -> junitxml). I also would remove the '(used by jenkins)', as it might lead an inexperience user to think the they need to manually load this into jenkins. I think 'junitxml format' stands well enough on it's own.

Otherwise, this is perfect. Thanks.

review: Needs Fixing
383. By Vincent Ladeuil

Fix review comment.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:382
http://s-jenkins.ubuntu-ci:8080/job/uci-engine-ci/408/
Executed test runs:

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/uci-engine-ci/408/rebuild

review: Approve (continuous-integration)
Revision history for this message
Francis Ginther (fginther) wrote :

Looks good. I see one more mention of jenkins at the very end, but as I other changes to make to this exact same file. I'll just do it then.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'docs/usage.rst'
2--- docs/usage.rst 2014-01-24 18:33:12 +0000
3+++ docs/usage.rst 2014-03-13 18:35:59 +0000
4@@ -52,3 +52,80 @@
5
6 Once a ticket is completed, it's status will be updated appropriately and all
7 build and test results and logs will be available via the web interface.
8+
9+
10+Exploiting Test Results
11+-----------------------
12+
13+The test runner produces results in the subunit v1 format.
14+
15+The subunit stream can be downloaded from the web interface and processed
16+locally in different ways.
17+
18+Note that the subunit stream contains the dep-8 test results.
19+
20+The subunit v1 format is text only and as such can be read but it's not
21+especially user-friendly:
22+
23+.. code-block:: none
24+
25+ test: dsc0t-build
26+ successful: dsc0t-build [ multipart
27+ Content-Type: text/plain;charset=utf8
28+ stderr
29+ 0^M
30+ Content-Type: text/plain;charset=utf8
31+ stdout
32+ 12^M
33+ build: OK
34+ run: OK
35+ 0^M
36+ ]
37+
38+subunit provide filters to convert a stream into more readable outputs.
39+
40+
41+Converting to the python unittest format
42+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
43+
44+.. code-block:: none
45+
46+ $ subunit-1to2 <subunit.stream | subunit2pyunit
47+
48+This filter is appropriate to inspect failures in tests and will produce
49+(for example):
50+
51+.. code-block:: none
52+
53+ $ subunit-1to2 <fail.stream | subunit2pyunit
54+ tests.test_pass
55+ tests.test_pass ... ok
56+ tests.test_fail
57+ tests.test_fail ... FAIL
58+ ======================================================================
59+ FAIL: tests.test_fail
60+ tests.test_fail
61+ ----------------------------------------------------------------------
62+ testtools.testresult.real._StringException: Traceback (most recent call last):
63+ File "tests.py", line 31, in test_fail
64+ self.assertTrue(False)
65+ File "/usr/lib/python2.7/unittest/case.py", line 424, in assertTrue
66+ raise self.failureException(msg)
67+ AssertionError: False is not true
68+
69+
70+ ----------------------------------------------------------------------
71+ Ran 2 tests in 0.001s
72+
73+ FAILED (failures=1)
74+
75+
76+Converting to the junitxml format
77+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
78+
79+.. code-block:: none
80+
81+ $ subunit-1to2 <subunit.stream | subunit2junitxml >results.xml
82+
83+This produces a 'results.xml' file suitable for jenkins.
84+

Subscribers

People subscribed via source and target branches