Skip to content
mdr edited this page Oct 22, 2014 · 19 revisions

Concepts

A test is a test case. Each test has a name, and optionally a group to which it belongs. For tests imported from an xUnit unit testing framework (JUnit, TestNG, NUnit etc), the name is the name of the test method, and the group is the name of the test class (including the package).

An execution is a run of a single test case, capturing whether it passed or failed, when it ran, how long it took, any log output, and so on.

A batch is a collection of test executions which were run together. For example, all the tests that ran as part of a Jenkins build.

A configuration is used to distinguish running the same set of tests over multiple variations of some property. For example, you might run a set of Selenium tests against Chrome, Firefox and IE; each browser would be a different configuration. Similarly, you might run your test suite across several releases of your application. Each test execution is associated with a single configuration, and executions across different configurations are kept distinct.

Each test is analysed and given a status, classifying it into one of Healthy, Warning or Broken. Tests that have only failed once or twice, and only over a short period of time, are classified as a Warning, whereas tests that have failed multiple times, over a longer period of time, are classified as Broken. Broken tests can then be investigated with confidence that they are real, repeatable issues. This is a more nuanced classification than just "pass or fail" that allows less time to be spent distinguishing spurious test failures from genuine issues.

Importing Test Results

There are two mechanisms for getting test results into trt: importing from a continuous integration (CI) server (currently supports Jenkins, Hudson and TeamCity) or using the JSON API.

Importing From a CI Server

You can configure imports from a CI server via "Settings -> CI Imports". Add links to jobs and trt will periodically scan all the builds recorded and import any test results found.

The following fields are used to configure a job:

Jenkins Authentication

If your Jenkins instance is secured, you will need to provide some credentials to allow trt to read the information it needs. To do this:

  1. Log into Jenkins, and click your user in the top right, then "Configure".
  2. Click "Show API Token...", and make a note of the "User ID" and "API token"
  3. In trt, navigate to Settings -> Jenkins.
  4. Enter the values from Step #2, and click "Update".

TeamCity Authentication

By default, trt will attempt to use guest access to read build information. If this is not available, you will need to provide a TeamCity username and password.

  1. In trt, navigate to Settings -> TeamCity.
  2. Enter the username and password, and click "Update".

Dashboard Screen

The Dashboard screen shows an overview of your tests across all your configurations. For each configuration, it shows:

  • Summary counts of Healthy, Warning and Broken tests
  • A chart showing the Healthy/Warning/Broken counts over the history of the project.

Rerunning Tests

trt can rerun a specific set of tests on Jenkins. To allow this, you need to do the following:

  1. Create a parameterised job on Jenkins. This should have a single parameter, which is the list of test names to execute. trt knows how to generate a list of tests in the format expected by Maven (http://maven.apache.org/) and SST (http://testutils.org/sst/).
  2. In trt, go to Settings -> Jenkins, and switch to the "Reruns" tab.
  3. Enter the URL of your parameterised job in the "Rerun job URL" field.
  4. Optionally enter the job authentication token (found on Jenkins via Job -> Configure -> Build Triggers -> Trigger Builds Remotely -> Authentication Token).
  5. Add a new Job Parameter. Set the name to be the parameter name from step #1. Set the value to be either $MAVEN_TEST if you're using Maven, or $SST_REGEXES for SST.
  6. Click "Update" to save your configuration.

Now when you visit the tests screen, you should see the "Rerun Selected" button. If you check the tests you want to run, and click Rerun, a build should be triggered on Jenkins.

Clone this wiki locally