seminolas
seminolas

Reputation: 409

How to manually generate JUnit test reports

Couldn't come up with a better name. I'm doing something wrong here, please point in the right direction.

I have a small java app. We use Jenkins for CI, and (AFAICT) maven-surefire to generate some nice test reports that Jenkins understands. Now, I needed some sanity/acceptance test for my app. My approach was:

So far so good - my Jenkins build has a very simple script that does the copying and then runs the jar. If I do it manually, I can see the results on the console.

The problem I now face is generating a test report for Jenkins? maven is not installed on the test VM, nor is ant. Any ideas how I could do this without too much trouble?

thanks a lot

Upvotes: 3

Views: 3549

Answers (1)

Atif
Atif

Reputation: 942

The easiest way I can think of is just to install ANT on the test VM. These are the steps:

  1. Install ANT
  2. Run the JUnit tests with ANT and specify a directory where the test reports will be created. This is done with the ANT JUnit Task (the batchtest task with the todir directive)
  3. Configure Jenkins build to pick up the reports. This is done under "Post-build actions": there is a checkbox for "Publish JUnit test result report". Click the checkbox and specify the dir where the test reports are.

Upvotes: 1

Related Questions