Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run tests with javaagent. #1643

Merged
merged 180 commits into from
Jan 4, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
180 commits
Select commit Hold shift + click to select a range
a2f1604
Run tests with javaagent.
Nov 16, 2020
02b72aa
TransformationListener bridge.
Nov 16, 2020
c3f13d7
Merge branch 'master' of github.com:open-telemetry/opentelemetry-java…
Nov 17, 2020
dd1eff3
Simple instrumentation (e.g. armeria) work
Nov 17, 2020
d067842
Config updates work
Nov 17, 2020
b1cacb1
Some cleanup
Nov 17, 2020
ff513ae
Exclude bootstrap from the testRuntimeClasspath so tooling can contin…
Nov 17, 2020
4e34a57
Exclude bootstrap from all test runtime classpaths.
Nov 17, 2020
42d2c7a
Merge branch 'master' of github.com:open-telemetry/opentelemetry-java…
Nov 18, 2020
388493b
Clean
Nov 18, 2020
6757a11
testInstrumentation
Nov 18, 2020
78ff98d
Shrink agent testing jar
Nov 18, 2020
8080285
Fixes
Nov 18, 2020
ec435b6
Fixes
Nov 20, 2020
916fc2e
Remove iscompleted
Nov 20, 2020
06ca469
Remove dependency on agent classes in tests.
Nov 21, 2020
d229ab8
Merge remote-tracking branch 'upstream/master' into pr-run-tests-with…
trask Nov 21, 2020
1d3de5a
FIXUP
trask Nov 21, 2020
3552033
Fix for no propagators being installed
trask Nov 21, 2020
0e1cf89
Partially fix opentelemetry-api instrumentation tests
trask Nov 22, 2020
ca5a118
Rename
trask Nov 22, 2020
2356d5b
fixup! Rename
trask Nov 22, 2020
f90fdaa
Reduce test dependency on OpenTelemetry API
trask Nov 22, 2020
58dae8a
Revert "Reduce test dependency on OpenTelemetry API"
trask Nov 22, 2020
8bd1a0d
No need to set propagators in AgentTestRunner
trask Nov 22, 2020
c9e6cf7
Remove no longer needed code
trask Nov 22, 2020
af1b1a9
Basic ContextBridgeTest
trask Nov 22, 2020
915767e
Remove unnecessary verification
trask Nov 22, 2020
da51582
Revert "Remove unnecessary verification"
trask Nov 22, 2020
678a868
Remove mock context
trask Nov 22, 2020
6b76dff
Spotless
trask Nov 22, 2020
011b106
Merge remote-tracking branch 'upstream/master' into pr-run-tests-with…
trask Nov 23, 2020
c278b13
Fix guava test
trask Nov 24, 2020
6b5d90a
Merge remote-tracking branch 'upstream/master' into pr-run-tests-with…
trask Nov 24, 2020
b0d4249
Fix jdbc tests
trask Nov 24, 2020
faf8e85
Compile failures
Nov 24, 2020
57492db
Fix cassandra test and jaxrs-1 compile failure.
Nov 24, 2020
0c62f64
Ignore kubernetes test for now
Nov 24, 2020
ef55977
Disable oshi assertion.
Nov 24, 2020
e66eb66
Comment out more unit tests
Nov 24, 2020
c2e7226
Don't apply unnecessary plugins at top level.
Nov 24, 2020
96a9ed1
Merge branch 'top-level-less-plugins' into run-tests-with-agent
Nov 24, 2020
066cf29
Use agent way to set xray propagator.
Nov 24, 2020
d3c5c8c
More
Nov 24, 2020
15821e9
Almost there
Nov 24, 2020
d76d9dd
Merge branch 'master' of github.com:open-telemetry/opentelemetry-java…
Nov 24, 2020
e950709
Merge remote-tracking branch 'upstream/master' into pr-run-tests-with…
trask Nov 24, 2020
415d8f7
Split out ConfigUtils for non-agent instrumentation tests.
Nov 25, 2020
4e7fc8c
Remove testing-bootstrap
Nov 25, 2020
a3aa8c6
Remove Shaded SDK projects.
Nov 25, 2020
1e72ea1
Merge remote-tracking branch 'upstream/master' into run-tests-with-agent
trask Nov 27, 2020
904382a
Convert HibernateDecorator to HibernateTracer
trask Nov 27, 2020
4b062bd
Convert TwilioDecorator to TwilioTracer
trask Nov 27, 2020
6f7c196
Delete BaseDecorator
trask Nov 28, 2020
428e29f
Remove decorator package
trask Nov 28, 2020
6148a26
More renames
trask Nov 28, 2020
d937ca6
Improve tests that rely on config
trask Nov 27, 2020
bef075b
RedisCommandNormalizerTest
trask Nov 28, 2020
265c5ec
Fix
trask Nov 28, 2020
5b12e11
Merge branch 'remove-decorators' into run-tests-with-agent
trask Nov 28, 2020
d25cb37
Remove testing ConfigUtils
trask Nov 28, 2020
af6953c
Update more config property names
trask Nov 28, 2020
59d654e
Spotless
trask Nov 28, 2020
adba247
Split out methods and otel-annotations modules
trask Nov 28, 2020
911f774
Merge branch 'update-more-config-property-names' into run-tests-with-…
trask Nov 28, 2020
29002ea
Bring back hystrix internal prop, I thought it was instrumentation prop
trask Nov 28, 2020
40cb995
Hystrix config
trask Nov 28, 2020
aea5afe
WORK
trask Nov 28, 2020
72dde42
Rename defaultEnabled property to default-enabled
trask Nov 28, 2020
9c855ed
Fix external-annotations test
trask Nov 28, 2020
375ceae
Merge branch 'split-out-two-more-modules' into run-tests-with-agent
trask Nov 28, 2020
b867b30
Merge branch 'rename-default-enabled-prop' into run-tests-with-agent
trask Nov 28, 2020
c1cb569
morework
trask Nov 28, 2020
987daf6
Fix ConfiguredTraceAnnotationsTest
trask Nov 28, 2020
4ab50b7
Merge branch 'split-out-two-more-modules' into run-tests-with-agent
trask Nov 28, 2020
818b84e
Remove ConfigUtils
trask Nov 28, 2020
fcb7026
Removing ConfigUtils still
trask Nov 28, 2020
10e1903
Fixing methods instrumentation test
trask Nov 28, 2020
42c891f
Fix external-annotations tests
trask Nov 28, 2020
dec14a5
Fix opentelemetry-annotations-1.0 tests
trask Nov 28, 2020
fd2f9b9
Less ConfigUtils
trask Nov 28, 2020
17240a6
Working on testing-common
trask Nov 28, 2020
ca24ed1
Remove ConfigUtils from kafka
trask Nov 28, 2020
a13ef3f
Remove ConfigUtils
trask Nov 28, 2020
f83c8da
Delete AgentInstallerAccess and ConfigAccess
trask Nov 28, 2020
4cfe7d9
Temporarily ignore some tests
trask Nov 28, 2020
d4bda6a
Fix compilation errors
trask Nov 28, 2020
05d6e5c
Merge remote-tracking branch 'upstream/master' into run-tests-with-agent
trask Nov 28, 2020
a781ce7
Extract unittest from kubernetes-client
trask Nov 28, 2020
a44d7ea
Extract unittest from jdbc
trask Nov 28, 2020
a6c7b75
Extract unittest from mongo-3.1 and mongo-3.7
trask Nov 28, 2020
64d675c
Spotless
trask Nov 28, 2020
78bd949
Merge remote-tracking branch 'upstream/master' into run-tests-with-agent
trask Nov 28, 2020
09f18c3
Extract unittest from external-annotations
trask Nov 28, 2020
a8b01d2
Consistency in unittests gradle files
trask Nov 28, 2020
805b520
Codenarc
trask Nov 28, 2020
9a52869
Fix opentelemetry-api-1.0 test
trask Nov 28, 2020
5ad267b
Temporarily ignore test
trask Nov 28, 2020
6aabf27
Create javaagent dirs for all instrumentation
trask Nov 29, 2020
7b1d8fe
Format groovy
trask Nov 29, 2020
f3db271
Merge remote-tracking branch 'upstream/master' into run-tests-with-agent
trask Nov 29, 2020
9a2bafa
Remove no longer needed comment
trask Nov 29, 2020
42ed2c9
Cleanup
trask Nov 29, 2020
5d1c386
Cleanup
trask Nov 29, 2020
f822799
Cleanup
trask Nov 30, 2020
42517df
Cleanup
trask Nov 30, 2020
fd75472
Fixes
trask Nov 30, 2020
dbf50bf
Fix javaagent module tests
trask Nov 30, 2020
4560525
Fix javaagent-tooling module tests
trask Nov 30, 2020
39b8390
Turn off debug logging
trask Nov 30, 2020
115b6be
Merge remote-tracking branch 'upstream/master' into run-tests-with-agent
trask Dec 2, 2020
749086c
Merge cleanup
trask Dec 2, 2020
0e0f1d2
Revert "Turn off debug logging"
trask Dec 2, 2020
1813fe1
Merge remote-tracking branch 'upstream/master' into run-tests-with-agent
trask Dec 3, 2020
09d02e7
Merge remote-tracking branch 'upstream/master' into run-tests-with-agent
trask Dec 16, 2020
fc169ed
Merge fixes
trask Dec 16, 2020
0c65803
Fix metrics tests
trask Dec 16, 2020
515f68a
METRICS
trask Dec 17, 2020
f90b056
fixup! METRICS
trask Dec 17, 2020
1de976a
Merge remote-tracking branch 'upstream/master' into run-tests-with-agent
trask Dec 19, 2020
d65463a
Get tests compiling again
trask Dec 19, 2020
dc492e7
Tests
trask Dec 19, 2020
b4ff124
Consistent extra gradle test task
trask Dec 19, 2020
4af856d
Fix testing-common tests
trask Dec 19, 2020
595bf1e
Metrics test working
trask Dec 20, 2020
22b0002
Fix oshi test
trask Dec 20, 2020
a48e2ed
Fix jsp test
trask Dec 20, 2020
8f5a37b
Also percentiles
trask Dec 20, 2020
b638ea3
Add TODO about more tests needed
trask Dec 20, 2020
06cb308
Bring back 2 more tests
trask Dec 20, 2020
4f0574d
Wait for spans inside of traces
trask Dec 20, 2020
e77f1ce
A bit more review
trask Dec 21, 2020
c6bb023
Spotless
trask Dec 20, 2020
0a6a6e8
One more comment
trask Dec 21, 2020
5bfbb7e
Fix gradle logging deadlocks
trask Dec 21, 2020
6befa81
Match comment in javaagent.gradle
trask Dec 21, 2020
1e75760
Ooops
trask Dec 21, 2020
35f0ae7
More oops
trask Dec 21, 2020
3ae6dfb
Still fixing recent InMemoryExporter changes
trask Dec 21, 2020
1f6313d
Fix baggage test
trask Dec 21, 2020
eec252b
Fix the build
trask Dec 21, 2020
3f582c0
Checkstyle
trask Dec 21, 2020
2f26374
Remove code coverage check from testing-common
trask Dec 21, 2020
a44cefd
Spotless
trask Dec 21, 2020
47e7701
Fix new gradle files
trask Dec 21, 2020
584382e
Spotless
trask Dec 21, 2020
2264e26
Fix kotlin coroutine test
trask Dec 21, 2020
21acc89
Fix CI sporadic hanging
trask Dec 21, 2020
fa41e7e
Feedback
trask Dec 21, 2020
1bdec4b
Unnecessary
trask Dec 21, 2020
189a68f
Spotless
trask Dec 21, 2020
742474b
Bring back deadlock
trask Dec 21, 2020
e39246e
Fix gradle output deadlock
trask Dec 22, 2020
a117395
Look for new deadlock
trask Dec 22, 2020
eb58976
To be reverted: --no-build-cache
trask Dec 22, 2020
cbdeb7a
Revert "To be reverted: --no-build-cache"
trask Dec 22, 2020
4607cc3
Revert "Look for new deadlock"
trask Dec 22, 2020
8a673ea
Revert "Fix gradle output deadlock"
trask Dec 22, 2020
1efdffe
Revert "Bring back deadlock"
trask Dec 22, 2020
c684902
Add org.gradle to GlobalIgnoresMatcher
trask Dec 22, 2020
5f19bb2
Bring back cglib ignore
trask Dec 22, 2020
ac643e6
Remove unused code
trask Dec 22, 2020
6aa1eaa
Fix FieldBackedProviderTest's cglib test
trask Dec 23, 2020
063613d
Enable debug logging
trask Dec 23, 2020
839c55e
Fix gradle deadlocking
trask Dec 23, 2020
7824080
Set net.bytebuddy.raw earlier
trask Dec 23, 2020
058225d
Add doc
trask Dec 23, 2020
c0775f5
Can't see github action output
trask Dec 23, 2020
10b1acc
Spotless
trask Dec 23, 2020
5b031c4
Merge remote-tracking branch 'upstream/master' into run-tests-with-agent
trask Dec 23, 2020
8652c1b
Fix undertow tests
trask Dec 23, 2020
b263ce3
Fix undertow tests, take 2
trask Dec 23, 2020
86568f2
Spotless
trask Dec 23, 2020
473acce
Simplify depedencies
trask Dec 23, 2020
db5c58d
More doc
trask Dec 23, 2020
0f7eaf5
Different fix for gradle deadlock
trask Dec 23, 2020
c1991ee
Add link from CONTRIBUTING
trask Dec 23, 2020
b1d4171
Merge remote-tracking branch 'upstream/master' into run-tests-with-agent
trask Dec 24, 2020
f5e2789
Bump timeout for flaky test
trask Dec 24, 2020
ed6a91a
Maybe still seeing a deadlock
trask Dec 23, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove ConfigUtils
  • Loading branch information
trask committed Nov 28, 2020
commit 818b84e02549129b88084143afc27a1ffa24df5d
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,11 @@ def testTraceProviders = tasks.register('testTraceProviders', Test) {
}
}
test.dependsOn(testTraceProviders)

tasks.withType(Test) {
// run ConfiguredTraceAnnotationsTest with this:
jvmArgs "-Dotel.instrumentation.external-annotations.include=package.Class\$Name;OuterClass\$InterestingMethod}"

// run TracedMethodsExclusionTest with this:
jvmArgs "-Dotel.instrumentation.external-annotations.exclude-methods=TracedMethodsExclusionTest\$TestClass.name[excluded,annotatedButExcluded]"
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,12 @@
* SPDX-License-Identifier: Apache-2.0
*/

import static io.opentelemetry.javaagent.instrumentation.extannotations.TraceAnnotationsInstrumentationModule.DEFAULT_ANNOTATIONS

import io.opentelemetry.instrumentation.test.AgentTestRunner
import io.opentelemetry.instrumentation.test.utils.ConfigUtils
import io.opentelemetry.javaagent.instrumentation.extannotations.TraceAnnotationsInstrumentationModule
import io.opentelemetry.test.annotation.SayTracedHello
import java.util.concurrent.Callable

class ConfiguredTraceAnnotationsTest extends AgentTestRunner {
static final PREVIOUS_CONFIG = ConfigUtils.updateConfigAndResetInstrumentation {
it.setProperty("otel.instrumentation.external-annotations.include",
"package.Class\$Name;${OuterClass.InterestingMethod.name}")
}

def specCleanup() {
ConfigUtils.setConfig(PREVIOUS_CONFIG)
}

def "method with disabled NewRelic annotation should be ignored"() {
setup:
Expand All @@ -45,34 +34,35 @@ class ConfiguredTraceAnnotationsTest extends AgentTestRunner {
}
}

def "test configuration #value"() {
setup:
def previousConfig = ConfigUtils.updateConfig {
if (value) {
it.setProperty("otel.instrumentation.external-annotations.include", value)
} else {
it.remove("otel.instrumentation.external.annotations.include")
}
}

expect:
TraceAnnotationsInstrumentationModule.AnnotatedMethodsInstrumentation.configureAdditionalTraceAnnotations() == expected.toSet()

cleanup:
ConfigUtils.setConfig(previousConfig)

where:
value | expected
null | DEFAULT_ANNOTATIONS.toList()
" " | []
"some.Invalid[]" | []
"some.package.ClassName " | ["some.package.ClassName"]
" some.package.Class\$Name" | ["some.package.Class\$Name"]
" ClassName " | ["ClassName"]
"ClassName" | ["ClassName"]
"Class\$1;Class\$2;" | ["Class\$1", "Class\$2"]
"Duplicate ;Duplicate ;Duplicate; " | ["Duplicate"]
}
// TODO rewrite as unit test
// def "test configuration #value"() {
// setup:
// def previousConfig = ConfigUtils.updateConfig {
// if (value) {
// it.setProperty("otel.instrumentation.external-annotations.include", value)
// } else {
// it.remove("otel.instrumentation.external.annotations.include")
// }
// }
//
// expect:
// TraceAnnotationsInstrumentationModule.AnnotatedMethodsInstrumentation.configureAdditionalTraceAnnotations() == expected.toSet()
//
// cleanup:
// ConfigUtils.setConfig(previousConfig)
//
// where:
// value | expected
// null | DEFAULT_ANNOTATIONS.toList()
// " " | []
// "some.Invalid[]" | []
// "some.package.ClassName " | ["some.package.ClassName"]
// " some.package.Class\$Name" | ["some.package.Class\$Name"]
// " ClassName " | ["ClassName"]
// "ClassName" | ["ClassName"]
// "Class\$1;Class\$2;" | ["Class\$1", "Class\$2"]
// "Duplicate ;Duplicate ;Duplicate; " | ["Duplicate"]
// }

static class AnnotationTracedCallable implements Callable<String> {
@OuterClass.InterestingMethod
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,11 @@
* SPDX-License-Identifier: Apache-2.0
*/


import io.opentelemetry.instrumentation.test.AgentTestRunner
import io.opentelemetry.instrumentation.test.utils.ConfigUtils
import io.opentracing.contrib.dropwizard.Trace

class TracedMethodsExclusionTest extends AgentTestRunner {
static final PREVIOUS_CONFIG = ConfigUtils.updateConfigAndResetInstrumentation {
it.setProperty("otel.instrumentation.external-annotations.exclude-methods",
"${TestClass.name}[excluded,annotatedButExcluded]")
}

def cleanupSpec() {
ConfigUtils.setConfig(PREVIOUS_CONFIG)
}

static class TestClass {
//This method is not mentioned in any configuration
Expand Down