Monitoring Java tests using Azure DevOps

Introduction for Foresight Azure DevOps Plugin

Thundra Foresight Initializer Task automatically changes your build configurations to integrate with Thundra Foresight.
You can integrate your Azure DevOps Project pipeline in just 2 steps. First, you need to install the Thundra Foresight Initializer Task to your Azure DevOps organization from Visual Studio Marketplace. Then, you can either configure by using Azure DevOps's classic pipeline editor or configuring your .yaml manually. After completing those steps, Foresight will capture your test runs automatically.

Prerequisites for Task

  1. 1.
    Thundra Account to record and manage all the process
  2. 2.
    Foresight project to gather parameters
  3. 3.
    Thundra Foresight Apikey to connect your pipeline with the Thundra Java agent. It can be obtained from the project settings page.
  4. 4.
    Thundra Foresight Project Id to connect your test runs with the Foresight project. It can be obtained from the project settings page.

Installing Foresight Extension

Visual Studio Marketplace for Thundra Foresight
  • Select Azure DevOps organization you want to install the Foresight extension
Select Azure DevOps organization you want to install the Foresight extension
  • After installing the extension successfully, go to your Azure DevOps organization and select the project you want to configure.
  • Edit an existing pipeline or create a new pipeline with the configurations below.

Configuration

Configure by Classic Pipeline Editor

Search Thundra Foresight Initializer task from task list (shown below), add this task to pipeline
You need to add the Foresight task after the checkout step and before Maven or Gradle build/test/verify step.

Configure by YAML

If you want to use pipeline with YAML, Add this code snippet to your YAML, between checkout and Maven or Gradle test step
2
inputs:
3
api_key: '$(THUNDRA_APIKEY)'
4
project_id: '$(THUNDRA_AGENT_TEST_PROJECT_ID)'
5
build_run_type: **Select from list**
Copied!
  • Go to your Pipeline Variables page and add the THUNDRA_APIKEY and THUNDRA_AGENT_TEST_PROJECT_ID variables with your Foresight project configuration described before.
We recommend you keep your Variables as secret.

Additional configuration for Gradle

After adding the task described below, you should add an init script parameter --init-script=$(THUNDRA_GRADLE_INIT_SCRIPT_PATH)

Configure by YAML

2
inputs:
3
workingDirectory: ''
4
gradleWrapperFile: 'gradlew'
5
options: '--init-script=$(THUNDRA_GRADLE_INIT_SCRIPT_PATH)'
6
gradleOptions: '-Xmx3072m'
7
javaHomeOption: 'JDKVersion'
8
jdkVersionOption: '1.8'
9
jdkArchitectureOption: 'x64'
10
publishJUnitResults: true
11
testResultsFiles: '**/TEST-*.xml'
12
tasks: 'build'
Copied!
Configure by Classic Pipeline Editor
Add --init-script=$(THUNDRA_GRADLE_INIT_SCRIPT_PATH) value to Gradle task option.

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.
Last modified 1mo ago