12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- plugins {
- id("otel.javaagent-testing")
- }
- dependencies {
- compileOnly(project(":testing-common:library-for-integration-tests"))
- testImplementation(project(":testing-common:library-for-integration-tests"))
- testCompileOnly(project(":instrumentation-api"))
- testCompileOnly(project(":javaagent-tooling"))
- testCompileOnly(project(":javaagent-extension-api"))
- testCompileOnly(project(":muzzle"))
- testImplementation("net.bytebuddy:byte-buddy")
- testImplementation("net.bytebuddy:byte-buddy-agent")
- testImplementation("com.google.guava:guava")
- testImplementation(project(":instrumentation-annotations"))
- testImplementation("cglib:cglib:3.3.0")
- // test instrumenting java 1.1 bytecode
- // TODO do we want this?
- testImplementation("net.sf.jt400:jt400:6.1")
- }
- tasks {
- val testFieldInjectionDisabled by registering(Test::class) {
- filter {
- includeTestsMatching("context.FieldInjectionDisabledTest")
- }
- include("**/FieldInjectionDisabledTest.*")
- jvmArgs("-Dotel.javaagent.experimental.field-injection.enabled=false")
- }
- val testFieldBackedImplementation by registering(Test::class) {
- filter {
- includeTestsMatching("context.FieldBackedImplementationTest")
- }
- include("**/FieldBackedImplementationTest.*")
- // this test uses reflection to access fields generated by FieldBackedProvider
- // internal-reflection needs to be disabled because it removes these fields from reflection results.
- jvmArgs("-Dotel.instrumentation.internal-reflection.enabled=false")
- // required on jdk17
- jvmArgs("--add-opens=java.base/java.lang=ALL-UNNAMED")
- jvmArgs("-XX:+IgnoreUnrecognizedVMOptions")
- }
- val testIndyModuleOldBytecodeInstrumentation by registering(Test::class) {
- filter {
- includeTestsMatching("InstrumentOldBytecode")
- }
- include("**/InstrumentOldBytecode.*")
- jvmArgs("-Dotel.instrumentation.inline-ibm-resource-level.enabled=false")
- }
- val testInlineModuleOldBytecodeInstrumentation by registering(Test::class) {
- filter {
- includeTestsMatching("InstrumentOldBytecode")
- }
- include("**/InstrumentOldBytecode.*")
- jvmArgs("-Dotel.instrumentation.indy-ibm-resource-level.enabled=false")
- }
- test {
- filter {
- excludeTestsMatching("context.FieldInjectionDisabledTest")
- excludeTestsMatching("context.FieldBackedImplementationTest")
- excludeTestsMatching("InstrumentOldBytecode")
- }
- // this is needed for AgentInstrumentationSpecificationTest
- jvmArgs("-Dotel.javaagent.exclude-classes=config.exclude.packagename.*,config.exclude.SomeClass,config.exclude.SomeClass\$NestedClass")
- }
- check {
- dependsOn(testFieldInjectionDisabled)
- dependsOn(testFieldBackedImplementation)
- }
- }
|