Skip to content

Commit

Permalink
Merge pull request #209 from DataDog/nogorodnikov/fix-ci-visibility-i…
Browse files Browse the repository at this point in the history
…ntegration

Fix CI visibility integration
  • Loading branch information
0xnm authored Nov 22, 2023
2 parents 965856f + 475492c commit d926eb7
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

package com.datadog.gradle.config

import com.android.build.gradle.tasks.factory.AndroidUnitTest
import org.gradle.api.JavaVersion
import org.gradle.api.Project
import org.gradle.api.tasks.testing.Test
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import java.io.File

Expand All @@ -22,14 +22,12 @@ fun Project.kotlinConfig() {

val moduleName = this@kotlinConfig.name
val javaAgentJar = File(File(rootDir, "libs"), "dd-java-agent-0.98.1.jar")
taskConfig<AndroidUnitTest> {
taskConfig<Test> {
if (environment["DD_INTEGRATION_JUNIT_5_ENABLED"] == "true") {
val variant = variantName.substringBeforeLast("UnitTest")

// set the `env` tag for the test spans
environment("DD_ENV", "ci")
// add custom tags based on the module and variant (debug/release, flavors, …)
environment("DD_TAGS", "test.module:$moduleName,test.variant:$variant")
environment("DD_TAGS", "test.module:$moduleName")

// disable other Datadog integrations that could interact with the Java Agent
environment("DD_INTEGRATIONS_ENABLED", "false")
Expand Down

0 comments on commit d926eb7

Please sign in to comment.