Skip to content

Commit 348f975

Browse files
WIP.
1 parent 10d4bdf commit 348f975

File tree

4 files changed

+8
-30
lines changed

4 files changed

+8
-30
lines changed

dd-java-agent/instrumentation/aws-java/aws-java-lambda-handler-1.2/build.gradle

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,6 @@ apply from: "$rootDir/gradle/java.gradle"
1010

1111
addTestSuiteForDir('latestDepTest', 'test')
1212

13-
test {
14-
environment([
15-
"_HANDLER": "Handler",
16-
"TEST_ENV_PROPAGATE_VARS": "_HANDLER"
17-
])
18-
}
19-
20-
forkedTest {
21-
environment([
22-
"_HANDLER": "Handler",
23-
"TEST_ENV_PROPAGATE_VARS": "_HANDLER"
24-
])
25-
}
26-
27-
latestDepTest {
28-
environment([
29-
"_HANDLER": "Handler",
30-
"TEST_ENV_PROPAGATE_VARS": "_HANDLER"
31-
])
32-
}
33-
3413
dependencies {
3514
compileOnly group: 'com.amazonaws', name: 'aws-lambda-java-core', version: '1.2.1'
3615
testImplementation group: 'com.amazonaws', name: 'aws-lambda-java-core', version: '1.2.1'

dd-java-agent/instrumentation/aws-java/aws-java-lambda-handler-1.2/src/test/groovy/LambdaHandlerInstrumentationTest.groovy

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ import com.amazonaws.services.lambda.runtime.Context
55
abstract class LambdaHandlerInstrumentationTest extends VersionedNamingTestBase {
66
def requestId = "test-request-id"
77

8+
// Must set this env var before the Datadog integration is initialized.
9+
// If present at load time, the integration auto-enables.
10+
static {
11+
environmentVariables.set("_HANDLER", "Handler")
12+
}
13+
814
@Override
915
String service() {
1016
null

internal-api/src/test/groovy/datadog/trace/api/ConfigTest.groovy

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -173,12 +173,8 @@ class ConfigTest extends DDSpecification {
173173
private static final DD_LLMOBS_ML_APP_ENV = "DD_LLMOBS_ML_APP"
174174
private static final DD_LLMOBS_AGENTLESS_ENABLED_ENV = "DD_LLMOBS_AGENTLESS_ENABLED"
175175

176-
def setupSpec() {
177-
ControllableCapturedEnvironment.useFixedEnv([:])
178-
}
179-
180176
def setup() {
181-
ControllableCapturedEnvironment.useFixedEnv([:])
177+
FixedCapturedEnvironment.useFixedEnv([:])
182178
}
183179

184180
def "specify overrides via properties"() {
@@ -797,9 +793,6 @@ class ConfigTest extends DDSpecification {
797793
}
798794

799795
def "override null properties"() {
800-
setup:
801-
FixedCapturedEnvironment.useFixedEnv([:])
802-
803796
when:
804797
def config = Config.get(null)
805798

utils/test-utils/src/main/groovy/datadog/trace/test/util/DDSpecification.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ abstract class DDSpecification extends Specification {
3535
static configModificationFailed = false
3636

3737
@Shared
38-
protected ControllableEnvironmentVariables environmentVariables = ControllableEnvironmentVariables.setup()
38+
protected static ControllableEnvironmentVariables environmentVariables = ControllableEnvironmentVariables.setup()
3939

4040
// Intentionally saving and restoring System properties.
4141
private static Properties originalSystemProperties

0 commit comments

Comments
 (0)