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
1 change: 1 addition & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ jobs:
- name: Set up cluster with Docker Compose
run: docker compose up -d
env:
KURRENTDB_LICENSE_KEY: ${{ secrets.KURRENTDB_TEST_LICENSE_KEY }}
KURRENTDB_DOCKER_REGISTRY: ${{ needs.load_configuration.outputs.registry }}
KURRENTDB_DOCKER_IMAGE: ${{ needs.load_configuration.outputs.image }}
KURRENTDB_DOCKER_TAG: ${{ needs.load_configuration.outputs.tag }}
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ openTelemetrySemConvVersion=1.25.0-alpha

# Test Dependencies
slf4jNopVersion=1.7.29
testcontainersVersion=1.20.6
testcontainersVersion=1.21.4
jacksonVersion=2.18.3
18 changes: 10 additions & 8 deletions src/test/java/io/kurrent/dbclient/TelemetryTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.ArrayList;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.List;
import java.util.Objects;
import java.util.function.Consumer;
Expand All @@ -30,20 +30,15 @@ public class TelemetryTests implements StreamsTracingInstrumentationTests, Persi
static private Database database;
static private Logger logger;

private final List<Consumer<ReadableSpan>> spanEndedHooks = new ArrayList<>();
private final List<ReadableSpan> recordedSpans = new ArrayList<>();
private static final List<Consumer<ReadableSpan>> spanEndedHooks = new CopyOnWriteArrayList<>();
private static final List<ReadableSpan> recordedSpans = new CopyOnWriteArrayList<>();

@BeforeAll
public static void setup() {
database = DatabaseFactory.spawn();
logger = LoggerFactory.getLogger(StreamsTests.class);
}

@BeforeEach
public void beforeEach() {
GlobalOpenTelemetry.resetForTest();
spanEndedHooks.add(recordedSpans::add);

OtlpGrpcSpanExporter otlpExporter = OtlpGrpcSpanExporter.builder()
.setEndpoint("http://localhost:4317")
.build();
Expand All @@ -62,6 +57,13 @@ public void beforeEach() {
.buildAndRegisterGlobal();
}

@BeforeEach
public void beforeEach() {
spanEndedHooks.clear();
recordedSpans.clear();
spanEndedHooks.add(recordedSpans::add);
}

@Override
public void onOperationSpanEnded(String operation, Consumer<ReadableSpan> onSpanEnded) {
spanEndedHooks.add(span -> {
Expand Down
2 changes: 2 additions & 0 deletions vars.env
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ EVENTSTORE_TRUSTED_ROOT_CERTIFICATES_PATH=/etc/kurrentdb/certs/ca
EVENTSTORE_DISCOVER_VIA_DNS=false
EVENTSTORE_ENABLE_ATOM_PUB_OVER_HTTP=true
EVENTSTORE_ADVERTISE_HOST_TO_CLIENT_AS=localhost
EVENTSTORE_LICENSING__LICENSE_KEY=${KURRENTDB_LICENSE_KEY:-}
EVENTSTORE_ALLOW_UNKNOWN_OPTIONS=true
Loading