How do you run SimpleTest from Hudson?

2019-08-26 17:33发布

问题:

I'm doing some work with CakePHP and want to use Hudson. I can run all kinds of plugins but I don't see anything for SimpleTest. Until Cake 2.0 comes out and they move to PHPUnit, I'd like to figure out how to run SimpleTest with Hudson.

回答1:

This is an old question, but I thought I'd give my input...

We are still stuck on cake 1.3 and are using Jenkins. We use stagehand-test runner to run the tests and generate the junit report.

You can have your ant build run something like the following: cakerunner --cakephp-app-path=src/app --log- junit=build/test-results/junit.xml -R src/app/tests

Then in Jenkins you will need to use the 'Publish JUnit test result report' instead of "Publish testing tools result report" where PHPUnit and other frameworks are listed.

I made a similar question not too long ago.



回答2:

Are you having trouble running SimpleTest or are you having trouble getting Hudson to parse the test output so you can track tests and failures?

Regarding parsing, it looks like SimpleTest can generate some form of XML output (see Test reporter documentation), but it's not clear to me whether the Hudson xUnit plugin can parse it.

I would start by trying the xUnit plugin. If the SimpleTest XML output is not compatible out of the box, it's probably easiest to extend/modify the SimpleTest XML reporter to output a xUnit compatible format. A previous question about the expected XML unit test schema has some useful links regarding the expected format.