Merge eb5157b662 into 9332f4d5aa
This commit is contained in:
commit
a5cdc9f6a1
|
|
@ -12,17 +12,14 @@ import org.junit.jupiter.api.condition.DisabledIf;
|
|||
|
||||
@DisabledIf("io.opentelemetry.smoketest.TestContainerManager#useWindowsContainers")
|
||||
class AgentDebugLoggingTest extends JavaSmokeTest {
|
||||
@Override
|
||||
protected String getTargetImage(String jdk) {
|
||||
return "ghcr.io/open-telemetry/opentelemetry-java-instrumentation/smoke-test-spring-boot:jdk"
|
||||
+ jdk
|
||||
+ "-20250915.17728045097";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected TargetWaitStrategy getWaitStrategy() {
|
||||
return new TargetWaitStrategy.Log(
|
||||
Duration.ofMinutes(1), ".*DEBUG io.opentelemetry.javaagent.tooling.VersionLogger.*");
|
||||
public AgentDebugLoggingTest() {
|
||||
super(
|
||||
SmokeTestTarget.springBoot("20250915.17728045097")
|
||||
.waitStrategy(
|
||||
new TargetWaitStrategy.Log(
|
||||
Duration.ofMinutes(1),
|
||||
".*DEBUG io.opentelemetry.javaagent.tooling.VersionLogger.*")));
|
||||
}
|
||||
|
||||
@DisplayName("verifies that debug logging is working by checking for a debug log on startup")
|
||||
|
|
|
|||
|
|
@ -12,36 +12,19 @@ import io.opentelemetry.semconv.incubating.ContainerIncubatingAttributes;
|
|||
import io.opentelemetry.semconv.incubating.HostIncubatingAttributes;
|
||||
import io.opentelemetry.semconv.incubating.ProcessIncubatingAttributes;
|
||||
import io.opentelemetry.semconv.incubating.TelemetryIncubatingAttributes;
|
||||
import java.time.Duration;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
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 DeclarativeConfigurationSmokeTest extends JavaSmokeTest {
|
||||
@Override
|
||||
protected String getTargetImage(String jdk) {
|
||||
return "ghcr.io/open-telemetry/opentelemetry-java-instrumentation/smoke-test-spring-boot:jdk"
|
||||
+ jdk
|
||||
+ "-20241021.11448062567";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<ResourceMapping> getExtraResources() {
|
||||
return List.of(ResourceMapping.of("declarative-config.yaml", "/declarative-config.yaml"));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Map<String, String> getExtraEnv() {
|
||||
return Map.of("OTEL_EXPERIMENTAL_CONFIG_FILE", "declarative-config.yaml");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected TargetWaitStrategy getWaitStrategy() {
|
||||
return new TargetWaitStrategy.Log(
|
||||
Duration.ofMinutes(1), ".*Started SpringbootApplication in.*");
|
||||
public DeclarativeConfigurationSmokeTest() {
|
||||
super(
|
||||
SmokeTestTarget.springBoot("20241021.11448062567")
|
||||
.env("OTEL_EXPERIMENTAL_CONFIG_FILE", "declarative-config.yaml")
|
||||
.extraResources(
|
||||
ResourceMapping.of("declarative-config.yaml", "/declarative-config.yaml")));
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
|
|
|
|||
|
|
@ -5,8 +5,6 @@
|
|||
|
||||
package io.opentelemetry.smoketest;
|
||||
|
||||
import static java.util.Collections.emptyList;
|
||||
import static java.util.Collections.emptyMap;
|
||||
import static java.util.stream.Collectors.toSet;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
|
|
@ -14,8 +12,6 @@ import io.opentelemetry.instrumentation.testing.internal.AutoCleanupExtension;
|
|||
import io.opentelemetry.instrumentation.testing.junit.InstrumentationExtension;
|
||||
import io.opentelemetry.smoketest.windows.WindowsTestContainerManager;
|
||||
import io.opentelemetry.testing.internal.armeria.client.WebClient;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.regex.Pattern;
|
||||
|
|
@ -33,6 +29,8 @@ public abstract class JavaSmokeTest implements TelemetryRetrieverProvider {
|
|||
private static final Pattern TRACE_ID_PATTERN =
|
||||
Pattern.compile(".*trace_id=(?<traceId>[a-zA-Z0-9]+).*");
|
||||
protected static final TestContainerManager containerManager = createContainerManager();
|
||||
|
||||
private final SmokeTestTarget target;
|
||||
private static TelemetryRetriever telemetryRetriever;
|
||||
|
||||
protected String agentPath =
|
||||
|
|
@ -40,38 +38,18 @@ public abstract class JavaSmokeTest implements TelemetryRetrieverProvider {
|
|||
|
||||
@RegisterExtension static final AutoCleanupExtension autoCleanup = AutoCleanupExtension.create();
|
||||
|
||||
protected WebClient client() {
|
||||
public JavaSmokeTest(SmokeTestTarget.Builder builder) {
|
||||
this.target = customize(builder).build();
|
||||
}
|
||||
|
||||
protected SmokeTestTarget.Builder customize(SmokeTestTarget.Builder builder) {
|
||||
return builder;
|
||||
}
|
||||
|
||||
public WebClient client() {
|
||||
return WebClient.of("h1c://localhost:" + containerManager.getTargetMappedPort(8080));
|
||||
}
|
||||
|
||||
/** Subclasses can override this method to pass jvm arguments in another environment variable */
|
||||
protected String getJvmArgsEnvVarName() {
|
||||
return "JAVA_TOOL_OPTIONS";
|
||||
}
|
||||
|
||||
/** Subclasses can override this method to customise target application's environment */
|
||||
protected Map<String, String> getExtraEnv() {
|
||||
return emptyMap();
|
||||
}
|
||||
|
||||
/** Subclasses can override this method to disable setting default service name */
|
||||
protected boolean getSetServiceName() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/** Subclasses can override this method to provide additional files to copy to target container */
|
||||
protected List<ResourceMapping> getExtraResources() {
|
||||
return emptyList();
|
||||
}
|
||||
|
||||
/**
|
||||
* Subclasses can override this method to provide additional ports that should be exposed from the
|
||||
* target container
|
||||
*/
|
||||
protected List<Integer> getExtraPorts() {
|
||||
return emptyList();
|
||||
}
|
||||
|
||||
@BeforeAll
|
||||
static void setUp() {
|
||||
containerManager.startEnvironmentOnce();
|
||||
|
|
@ -83,33 +61,19 @@ public abstract class JavaSmokeTest implements TelemetryRetrieverProvider {
|
|||
}
|
||||
|
||||
protected Consumer<OutputFrame> startTarget(String jdk, String serverVersion, boolean windows) {
|
||||
String targetImage = getTargetImage(jdk, serverVersion, windows);
|
||||
String targetImage = target.getTargetImage(jdk, serverVersion, windows);
|
||||
autoCleanup.deferCleanup(() -> containerManager.stopTarget());
|
||||
|
||||
return containerManager.startTarget(
|
||||
targetImage,
|
||||
agentPath,
|
||||
getJvmArgsEnvVarName(),
|
||||
getExtraEnv(),
|
||||
getSetServiceName(),
|
||||
getExtraResources(),
|
||||
getExtraPorts(),
|
||||
getWaitStrategy(),
|
||||
getCommand());
|
||||
}
|
||||
|
||||
protected abstract String getTargetImage(String jdk);
|
||||
|
||||
protected String getTargetImage(String jdk, String serverVersion, boolean windows) {
|
||||
return getTargetImage(jdk);
|
||||
}
|
||||
|
||||
protected TargetWaitStrategy getWaitStrategy() {
|
||||
return null;
|
||||
}
|
||||
|
||||
protected String[] getCommand() {
|
||||
return null;
|
||||
target.getJvmArgsEnvVarName(),
|
||||
target.getExtraEnv(),
|
||||
target.getSetServiceName(),
|
||||
target.getExtraResources(),
|
||||
target.getExtraPorts(),
|
||||
target.getWaitStrategy(),
|
||||
target.getCommand());
|
||||
}
|
||||
|
||||
protected static void assertVersionLogged(Consumer<OutputFrame> output, String version) {
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ package io.opentelemetry.smoketest;
|
|||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import io.opentelemetry.sdk.logs.data.LogRecordData;
|
||||
import java.time.Duration;
|
||||
import java.util.Collection;
|
||||
import org.junit.jupiter.api.condition.DisabledIf;
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
|
|
@ -16,17 +15,9 @@ import org.junit.jupiter.params.provider.ValueSource;
|
|||
|
||||
@DisabledIf("io.opentelemetry.smoketest.TestContainerManager#useWindowsContainers")
|
||||
class LogsSmokeTest extends JavaSmokeTest {
|
||||
@Override
|
||||
protected String getTargetImage(String jdk) {
|
||||
return "ghcr.io/open-telemetry/opentelemetry-java-instrumentation/smoke-test-spring-boot:jdk"
|
||||
+ jdk
|
||||
+ "-20211213.1570880324";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected TargetWaitStrategy getWaitStrategy() {
|
||||
return new TargetWaitStrategy.Log(
|
||||
Duration.ofMinutes(1), ".*Started SpringbootApplication in.*");
|
||||
public LogsSmokeTest() {
|
||||
super(SmokeTestTarget.springBoot("20211213.1570880324"));
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
|
|
|
|||
|
|
@ -16,21 +16,16 @@ import org.junit.jupiter.params.provider.ValueSource;
|
|||
|
||||
@DisabledIf("io.opentelemetry.smoketest.TestContainerManager#useWindowsContainers")
|
||||
class QuarkusSmokeTest extends JavaSmokeTest {
|
||||
@Override
|
||||
protected String getTargetImage(String jdk) {
|
||||
return "ghcr.io/open-telemetry/opentelemetry-java-instrumentation/smoke-test-quarkus:jdk"
|
||||
+ jdk
|
||||
+ "-20250915.17728045126";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected TargetWaitStrategy getWaitStrategy() {
|
||||
return new TargetWaitStrategy.Log(Duration.ofMinutes(1), ".*Listening on.*");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean getSetServiceName() {
|
||||
return false;
|
||||
public QuarkusSmokeTest() {
|
||||
super(
|
||||
SmokeTestTarget.builder(
|
||||
jdk ->
|
||||
"ghcr.io/open-telemetry/opentelemetry-java-instrumentation/smoke-test-quarkus:jdk"
|
||||
+ jdk
|
||||
+ "-20250915.17728045126")
|
||||
.waitStrategy(new TargetWaitStrategy.Log(Duration.ofMinutes(1), ".*Listening on.*"))
|
||||
.setServiceName(false));
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ package io.opentelemetry.smoketest;
|
|||
|
||||
import static io.opentelemetry.sdk.testing.assertj.OpenTelemetryAssertions.assertThat;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.jar.Attributes;
|
||||
import java.util.jar.JarFile;
|
||||
|
|
@ -18,16 +17,9 @@ import org.testcontainers.containers.output.OutputFrame;
|
|||
|
||||
@DisabledIf("io.opentelemetry.smoketest.TestContainerManager#useWindowsContainers")
|
||||
class SdkDisabledSmokeTest extends JavaSmokeTest {
|
||||
@Override
|
||||
protected String getTargetImage(String jdk) {
|
||||
return "ghcr.io/open-telemetry/opentelemetry-java-instrumentation/smoke-test-spring-boot:jdk"
|
||||
+ jdk
|
||||
+ "-20211213.1570880324";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Map<String, String> getExtraEnv() {
|
||||
return Map.of("OTEL_SDK_DISABLED", "true");
|
||||
public SdkDisabledSmokeTest() {
|
||||
super(SmokeTestTarget.springBoot("20211213.1570880324").env("OTEL_SDK_DISABLED", "true"));
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
|
|
|
|||
|
|
@ -5,8 +5,6 @@
|
|||
|
||||
package io.opentelemetry.smoketest;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
import org.junit.jupiter.api.condition.DisabledIf;
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.ValueSource;
|
||||
|
|
@ -14,17 +12,14 @@ import org.junit.jupiter.params.provider.ValueSource;
|
|||
@DisabledIf("io.opentelemetry.smoketest.TestContainerManager#useWindowsContainers")
|
||||
class SecurityManagerSmokeTest extends JavaSmokeTest {
|
||||
|
||||
@Override
|
||||
protected String getTargetImage(String jdk) {
|
||||
return "ghcr.io/open-telemetry/opentelemetry-java-instrumentation/smoke-test-security-manager:jdk"
|
||||
+ jdk
|
||||
+ "-20250915.17728045123";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Map<String, String> getExtraEnv() {
|
||||
return Collections.singletonMap(
|
||||
"OTEL_JAVAAGENT_EXPERIMENTAL_SECURITY_MANAGER_SUPPORT_ENABLED", "true");
|
||||
public SecurityManagerSmokeTest() {
|
||||
super(
|
||||
SmokeTestTarget.builder(
|
||||
jdk ->
|
||||
"ghcr.io/open-telemetry/opentelemetry-java-instrumentation/smoke-test-security-manager:jdk"
|
||||
+ jdk
|
||||
+ "-20250915.17728045123")
|
||||
.env("OTEL_JAVAAGENT_EXPERIMENTAL_SECURITY_MANAGER_SUPPORT_ENABLED", "true"));
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
|
|
|
|||
|
|
@ -0,0 +1,171 @@
|
|||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
package io.opentelemetry.smoketest;
|
||||
|
||||
import java.time.Duration;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class SmokeTestTarget {
|
||||
|
||||
@FunctionalInterface
|
||||
public interface GetTargetImage {
|
||||
String getTargetImage(String jdk, String serverVersion, boolean windows);
|
||||
}
|
||||
|
||||
private final GetTargetImage getTargetImage;
|
||||
|
||||
private final String[] command;
|
||||
private final String jvmArgsEnvVarName;
|
||||
private final boolean setServiceName;
|
||||
private final Map<String, String> extraEnv;
|
||||
private final List<ResourceMapping> extraResources;
|
||||
private final TargetWaitStrategy waitStrategy;
|
||||
private final List<Integer> extraPorts;
|
||||
|
||||
public SmokeTestTarget(
|
||||
GetTargetImage getTargetImage,
|
||||
String[] command,
|
||||
String jvmArgsEnvVarName,
|
||||
boolean setServiceName,
|
||||
Map<String, String> extraEnv,
|
||||
List<ResourceMapping> extraResources,
|
||||
TargetWaitStrategy waitStrategy,
|
||||
List<Integer> extraPorts) {
|
||||
this.getTargetImage = getTargetImage;
|
||||
this.command = command;
|
||||
this.jvmArgsEnvVarName = jvmArgsEnvVarName;
|
||||
this.setServiceName = setServiceName;
|
||||
this.extraEnv = extraEnv;
|
||||
this.extraResources = extraResources;
|
||||
this.waitStrategy = waitStrategy;
|
||||
this.extraPorts = extraPorts;
|
||||
}
|
||||
|
||||
public String getTargetImage(String jdk, String serverVersion, boolean windows) {
|
||||
return getTargetImage.getTargetImage(jdk, serverVersion, windows);
|
||||
}
|
||||
|
||||
public String[] getCommand() {
|
||||
return command;
|
||||
}
|
||||
|
||||
/** Subclasses can override this method to pass jvm arguments in another environment variable */
|
||||
public String getJvmArgsEnvVarName() {
|
||||
return jvmArgsEnvVarName;
|
||||
}
|
||||
|
||||
/** Subclasses can override this method to customise target application's environment */
|
||||
public Map<String, String> getExtraEnv() {
|
||||
return extraEnv;
|
||||
}
|
||||
|
||||
/** Subclasses can override this method to disable setting default service name */
|
||||
public boolean getSetServiceName() {
|
||||
return setServiceName;
|
||||
}
|
||||
|
||||
/** Subclasses can override this method to provide additional files to copy to target container */
|
||||
public List<ResourceMapping> getExtraResources() {
|
||||
return extraResources;
|
||||
}
|
||||
|
||||
/**
|
||||
* Subclasses can override this method to provide additional ports that should be exposed from the
|
||||
* target container
|
||||
*/
|
||||
public List<Integer> getExtraPorts() {
|
||||
return extraPorts;
|
||||
}
|
||||
|
||||
public TargetWaitStrategy getWaitStrategy() {
|
||||
return waitStrategy;
|
||||
}
|
||||
|
||||
public static Builder builder(Function<String, String> getTargetImage) {
|
||||
return builder((jdk, serverVersion, windows) -> getTargetImage.apply(jdk));
|
||||
}
|
||||
|
||||
public static Builder builder(GetTargetImage getTargetImage) {
|
||||
return new Builder(getTargetImage);
|
||||
}
|
||||
|
||||
public static Builder springBoot(String imageTag) {
|
||||
return builder(
|
||||
jdk ->
|
||||
String.format(
|
||||
"ghcr.io/open-telemetry/opentelemetry-java-instrumentation/smoke-test-spring-boot:jdk%s-%s",
|
||||
jdk, imageTag))
|
||||
.waitStrategy(
|
||||
new TargetWaitStrategy.Log(
|
||||
Duration.ofMinutes(1), ".*Started SpringbootApplication in.*"));
|
||||
}
|
||||
|
||||
public static class Builder {
|
||||
private final GetTargetImage getTargetImage;
|
||||
private String[] command;
|
||||
private String jvmArgsEnvVarName = "JAVA_TOOL_OPTIONS";
|
||||
private boolean setServiceName = true;
|
||||
private final Map<String, String> extraEnv = new HashMap<>();
|
||||
private List<ResourceMapping> extraResources = List.of();
|
||||
private TargetWaitStrategy waitStrategy;
|
||||
private List<Integer> extraPorts = List.of();
|
||||
|
||||
private Builder(GetTargetImage getTargetImage) {
|
||||
this.getTargetImage = getTargetImage;
|
||||
}
|
||||
|
||||
public Builder command(String... command) {
|
||||
this.command = command;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder jvmArgsEnvVarName(String jvmArgsEnvVarName) {
|
||||
this.jvmArgsEnvVarName = jvmArgsEnvVarName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setServiceName(boolean setServiceName) {
|
||||
this.setServiceName = setServiceName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder env(String key, String value) {
|
||||
this.extraEnv.put(key, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder extraResources(ResourceMapping... resources) {
|
||||
this.extraResources = List.of(resources);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder waitStrategy(@Nullable TargetWaitStrategy waitStrategy) {
|
||||
this.waitStrategy = waitStrategy;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder extraPorts(Integer... ports) {
|
||||
this.extraPorts = List.of(ports);
|
||||
return this;
|
||||
}
|
||||
|
||||
public SmokeTestTarget build() {
|
||||
return new SmokeTestTarget(
|
||||
getTargetImage,
|
||||
command,
|
||||
jvmArgsEnvVarName,
|
||||
setServiceName,
|
||||
extraEnv,
|
||||
extraResources,
|
||||
waitStrategy,
|
||||
extraPorts);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -14,9 +14,7 @@ import io.opentelemetry.semconv.ServiceAttributes;
|
|||
import io.opentelemetry.semconv.incubating.OsIncubatingAttributes;
|
||||
import io.opentelemetry.semconv.incubating.TelemetryIncubatingAttributes;
|
||||
import io.opentelemetry.semconv.incubating.ThreadIncubatingAttributes;
|
||||
import java.time.Duration;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.jar.Attributes;
|
||||
|
|
@ -29,27 +27,13 @@ import org.testcontainers.containers.output.OutputFrame;
|
|||
|
||||
@DisabledIf("io.opentelemetry.smoketest.TestContainerManager#useWindowsContainers")
|
||||
class SpringBootSmokeTest extends JavaSmokeTest {
|
||||
@Override
|
||||
protected String getTargetImage(String jdk) {
|
||||
return "ghcr.io/open-telemetry/opentelemetry-java-instrumentation/smoke-test-spring-boot:jdk"
|
||||
+ jdk
|
||||
+ "-20241021.11448062567";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean getSetServiceName() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Map<String, String> getExtraEnv() {
|
||||
return Map.of("OTEL_METRICS_EXPORTER", "otlp", "OTEL_RESOURCE_ATTRIBUTES", "foo=bar");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected TargetWaitStrategy getWaitStrategy() {
|
||||
return new TargetWaitStrategy.Log(
|
||||
Duration.ofMinutes(1), ".*Started SpringbootApplication in.*");
|
||||
public SpringBootSmokeTest() {
|
||||
super(
|
||||
SmokeTestTarget.springBoot("20241021.11448062567")
|
||||
.setServiceName(false)
|
||||
.env("OTEL_METRICS_EXPORTER", "otlp")
|
||||
.env("OTEL_RESOURCE_ATTRIBUTES", "foo=bar"));
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
|
|
|
|||
|
|
@ -5,13 +5,14 @@
|
|||
|
||||
package io.opentelemetry.smoketest.propagation;
|
||||
|
||||
import java.util.Map;
|
||||
import io.opentelemetry.smoketest.SmokeTestTarget;
|
||||
import org.junit.jupiter.api.condition.DisabledIf;
|
||||
|
||||
@DisabledIf("io.opentelemetry.smoketest.TestContainerManager#useWindowsContainers")
|
||||
class B3MultiPropagationTest extends PropagationTest {
|
||||
|
||||
@Override
|
||||
protected Map<String, String> getExtraEnv() {
|
||||
return Map.of("otel.propagators", "b3multi");
|
||||
protected SmokeTestTarget.Builder customize(SmokeTestTarget.Builder builder) {
|
||||
return builder.env("otel.propagators", "b3multi");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,13 +5,14 @@
|
|||
|
||||
package io.opentelemetry.smoketest.propagation;
|
||||
|
||||
import java.util.Map;
|
||||
import io.opentelemetry.smoketest.SmokeTestTarget;
|
||||
import org.junit.jupiter.api.condition.DisabledIf;
|
||||
|
||||
@DisabledIf("io.opentelemetry.smoketest.TestContainerManager#useWindowsContainers")
|
||||
class B3PropagationTest extends PropagationTest {
|
||||
|
||||
@Override
|
||||
protected Map<String, String> getExtraEnv() {
|
||||
return Map.of("otel.propagators", "b3");
|
||||
protected SmokeTestTarget.Builder customize(SmokeTestTarget.Builder builder) {
|
||||
return builder.env("otel.propagators", "b3");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,26 +8,16 @@ package io.opentelemetry.smoketest.propagation;
|
|||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import io.opentelemetry.smoketest.JavaSmokeTest;
|
||||
import io.opentelemetry.smoketest.TargetWaitStrategy;
|
||||
import io.opentelemetry.smoketest.SmokeTestTarget;
|
||||
import io.opentelemetry.testing.internal.armeria.common.AggregatedHttpResponse;
|
||||
import java.time.Duration;
|
||||
import java.util.Map;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.condition.DisabledIf;
|
||||
|
||||
@DisabledIf("io.opentelemetry.smoketest.TestContainerManager#useWindowsContainers")
|
||||
class OtTracePropagationTest extends JavaSmokeTest {
|
||||
@Override
|
||||
protected String getTargetImage(String jdk) {
|
||||
return "ghcr.io/open-telemetry/opentelemetry-java-instrumentation/smoke-test-spring-boot:jdk"
|
||||
+ jdk
|
||||
+ "-20211213.1570880324";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected TargetWaitStrategy getWaitStrategy() {
|
||||
return new TargetWaitStrategy.Log(
|
||||
Duration.ofMinutes(1), ".*Started SpringbootApplication in.*");
|
||||
public OtTracePropagationTest() {
|
||||
super(SmokeTestTarget.springBoot("20211213.1570880324").env("otel.propagators", "ottrace"));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -38,9 +28,4 @@ class OtTracePropagationTest extends JavaSmokeTest {
|
|||
|
||||
assertThat(response.contentUtf8()).matches("[0-9a-f]{16}" + traceId + ";[0]{16}" + traceId);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Map<String, String> getExtraEnv() {
|
||||
return Map.of("otel.propagators", "ottrace");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,24 +8,14 @@ package io.opentelemetry.smoketest.propagation;
|
|||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import io.opentelemetry.smoketest.JavaSmokeTest;
|
||||
import io.opentelemetry.smoketest.TargetWaitStrategy;
|
||||
import io.opentelemetry.smoketest.SmokeTestTarget;
|
||||
import io.opentelemetry.testing.internal.armeria.common.AggregatedHttpResponse;
|
||||
import java.time.Duration;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
public abstract class PropagationTest extends JavaSmokeTest {
|
||||
|
||||
@Override
|
||||
protected String getTargetImage(String jdk) {
|
||||
return "ghcr.io/open-telemetry/opentelemetry-java-instrumentation/smoke-test-spring-boot:jdk"
|
||||
+ jdk
|
||||
+ "-20211213.1570880324";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected TargetWaitStrategy getWaitStrategy() {
|
||||
return new TargetWaitStrategy.Log(
|
||||
Duration.ofMinutes(1), ".*Started SpringbootApplication in.*");
|
||||
public PropagationTest() {
|
||||
super(SmokeTestTarget.springBoot("20211213.1570880324"));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
|||
|
|
@ -5,13 +5,14 @@
|
|||
|
||||
package io.opentelemetry.smoketest.propagation;
|
||||
|
||||
import java.util.Map;
|
||||
import io.opentelemetry.smoketest.SmokeTestTarget;
|
||||
import org.junit.jupiter.api.condition.DisabledIf;
|
||||
|
||||
@DisabledIf("io.opentelemetry.smoketest.TestContainerManager#useWindowsContainers")
|
||||
class W3CPropagationTest extends PropagationTest {
|
||||
|
||||
@Override
|
||||
protected Map<String, String> getExtraEnv() {
|
||||
return Map.of("otel.propagators", "tracecontext");
|
||||
protected SmokeTestTarget.Builder customize(SmokeTestTarget.Builder builder) {
|
||||
return builder.env("otel.propagators", "tracecontext");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,13 +5,14 @@
|
|||
|
||||
package io.opentelemetry.smoketest.propagation;
|
||||
|
||||
import java.util.Map;
|
||||
import io.opentelemetry.smoketest.SmokeTestTarget;
|
||||
import org.junit.jupiter.api.condition.DisabledIf;
|
||||
|
||||
@DisabledIf("io.opentelemetry.smoketest.TestContainerManager#useWindowsContainers")
|
||||
class XRayPropagationTest extends PropagationTest {
|
||||
|
||||
@Override
|
||||
protected Map<String, String> getExtraEnv() {
|
||||
return Map.of("otel.propagators", "xray");
|
||||
protected SmokeTestTarget.Builder customize(SmokeTestTarget.Builder builder) {
|
||||
return builder.env("otel.propagators", "xray");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue