Skip to content

Commit c37b210

Browse files
committed
Merge remote-tracking branch 'upstream/main' into update-develocity-config
2 parents 7710237 + 57c7cf2 commit c37b210

File tree

12 files changed

+118
-110
lines changed

12 files changed

+118
-110
lines changed

examples/distro/smoke-tests/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ plugins {
55
dependencies {
66
testImplementation("org.testcontainers:testcontainers:1.20.4")
77
testImplementation("com.fasterxml.jackson.core:jackson-databind:2.18.2")
8-
testImplementation("com.google.protobuf:protobuf-java-util:4.29.0")
8+
testImplementation("com.google.protobuf:protobuf-java-util:4.29.1")
99
testImplementation("com.squareup.okhttp3:okhttp:4.12.0")
1010
testImplementation("io.opentelemetry.proto:opentelemetry-proto:1.4.0-alpha")
1111
testImplementation("io.opentelemetry:opentelemetry-api")

examples/extension/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ dependencies {
101101
//All dependencies below are only for tests
102102
testImplementation("org.testcontainers:testcontainers:1.20.4")
103103
testImplementation("com.fasterxml.jackson.core:jackson-databind:2.18.2")
104-
testImplementation("com.google.protobuf:protobuf-java-util:4.29.0")
104+
testImplementation("com.google.protobuf:protobuf-java-util:4.29.1")
105105
testImplementation("com.squareup.okhttp3:okhttp:4.12.0")
106106
testImplementation("io.opentelemetry:opentelemetry-api")
107107
testImplementation("io.opentelemetry.proto:opentelemetry-proto:1.4.0-alpha")

instrumentation/vertx/vertx-web-3.0/javaagent/src/latestDepTest/groovy/server/VertxLatestHttpServerTest.groovy

Lines changed: 0 additions & 17 deletions
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Copyright The OpenTelemetry Authors
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
package io.opentelemetry.javaagent.instrumentation.vertx;
7+
8+
import io.vertx.core.AbstractVerticle;
9+
import io.vertx.core.Vertx;
10+
11+
class VertxLatestHttpServerTest extends AbstractVertxHttpServerTest {
12+
13+
@Override
14+
protected Class<? extends AbstractVerticle> verticle() {
15+
return VertxLatestWebServer.class;
16+
}
17+
18+
@Override
19+
protected void stopServer(Vertx server) throws Exception {
20+
server.close();
21+
}
22+
}

instrumentation/vertx/vertx-web-3.0/javaagent/src/latestDepTest/java/server/VertxLatestWebServer.java renamed to instrumentation/vertx/vertx-web-3.0/javaagent/src/latestDepTest/java/io/opentelemetry/javaagent/instrumentation/vertx/VertxLatestWebServer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
package server;
6+
package io.opentelemetry.javaagent.instrumentation.vertx;
77

88
import io.vertx.core.Promise;
99
import io.vertx.core.http.HttpServerResponse;

instrumentation/vertx/vertx-web-3.0/javaagent/src/version3Test/groovy/server/VertxHttpServerTest.groovy renamed to instrumentation/vertx/vertx-web-3.0/javaagent/src/version3Test/java/io/opentelemetry/javaagent/instrumentation/vertx/VertxHttpServerTest.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,13 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
package server
6+
package io.opentelemetry.javaagent.instrumentation.vertx;
77

8-
import io.vertx.core.AbstractVerticle
8+
import io.vertx.core.AbstractVerticle;
99

1010
class VertxHttpServerTest extends AbstractVertxHttpServerTest {
11-
1211
@Override
1312
protected Class<? extends AbstractVerticle> verticle() {
14-
return VertxWebServer
13+
return VertxWebServer.class;
1514
}
1615
}

instrumentation/vertx/vertx-web-3.0/javaagent/src/version3Test/java/server/VertxWebServer.java renamed to instrumentation/vertx/vertx-web-3.0/javaagent/src/version3Test/java/io/opentelemetry/javaagent/instrumentation/vertx/VertxWebServer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
package server;
6+
package io.opentelemetry.javaagent.instrumentation.vertx;
77

88
import io.vertx.core.Future;
99
import io.vertx.core.http.HttpServerResponse;

instrumentation/vertx/vertx-web-3.0/testing/src/main/groovy/server/AbstractVertxHttpServerTest.groovy

Lines changed: 0 additions & 83 deletions
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
/*
2+
* Copyright The OpenTelemetry Authors
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
package io.opentelemetry.javaagent.instrumentation.vertx;
7+
8+
import io.opentelemetry.instrumentation.api.internal.HttpConstants;
9+
import io.opentelemetry.instrumentation.testing.junit.InstrumentationExtension;
10+
import io.opentelemetry.instrumentation.testing.junit.http.AbstractHttpServerTest;
11+
import io.opentelemetry.instrumentation.testing.junit.http.HttpServerInstrumentationExtension;
12+
import io.opentelemetry.instrumentation.testing.junit.http.HttpServerTestOptions;
13+
import io.opentelemetry.instrumentation.testing.junit.http.ServerEndpoint;
14+
import io.vertx.core.AbstractVerticle;
15+
import io.vertx.core.DeploymentOptions;
16+
import io.vertx.core.Vertx;
17+
import io.vertx.core.VertxOptions;
18+
import io.vertx.core.json.JsonObject;
19+
import java.util.Objects;
20+
import java.util.concurrent.CompletableFuture;
21+
import java.util.concurrent.ExecutionException;
22+
import java.util.concurrent.TimeUnit;
23+
import java.util.concurrent.TimeoutException;
24+
import org.junit.jupiter.api.extension.RegisterExtension;
25+
26+
abstract class AbstractVertxHttpServerTest extends AbstractHttpServerTest<Vertx> {
27+
28+
@RegisterExtension
29+
static final InstrumentationExtension testing = HttpServerInstrumentationExtension.forAgent();
30+
31+
@Override
32+
protected void configure(HttpServerTestOptions options) {
33+
super.configure(options);
34+
options.setTestPathParam(true);
35+
// server spans are ended inside of the controller spans
36+
options.setVerifyServerSpanEndTime(false);
37+
options.setContextPath("/vertx-app");
38+
options.setExpectedHttpRoute(
39+
(endpoint, method) -> {
40+
if (Objects.equals(method, HttpConstants._OTHER)) {
41+
return getContextPath() + endpoint.getPath();
42+
}
43+
if (Objects.equals(endpoint, ServerEndpoint.NOT_FOUND)) {
44+
return getContextPath();
45+
}
46+
return super.expectedHttpRoute(endpoint, method);
47+
});
48+
}
49+
50+
@Override
51+
protected Vertx setupServer()
52+
throws ExecutionException, InterruptedException, TimeoutException, NoSuchMethodException {
53+
Vertx server =
54+
Vertx.vertx(
55+
new VertxOptions()
56+
// Useful for debugging:
57+
// .setBlockedThreadCheckInterval(Integer.MAX_VALUE)
58+
);
59+
CompletableFuture<Void> future = new CompletableFuture<>();
60+
61+
server.deployVerticle(
62+
verticle().getName(),
63+
new DeploymentOptions()
64+
.setConfig(
65+
new JsonObject().put(AbstractVertxWebServer.CONFIG_HTTP_SERVER_PORT, (Object) port))
66+
.setInstances(3),
67+
res -> {
68+
if (!res.succeeded()) {
69+
throw new IllegalStateException("Cannot deploy server Verticle", res.cause());
70+
}
71+
future.complete(null);
72+
});
73+
74+
future.get(30, TimeUnit.SECONDS);
75+
return server;
76+
}
77+
78+
@Override
79+
protected void stopServer(Vertx server) throws Exception {
80+
server.close();
81+
}
82+
83+
protected abstract Class<? extends AbstractVerticle> verticle();
84+
}

instrumentation/vertx/vertx-web-3.0/testing/src/main/java/server/AbstractVertxWebServer.java renamed to instrumentation/vertx/vertx-web-3.0/testing/src/main/java/io/opentelemetry/javaagent/instrumentation/vertx/AbstractVertxWebServer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
package server;
6+
package io.opentelemetry.javaagent.instrumentation.vertx;
77

88
import static io.opentelemetry.instrumentation.testing.junit.http.AbstractHttpServerTest.controller;
99
import static io.opentelemetry.instrumentation.testing.junit.http.ServerEndpoint.CAPTURE_HEADERS;

0 commit comments

Comments
 (0)