Skip to content

Commit

Permalink
Disable default resource providers in tests. (#3288)
Browse files Browse the repository at this point in the history
  • Loading branch information
Anuraag Agrawal committed Jun 14, 2021
1 parent ac9cd8d commit ceaa92a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 3 additions & 0 deletions gradle/java.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,9 @@ tasks.withType(Test).configureEach {
jvmArgs "-Djavax.net.ssl.trustStore=${trustStore.absolutePath}"
jvmArgs "-Djavax.net.ssl.trustStorePassword=testing"
}

def resourceClassesCsv = ['Host', 'Os', 'Process', 'ProcessRuntime'].collect { "io.opentelemetry.sdk.extension.resources.${it}ResourceProvider" }.join(",")
jvmArgs "-Dotel.java.disabled.resource.providers=${resourceClassesCsv}"
}

tasks.withType(AbstractArchiveTask).configureEach {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@ import spock.lang.Specification

class InstrumentationModuleTest extends Specification {

def setup() {
assert System.getenv().findAll { it.key.startsWith("OTEL_") }.isEmpty()
assert System.getProperties().findAll { it.key.toString().startsWith("otel.") }.isEmpty()
}

def "default enabled"() {
setup:
def target = new TestInstrumentationModule(["test"])
Expand Down

0 comments on commit ceaa92a

Please sign in to comment.