-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Expand file tree
/
Copy pathQuarkusSmokeTest.java
More file actions
50 lines (42 loc) · 1.71 KB
/
Copy pathQuarkusSmokeTest.java
File metadata and controls
50 lines (42 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
* Copyright The OpenTelemetry Authors
* SPDX-License-Identifier: Apache-2.0
*/
package io.opentelemetry.smoketest;
import static io.opentelemetry.semconv.ServiceAttributes.SERVICE_NAME;
import static io.opentelemetry.semconv.TelemetryAttributes.TELEMETRY_DISTRO_VERSION;
import java.time.Duration;
import org.junit.jupiter.api.condition.DisabledIf;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;
@DisabledIf("io.opentelemetry.smoketest.TestContainerManager#useWindowsContainers")
class QuarkusSmokeTest extends AbstractSmokeTest<Integer> {
@Override
protected void configure(SmokeTestOptions<Integer> options) {
options
.image(
jdk ->
String.format(
"ghcr.io/open-telemetry/opentelemetry-java-instrumentation/smoke-test-quarkus:jdk%s-%s",
jdk, TestImageVersions.QUARKUS_VERSION))
.waitStrategy(new TargetWaitStrategy.Log(Duration.ofMinutes(1), ".*Listening on.*"))
.setServiceName(false);
}
@ParameterizedTest
@ValueSource(ints = {17, 21, 25}) // Quarkus 3.7+ requires Java 17+
void quarkusSmokeTest(int jdk) {
start(jdk);
client().get("/hello").aggregate().join();
testing.waitAndAssertTraces(
trace ->
trace.hasSpansSatisfyingExactly(
span ->
span.hasName("GET /hello")
.hasResourceSatisfying(
resource -> {
resource
.hasAttribute(TELEMETRY_DISTRO_VERSION, getAgentVersion())
.hasAttribute(SERVICE_NAME, "quarkus");
})));
}
}