Skip to end of metadata
Go to start of metadata

Plugin Information

View Test In Progress on the plugin site for more information.

This plugin allows you to see how the tests progress during a build.

About

While executing our tests on Jenkins most of us may have faced the need of knowing which test is getting executed or if a test has failed then whats the exception. As of now many of us completely depends on the execution console for the same.

This plugin solves the said issue and present the user with a user friendly UI to look at the progress and failures if any. This plugin allows you to see how your unit tests progress during a build. It shows you the details of running, skipped and failed test-methods/test-classes of your test-suite.

It supports sequential execution for Junit and Spock based Unit test framework and support parallel execution for TestNg.

Currently supported unit test frameworks:

Using the plugin

Plugin configuration

Check Show tests in progress in Build Environment section while configuring your project in jenkins :

Add testInProgress client library to your Unit Test Framework.

Junit

Add testInProgress-client-1.0.jar to your test classpath. You can find this library in the jenkins maven repository at http://repo.jenkins-ci.org/releases/org/jenkins-ci/plugins/testInProgress-client/

If you use maven, add jenkins maven repository and add dependency to testInProgress-client :

	<repositories>
		<repository>
			<id>repo.jenkins-ci.org</id>
			<url>http://repo.jenkins-ci.org/public/</url>
		</repository>
	</repositories>
	<dependencies>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.10</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.jenkins-ci.plugins</groupId>
			<artifactId>testInProgress-client</artifactId>
			<version>1.0</version>
			<scope>test</scope>
		</dependency>
	</dependencies>

Create a progress suite

Use org.jenkinsci.testinprogress.runner.ProgressSuite runner instead of org.junit.runners.Suite to create your main suite :

package testproject;

import org.jenkinsci.testinprogress.runner.ProgressSuite;
import org.junit.runner.RunWith;
import org.junit.runners.Suite.SuiteClasses;

@RunWith(ProgressSuite.class)
@SuiteClasses({ CalcTestsSuite.class, ParameterizedTest.class })
public class ProgressAllTestsSuite {

}

Instead you can use org.jenkinsci.testinprogress.runner.ProgressBatchSuite which allows to define a junit 4 test suite based on pattern matching.
org.jenkinsci.testinprogress.runner.ProgressBatchSuite extends de.oschoen.junit.runner.BatchTestRunner which is included in testInProgress-client-1.0.jar. See BatchTestRunner project on github : https://github.com/oschoen/batch-test-runner

package de.oschoen.junit.runner;

import org.jenkinsci.testinprogress.runner.ProgressBatchSuite;
import org.junit.runner.RunWith;


@RunWith(ProgressBatchSuite.class)
@BatchTestRunner.BatchTestInclude("**.*Suite")
public class ProgressAllTests {
}

Configure your build to run your progress suite

Using ant

Select your progress test suite(s) :

<junit haltonfailure="no" printsummary="yes" showoutput="true">
	<formatter type="xml" />
	<batchtest fork="false" todir="${target.dir}/junit-xml">
		<fileset dir="${test}">
			<include name="**/ProgressAllTestsSuite.java" />
		</fileset>
	</batchtest>
	<classpath refid="project.test-classpath" />
</junit>

Using maven

<build>
	<plugins>
		<plugin>
			<groupId>org.apache.maven.plugins</groupId>
			<artifactId>maven-surefire-plugin</artifactId>
			<version>2.13</version>
			<configuration>
				<includes>
					<include>**/ProgressAllTestsSuite.java</include>
				</includes>
			</configuration>
		</plugin>
	</plugins>
</build>

Spock

Add testInProgress-spock-client-0.1.2.jar to your test classpath. You can find this library in the jenkins maven repository at http://repo.jenkins-ci.org/releases/org/imaginea/jenkins/plugins/testInProgress-spock-client/.

Source code is available at: https://github.com/menonvarun/testInProgress-spock-client

If you use maven, add jenkins maven repository and add dependency to testInProgress-client :

	<repositories>
		<repository>
			<id>repo.jenkins-ci.org</id>
			<url>http://repo.jenkins-ci.org/public/</url>
		</repository>
	</repositories>
	<dependencies>
		<dependency>
			<groupId>org.imaginea.jenkins.plugins</groupId>
			<artifactId>testInProgress-spock-client</artifactId>
			<version>0.1</version>
			<scope>test</scope>
		</dependency>
	</dependencies>

If you use Gradle, :

	repositories {
            mavenCentral()
            mavenRepo urls: "http://repo.jenkins-ci.org/public/"
        }
	dependencies{
            testCompile "org.imaginea.jenkins.plugins:testInProgress-spock-client:0.1"
        }

Once done please follow the following steps:

  • Just add a file named "org.spockframework.runtime.extension.IGlobalExtension" under folder "src/test/resources/META-INF/services" under your source code.
  • Add the line "org.imaginea.jenkins.testinprogress.spock.SpockTestInProgressExtension" to the above mentioned file.Once the above steps are done your are good to go.Spock client supports disabling the client code execution by setting the property "testinprogress.enabled" to "false" while executing your tests.

TestNg

Add testInProgress-testng-client-0.1.jar to your test classpath. You can find this library in the jenkins maven repository at http://repo.jenkins-ci.org/releases/org/imaginea/jenkins/plugins/testInProgress-testng-client/.

Source code is available at: https://github.com/menonvarun/testInProgress-testng-client

If you use maven, add jenkins maven repository and add dependency to testInProgress-client :

	<repositories>
		<repository>
			<id>repo.jenkins-ci.org</id>
			<url>http://repo.jenkins-ci.org/public/</url>
		</repository>
	</repositories>
	<dependencies>
		<dependency>
			<groupId>org.imaginea.jenkins.plugins</groupId>
			<artifactId>testInProgress-testng-client</artifactId>
			<version>0.1</version>
			<scope>test</scope>
		</dependency>
	</dependencies>

If you use Gradle, :

	repositories {
            mavenCentral()
            mavenRepo urls: "http://repo.jenkins-ci.org/public/"
        }
	dependencies{
            testCompile "org.imaginea.jenkins.plugins:testInProgress-testng-client:0.1"
        }

Once done please follow the following steps:

  • Just add the path "org.imaginea.jenkins.plugins.testinprogress.testng.TestNGProgressRunListener" as testng listener class to your test execution. This can be done either in testng.xml or maven pom.xml or even in ant's build.xml file.Note: The said client supports test to be executed in parallel. Each test section of a suite xml file will shown in a different section on the UI. The parallel execution only works if TestNg internal multi-threading concept is used.

Change Log

Version 1.3 (August 05, 2014)
  • Changes done to support tests getting executed in parallel.
  • Some UI fixes related to display of executing tests.
  • Released TestNg client that supports tests to be executed in parallel.
Version 1.2 (May 08, 2014)
  • Changes the data transfer from string to JSON
  • Changes done to support other unit test frameworks other than Junit
  • Made changes to UI generation.
  • Released Spock client to support spock unit test framework.
Version 1.1 (July 01, 2013)
  • Added support for assumptions
  • Some bug corrections
  • Keep stacktrace and tree side by side
Version 1.0 (Feb 03, 2013)
  • Initial version

11 Comments

  1. This is exactly the one i am looking for except we uses TestNG for our test framework.  Do you know if this can be utilize for TestNG or if there's another plugin for this?

    Thanks,

    Z

    1. You cannot use this plugin for now with TestNG. This new feature could be implemented in the future.

      However, with TestNG, you cannot get a tree of unit tests before running all of them whereas  you can get a tree of unit tests with junit before running them.

  2. Hi,

    I'm trying to use this addon with a Parameterized test, but nothing appears in the Test Progress screen.

    It works fine in a different project I have that has no Parameterized tests.

  3. It looks like the resources (stylesheet and javascript) assume that Jenkins is served up from the root context (/), so don't display when it's hosted under a prefix (like /jenkins).

    The plugin still mostly functions, but as a result it doesn't look as good as your screenshots, and there's no visual difference between sucessful and failed tests.

    1. Thanks. I am working on it.

  4. Hi, it looks like the new version does not register the failed tests correctly.

    It seams the failed tests register as ignored.

  5. Hi,

    Trying to setup this for my spock tests but not working:
    I just add the dependency in my pom

        <dependency>
          <groupId>org.imaginea.jenkins.plugins</groupId>
          <artifactId>testInProgress-spock-client</artifactId>
          <version>0.1.2</version>
          <scope>test</scope>
        </dependency>

    Added a file under 
    myproject\src\test\resources\META_INF\services\org.spockframework.runtime.extension.IGlobalExtension
    with the following content:

    org.imaginea.jenkins.testinprogress.spock.SpockTestInProgressExtension

    And enabled the "Show test in progress" checkbox in the job configuration.

    Nevertheless when the build is executed, in the "Test progress report" nothing is shown

    I'm using 

    <dependency>
      <groupId>org.spockframework</groupId>
      <artifactId>spock-core</artifactId>
      <version>0.7-groovy-2.0</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.11</version>
    </dependency>
    1. Hi Andres,

      It should be META-INF and not META_INF. Can you please make the change and check once. 

      My bad it was a mistake from my side while writing the documentation.

      - Varun

  6. Hi,

    I followed all the instructions for TestNg, but I get nothing in "Test progress report" for the build. I'm running my tests with Maven (using this command: mvn integration-test). Is that maybe why this plugin doesn't work? What can I check to fix this?

    I'm using Jenkins ver. 1.636.

    Thanks.

  7. Hi,

    How come the ProgressSuite runner is not working with custom runner like ParallelParameterized ?

    Thanks.

  8. How to enable the option on Jenkinsfile..