Python script to generate JUnit report from another testing result

后端 未结 6 1951
悲哀的现实
悲哀的现实 2021-02-01 21:53

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 t

6条回答
  •  忘了有多久
    2021-02-01 22:19

    Good answers here: (there are many ways to do it) Python unittests in Jenkins?

    IMHO the best way is write python unittest tests and install pytest (something like 'yum install pytest') to get py.test installed. Then run tests like this: 'py.test --junitxml results.xml test.py'. You can run any unittest python script and get jUnit xml results.

    https://docs.python.org/2.7/library/unittest.html

    In jenkins build configuration Post-build actions Add a "Publish JUnit test result report" action with result.xml and any more test result files you produce.

提交回复
热议问题