Guest posts

Guest Post: Debug Tests in Your TeamCity CI/CD Pipelines With Thundra Foresight

This guest blog post is brought to you by Ismail Egilmez, Business Development Manager at Thundra (thundra.io).

Thundra Foresight is designed to help developers monitor their builds and debug their tests in continuous integration pipelines.

It helps developers, testers, QA engineers, and more debug and troubleshoot test failures and latencies in CI/CD pipelines. With Foresight’s unique tracing engine, it is possible to understand the root cause of a test failure in a distributed microservice application.

It is annoying when you notice that your build durations are gradually increasing but you don’t have the equipment to address the problem.

End-to-end tests that cover frontend to backend, or integration tests that cover a lot of external services, definitely require new approaches to address flakiness, errors, and latency issues.

With the release of Foresight’s new TeamCity integration, the Foresight agent can be easily added to your TeamCity pipeline.

We’ve built a plugin to make TeamCity users’ lives easier when integrating Foresight to unlock granular detailed analytics for their tests, from unit and integration tests to e2e tests and more.

Before starting, you must have a Foresight account and create a project.

Signing up for Thundra

Thundra has three products, and you can use all of them with one Thundra account. You can sign up using SSO with your Google or GitHub accounts.

Once you sign up, don’t forget to select Foresight from among the listed products.

Create a project

  1. Create your project by clicking the + Create Project button.
  2. Give your project a unique name.
  3. Open your project settings page and copy your Thundra API Key and Thundra Project ID.

Quick Reminder: What is the benefit of using Foresight?

You don’t have to integrate your project with Foresight to see what it offers!

Some open source projects are integrated with Foresight and their tests are run in Thundra’s test environments to showcase the granular test analytics.

Foresight gives insights with performance graphs, logs, metrics, and traces for every single test in your test suites at every test run of your CI/CD builds.

How does the integration work?

Foresight’s TeamCity plugin helps you configure Thundra’s agent automatically, reducing the manual effort required to record your test runs.

You can integrate your TeamCity pipeline in just 2 steps:

  1. Install the plugin.
  2. Configure your TeamCity Project or Build configuration.

After completing those steps, Foresight will capture your test runs automatically.

Foresight supports Maven and Gradle, but we will be supporting more build tools soon.

Let’s explain it in a bit more detail.

Step 1: Install the Foresight plugin from TeamCity

On your TeamCity dashboard, just click on Plugins and click Browse plugins repository.

You can find the Foresight TeamCity plugin on JetBrains Marketplace.

Step 2: Configuration

Open your Thundra Foresight dashboard and get your Thundra API Key and Thundra Project ID from your Project | Settings page.

You can add the parameters to your TeamCity pipeline in two ways:
1. Using TeamCity Project settings
Navigate to your TeamCity project settings (on the top right of your project page), and open the Parameters page.

2. Using Build Configuration settings
Navigate to your TeamCity Build Configuration settings (Edit configuration… in the top right corner of your Build Configuration page), and open the Parameters page.

For both of the options, add the parameters below:

  • Click on Add New Parameter
  • Add Environment Variables (Recommended) and set the THUNDRA_APIKEY and THUNDRA_AGENT_TEST_PROJECT_ID
  • Be careful if you have a Gradle project – you need to make sure that you add the: THUNDRA_GRADLE_PLUGIN_VERSION

You can refer to the integration documentation anytime you wish, and you’re welcome to contact the Thundra team at support@thundra.io if you have any questions.

Done! Now you can monitor and debug your tests with Foresight!

With the TeamCity integration, you will be able to easily integrate Foresight into any of your TeamCity pipelines and start seeing the analytics the first time your tests are run.

Below are some of the key benefits that TeamCity customers can expect from the Thundra Foresight integration.

Test Run Status Summary
TeamCity users can see an overview with information about their passed, failed, skipped, or aborted tests, as well as the total execution time of the test runs.

Contextualized Information for Every Single Test
Logs, metrics, traces, and performance charts give immediate context about the root cause of a failure.

Distributed Traces for Microservices
You can get a better understanding of the behavior of your distributed microservices applications when a test fails with the help of aggregated traces, metrics, and logs.

Time Travel Debugging
A snapshot is taken when each line of code is executed, allowing you to travel back in time to previous states of your application while testing.

Thundra Foresight is designed to help developers, testers, QA engineers, and more debug the erroneous, flaky, and high latency tests that block their continuous integration pipelines, allowing them to deliver code in a continuous manner.

Take a look at our extended documentation, and sign up for Thundra now to try Foresight’s TeamCity plugin for free!

image description

Discover more