Monitoring Java tests using Bitbucket Pipeline

Introduction for Foresight Bitbucket Pipeline Plugin

Foresight’s Bitbucket Pipeline Plugin automatically changes your build configurations to integrate with Thundra Foresight.
You can integrate your Bitbucket pipeline in just 2 steps. First, you need to add Foresight into your pipe. Then, you need to configure your pipeline according to your Foresight project configurations. After completing those steps, Foresight will capture your test runs automatically.

Prerequisites

  1. 1.
    Thundra Account to record and manage all the process
  2. 2.
    Foresight project to gather parameters

Supported Frameworks

Foresight's TeamCity plugin supports:
runtimes. Foresight's plugin automatically detects which runtime you have. Learn more about integrations:

Maven

YAML Definition

Add the following snippet before the maven verify or install command section of your bitbucket-pipelines.yml file:
1
script:
2
- pipe: atlassian/thundra-foresight-maven-initializer:1.0.4
3
variables:
4
THUNDRA_APIKEY: $THUNDRA_APIKEY
5
THUNDRA_AGENT_TEST_PROJECT_ID: $THUNDRA_AGENT_TEST_PROJECT_ID
Copied!

Variables

Variable
Usage
THUNDRA_APIKEY (*)
Connect your pipeline with the Thundra Java agent. It can be obtained from the project settings page.
THUNDRA_AGENT_TEST_PROJECT_ID (*)
Connect your test runs with the Foresight project. It can be obtained from the project settings page.
(*) = required variable.

Examples

Basic example
1
- step:
2
name: Build and Test
3
caches:
4
- maven
5
script:
6
- pipe: atlassian/thundra-foresight-maven-initializer:1.0.4
7
variables:
8
THUNDRA_APIKEY: $THUNDRA_APIKEY
9
THUNDRA_AGENT_TEST_PROJECT_ID: $THUNDRA_AGENT_TEST_PROJECT_ID
10
- mvn -B verify --file pom.xml
Copied!

Gradle

YAML Definition

Add the following pipe definition before the Gradle test or build command section, and add the init script parameter in your Gradle test or build command of your bitbucket-pipelines.yml file:
1
script:
2
- pipe: atlassian/thundra-foresight-gradle-initializer:1.0.4
3
variables:
4
THUNDRA_APIKEY: $THUNDRA_APIKEY
5
THUNDRA_AGENT_TEST_PROJECT_ID: $THUNDRA_AGENT_TEST_PROJECT_ID
6
- gradle build --init-script $BITBUCKET_CLONE_DIR/thundrainit.gradle
Copied!

Variables

Variable
Usage
THUNDRA_APIKEY (*)
Connect your pipeline with the Thundra Java agent. It can be obtained from the project settings page.
THUNDRA_AGENT_TEST_PROJECT_ID (*)
Connect your test runs with the Foresight project. It can be obtained from the project settings page.
(*) = required variable.

Examples

Basic example
1
- step:
2
name: Build and Test
3
script:
4
- pipe: atlassian/thundra-foresight-gradle-initializer:latest
5
variables:
6
THUNDRA_APIKEY: $THUNDRA_APIKEY
7
THUNDRA_AGENT_TEST_PROJECT_ID: $THUNDRA_AGENT_TEST_PROJECT_ID
8
- gradle build --init-script $BITBUCKET_CLONE_DIR/thundrainit.gradle
Copied!
Last modified 1mo ago