Publish Test Result Report

One of the main tasks of Test Hub Client is to publish the report generated by test execution to Test Hub. This process implies next process in Test Hub Client:

  1. Detect the type of project (currently only Maven + Surefire is supported).

  2. Package all test reports into a .tar.gz file.

  3. Get automatic values in case of not specified manually.

  4. Send request to Test Hub.

From the point of view of Test Hub implies next things, when it receives the request:

  1. Register a new build.

  2. Uncompress provided test artifacts.

  3. Calculate test results and update trend.

Example

Let’s see a minimal example on how to use Test Hub Client to publish the result of a build.

testhubclient push \ (1)
              --project myproject \ (2)
              --build 1 (3)
1 push command to upload test artifacts
2 project flag to set project that contains the test results
3 build flag to set which build identifier has generated the test results

So running previous command will connect to a Test Hub running at http://localhost:8000 set commit flag with current commit id and branch flag with current branch.

Command

The command to indicate that you want to publish some test artifacts is push.

This operation supports next flags:

Table 1. Push flags
Option Purpose Format Default

--project

Sets the project name where test results should be stored

String

not set and mandatory

--build

Sets the build identifier that generated the test results

String

not set and mandatory

--url

Sets the URL where Test Hub is running

URL

--root-ca

PEM encoded CA’s certificate file

File path

--cert

PEM encoded certificate file

File path

--key

PEM encoded private key file

File path

--skip-verify

Skip verification of certifcate chain

Boolean

false

--username

Sets the username to authenticate

String

--password

Sets the password to authenticate

String

--branch

Branch of current build. Used for navigating from test report to branch.

String

Current branch.

--commit

Commit hash of current build. Used for navigating from test report to commit.

String

Current commit id.

--build-url

URL where the project is built. Used for navigating from test report to build system.

URL

--repo-url <URL>

SCM location of the project. Used for navigating from test report to original source code.

URL

--repo-type <type>

Repository type is automatically from build-url parameter. But you can explicitely set using this attribute.

github, gitlab, gogs, bitbucket

automatic detection