File tree Expand file tree Collapse file tree 10 files changed +34
-47
lines changed
aws-xray/src/awsTest/java/io/opentelemetry/contrib/aws/xray
jmx-metrics/src/integrationTest/java/io/opentelemetry/contrib/jmxmetrics/target_systems
jmx-scraper/src/integrationTest/java/io/opentelemetry/contrib/jmxscraper
runtime-attach/runtime-attach Expand file tree Collapse file tree 10 files changed +34
-47
lines changed Original file line number Diff line number Diff line change @@ -111,7 +111,7 @@ jobs:
111111
112112 - name : Test
113113 run : >
114- ./gradlew test
114+ ./gradlew check -x spotlessCheck
115115 "-PtestJavaVersion=${{ matrix.test-java-version }}"
116116 "-Porg.gradle.java.installations.paths=${{ steps.setup-java-test.outputs.path }}"
117117 "-Porg.gradle.java.installations.auto-download=false"
@@ -122,36 +122,6 @@ jobs:
122122 if : ${{ !cancelled() && hashFiles('build-scan.txt') != '' }}
123123 run : cat build-scan.txt
124124
125- integration-test :
126- runs-on : ubuntu-latest
127- steps :
128- - uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
129-
130- - name : Set up JDK for running Gradle
131- uses : actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
132- with :
133- distribution : temurin
134- java-version : 17
135-
136- - name : Set up Gradle
137- uses : gradle/actions/setup-gradle@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 # v5.0.0
138- with :
139- cache-read-only : ${{ inputs.cache-read-only }}
140-
141- - name : Integration test
142- run : ./gradlew integrationTest "-PmaxTestRetries=${{ inputs.max-test-retries }}" ${{ inputs.no-build-cache && '--no-build-cache' || '' }}
143-
144- - name : Build scan
145- if : ${{ !cancelled() && hashFiles('build-scan.txt') != '' }}
146- run : cat build-scan.txt
147-
148- - name : Save integration test results
149- uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
150- if : always()
151- with :
152- name : integration-test-results
153- path : jmx-metrics/build/reports/tests/integrationTest
154-
155125 markdown-lint-check :
156126 uses : ./.github/workflows/reusable-markdown-lint.yml
157127
Original file line number Diff line number Diff line change @@ -31,12 +31,6 @@ To run the tests:
3131./gradlew test
3232```
3333
34- Some modules include integration tests that can be run with:
35-
36- ``` bash
37- ./gradlew integrationTest
38- ```
39-
4034## Snapshot Builds
4135
4236Snapshot builds of the ` main ` branch are available from the Sonatype snapshot repository at:
Original file line number Diff line number Diff line change 1616import java .time .Duration ;
1717import java .util .Collections ;
1818import org .junit .jupiter .api .Test ;
19+ import org .junit .jupiter .api .condition .EnabledIf ;
1920import org .slf4j .Logger ;
2021import org .slf4j .LoggerFactory ;
2122import org .testcontainers .containers .GenericContainer ;
2223import org .testcontainers .containers .output .Slf4jLogConsumer ;
2324import org .testcontainers .containers .wait .strategy .Wait ;
2425import org .testcontainers .junit .jupiter .Container ;
25- import org .testcontainers .junit .jupiter .Testcontainers ;
2626import org .testcontainers .utility .DockerImageName ;
2727import org .testcontainers .utility .MountableFile ;
2828
3131// to update sampling rules and assert rough ratios of sampling decisions. In the meantime, it
3232// expects you to update the rules through the dashboard to see the effect on the sampling decisions
3333// that are printed.
34- @ Testcontainers ( disabledWithoutDocker = true )
34+ @ EnabledIf ( "hasAwsCredentials" )
3535class AwsXrayRemoteSamplerIntegrationTest {
3636
37+ static boolean hasAwsCredentials () {
38+ return System .getenv ("AWS_ACCESS_KEY_ID" ) != null ;
39+ }
40+
3741 private static final Logger logger =
3842 LoggerFactory .getLogger (AwsXrayRemoteSamplerIntegrationTest .class );
3943
Original file line number Diff line number Diff line change @@ -173,6 +173,12 @@ testing {
173173 }
174174}
175175
176+ tasks {
177+ check {
178+ dependsOn(testing.suites)
179+ }
180+ }
181+
176182fun isJavaVersionAllowed (version : JavaVersion ): Boolean {
177183 if (otelJava.minJavaVersionSupported.get() > version) {
178184 return false
Original file line number Diff line number Diff line change @@ -50,7 +50,11 @@ testing {
5050 targets {
5151 all {
5252 testTask.configure {
53- shouldRunAfter(tasks.test)
53+ // Jakarta JMS requires Java 11+
54+ val testJavaVersion: String? by project
55+ if (testJavaVersion == " 8" ) {
56+ enabled = false
57+ }
5458 }
5559 }
5660 }
Original file line number Diff line number Diff line change 1111import io .opentelemetry .proto .metrics .v1 .Metric ;
1212import java .time .Duration ;
1313import org .junit .jupiter .api .Test ;
14+ import org .junit .jupiter .api .condition .DisabledOnJre ;
15+ import org .junit .jupiter .api .condition .JRE ;
1416import org .testcontainers .containers .GenericContainer ;
1517import org .testcontainers .containers .Network ;
1618import org .testcontainers .containers .wait .strategy .Wait ;
1719import org .testcontainers .junit .jupiter .Container ;
1820
21+ // possible workaround on Java 8:
22+ // https://stackoverflow.com/questions/35466461/how-to-connect-with-jmx-from-host-to-docker-container-in-docker-machine
23+ @ DisabledOnJre (JRE .JAVA_8 )
1924class SolrIntegrationTest extends AbstractIntegrationTest {
2025
2126 SolrIntegrationTest () {
Original file line number Diff line number Diff line change 2323import org .testcontainers .containers .GenericContainer ;
2424import org .testcontainers .containers .Network ;
2525import org .testcontainers .containers .output .Slf4jLogConsumer ;
26+ import org .testcontainers .junit .jupiter .Testcontainers ;
2627
2728/**
2829 * Tests all supported ways to connect to remote JMX interface. This indirectly tests
2930 * JmxConnectionBuilder and relies on containers to minimize the JMX/RMI network complications which
3031 * are not NAT-friendly.
3132 */
33+ @ Testcontainers (disabledWithoutDocker = true )
3234class JmxConnectionTest {
3335
3436 // OTLP endpoint is not used in test mode, but still has to be provided
Original file line number Diff line number Diff line change 1414import io .opentelemetry .contrib .jmxscraper .assertions .AttributeMatcherGroup ;
1515import java .nio .file .Path ;
1616import java .time .Duration ;
17+ import org .junit .jupiter .api .condition .DisabledOnJre ;
18+ import org .junit .jupiter .api .condition .JRE ;
1719import org .testcontainers .containers .GenericContainer ;
1820import org .testcontainers .containers .Network ;
1921import org .testcontainers .containers .wait .strategy .Wait ;
2022
23+ // possible workaround on Java 8:
24+ // https://stackoverflow.com/questions/35466461/how-to-connect-with-jmx-from-host-to-docker-container-in-docker-machine
25+ @ DisabledOnJre (JRE .JAVA_8 )
2126class SolrIntegrationTest extends TargetSystemIntegrationTest {
2227
2328 @ Override
Original file line number Diff line number Diff line change 77
88import static org .assertj .core .api .Assertions .assertThat ;
99import static org .awaitility .Awaitility .await ;
10+ import static org .testcontainers .Testcontainers .exposeHostPorts ;
1011
1112import com .linecorp .armeria .server .ServerBuilder ;
1213import com .linecorp .armeria .server .grpc .GrpcService ;
3536import org .junit .jupiter .api .io .TempDir ;
3637import org .slf4j .Logger ;
3738import org .slf4j .LoggerFactory ;
38- import org .testcontainers .Testcontainers ;
3939import org .testcontainers .containers .GenericContainer ;
4040import org .testcontainers .containers .Network ;
4141import org .testcontainers .containers .output .Slf4jLogConsumer ;
42+ import org .testcontainers .junit .jupiter .Testcontainers ;
4243
44+ @ Testcontainers (disabledWithoutDocker = true )
4345public abstract class TargetSystemIntegrationTest {
4446 private static final Logger logger = LoggerFactory .getLogger (TargetSystemIntegrationTest .class );
4547 private static final Logger targetSystemLogger = LoggerFactory .getLogger ("TargetSystemContainer" );
@@ -72,7 +74,7 @@ static void beforeAll() {
7274 network = Network .newNetwork ();
7375 otlpServer = new OtlpGrpcServer ();
7476 otlpServer .start ();
75- Testcontainers . exposeHostPorts (otlpServer .httpPort ());
77+ exposeHostPorts (otlpServer .httpPort ());
7678 otlpEndpoint = "http://" + OTLP_HOST + ":" + otlpServer .httpPort ();
7779 }
7880
Original file line number Diff line number Diff line change @@ -59,9 +59,4 @@ tasks {
5959 excludeTestsMatching(" AgentDisabledBySystemPropertyTest" )
6060 }
6161 }
62-
63- check {
64- dependsOn(testAgentDisabledByEnvironmentVariable)
65- dependsOn(testAgentDisabledBySystemProperty)
66- }
6762}
You can’t perform that action at this time.
0 commit comments