Monitoring Java tests using CircleCI
A CircleCI Orb to instrument your projects with Thundra Foresight.
Learn about Orbs here.

Usage

Information about available parameters is listed below.

Prerequisites

The required parameters are the Thundra API Key and the Thundra Project ID, which can be obtained from the project settings screen.
Once you get the Thundra API Key, make sure to set it as a secret. A sample Orb usage would look like this:
Python 3 and it's shell at /usr/bin/python3 should be available in the workflow. Improvements towards this limitation is in progress. If you're having issues in any case, please let us know by opening an issue.

Supported Runtimes

Foresight's CircleCI orb supports:

Maven Build Example

1
# Make sure to use version 2.1
2
version: 2.1
3
4
# ...
5
6
orbs:
7
# Declare a dependency on the Thundra Orb
8
# Make sure to replace <VERSION> with the latest available
9
thundra: thundra-io/[email protected]
10
11
# ...
12
13
jobs:
14
maven:
15
docker:
16
- image: cimg/openjdk:11.0
17
steps:
18
- checkout
19
# Use `thundra/maven` command
20
- thundra/maven:
21
# Use environment variable name and set the secret on CircleCI
22
apikey: THUNDRA_APIKEY
23
project_id: THUNDRA_PROJECT_ID
24
- run:
25
command: mvn clean verify
26
workflows:
27
example:
28
jobs:
29
- maven
Copied!

Gradle Build Example

1
# Make sure to use version 2.1
2
version: 2.1
3
4
# ...
5
6
orbs:
7
# Declare a dependency on the Thundra Orb
8
# Make sure to replace <VERSION> with the latest available
9
thundra: thundra-io/[email protected]
10
11
# ...
12
13
jobs:
14
gradle:
15
docker:
16
- image: cimg/openjdk:11.0
17
steps:
18
- checkout
19
# Use `thundra/gradle` command
20
- thundra/gradle:
21
# Use environment variable name and set the secret on CircleCI
22
apikey: THUNDRA_APIKEY
23
project_id: THUNDRA_PROJECT_ID
24
- run:
25
# Make sure to use the $THUNDRA_GRADLE_INIT_SCRIPT_PATH
26
command: ./gradlew build --init-script $THUNDRA_GRADLE_INIT_SCRIPT_PATH
27
workflows:
28
example:
29
jobs:
30
- gradle
Copied!

Parameters

Name
Requirement
Scope
Description
apikey
Required
Maven, Gradle
Thundra API Key
project_id
Required
Maven, Gradle
Your project id from Thundra. Will be used to filter and classify your testruns.
instrumenter_version
Optional
Maven
In the action itself, we use a Java script to manipulate pom.xml files. This script is released and versioned separately from the action. Hence, if there is some breaking change or specific version you want to use, you can use it by defining this parameter. You can see all the available version of our instrumenter here.
plugin_version
Optional
Gradle
For Gradle, we use another plugin to instrument tests. You can see all the available version of our plugin here.
agent_version
Optional
Maven, Gradle
A specific version Thundra Java Agent you want to use should be defined here. Similar to instrumenter_version parameter. You can see all the available version of our agent here.
parent_pom_path
Optional
Maven
Use if your parent pom is in somewhere other that ./pom.xml. Must be a relative path.
Last modified 15d ago