Python script to generate JUnit report from another testing result

jenkins, junit, python

Solution

I found one python module https://bitbucket.org/db_atlass/python-junit-xml-output-module/ , looks fit to my need. thx David Black there

# code snippet for the usage
""" a short example of how to use this module """
test_cases = []
for i in range(0, 5):
    type_c = ""
    if i % 2 == 0:
        type_c = "failure"
    test_cases.append(TestCase(i, str(i) + "contents", type_c) )

junit_xml = JunitXml("demo test example", test_cases)

Problem

I have an acceptance test case, the result is plain text. I want to use Jenkins to show the result, and the JUnit format is suitable for me. So I want to check whether there is existing python code to generate JUnit-format XML, so that I can easily just add my parsing code. Related question.

Original source

Related problems