Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions .github/agents/knowledge/testing-general-patterns.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@
`hasAttributesSatisfyingExactly(...)` in the same assertion chain, because the exact
variant already validates the total attribute count. Remove the `hasTotalAttributeCount`
call.
- These rules apply to **span** attribute assertions only. Metric point assertions are
different: metric point assertions do not have a `hasTotalAttributeCount(...)` method, so
the span guidance about preferring `hasTotalAttributeCount(0)` for zero-attribute checks
does not apply. For metric points, used `point.hasAttributes(Attributes.empty())` — it
reads more clearly than the no-arg `hasAttributesSatisfyingExactly()` form.
- For non-semconv attribute keys in `equalTo(...)`, use inline `AttributeKey` factory
methods — `longKey("name")`, `stringKey("name")`, etc. — directly in the assertion.
Do **not** extract them into class-level `private static final AttributeKey<T>` constants.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
class LogbackWithBaggageTest extends AbstractLogbackTest {

@RegisterExtension
static InstrumentationExtension testing = LibraryInstrumentationExtension.create();
static final InstrumentationExtension testing = LibraryInstrumentationExtension.create();

@Override
protected InstrumentationExtension getInstrumentationExtension() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
class LogbackWithLoggingKeysTest extends AbstractLogbackTest {

@RegisterExtension
static InstrumentationExtension testing = LibraryInstrumentationExtension.create();
static final InstrumentationExtension testing = LibraryInstrumentationExtension.create();

@Override
protected InstrumentationExtension getInstrumentationExtension() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import javax.annotation.Nullable;

public class OpenTelemetryAppender extends UnsynchronizedAppenderBase<ILoggingEvent>
implements AppenderAttachable<ILoggingEvent> {
private static final Field MDC_MAP_FIELD;
@Nullable private static final Field MDC_MAP_FIELD;

static {
Field field;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
class LogbackTest extends AbstractLogbackTest {

@RegisterExtension
static InstrumentationExtension testing = LibraryInstrumentationExtension.create();
static final InstrumentationExtension testing = LibraryInstrumentationExtension.create();

@Override
protected InstrumentationExtension getInstrumentationExtension() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@
import static java.util.concurrent.TimeUnit.SECONDS;
import static java.util.logging.Level.WARNING;

import io.opentelemetry.instrumentation.micrometer.v1_5.OpenTelemetryMeterRegistry;
import java.util.Locale;
import java.util.concurrent.TimeUnit;
import java.util.logging.Logger;
import javax.annotation.Nullable;

final class TimeUnitParser {

private static final Logger logger = Logger.getLogger(OpenTelemetryMeterRegistry.class.getName());
private static final Logger logger = Logger.getLogger(TimeUnitParser.class.getName());

static TimeUnit parseConfigValue(@Nullable String value) {
if (value == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ dependencies {
testLibrary("org.mongodb:mongodb-driver-reactivestreams:4.0.0")

testImplementation(project(":instrumentation:mongo:mongo-common:testing"))
testImplementation("de.flapdoodle.embed:de.flapdoodle.embed.mongo:1.50.5")

testInstrumentation(project(":instrumentation:mongo:mongo-async-3.3:javaagent"))
testInstrumentation(project(":instrumentation:mongo:mongo-3.1:javaagent"))
Expand Down
Loading