Added circle.ci integration

- also limited to 5 seconds awaits
This commit is contained in:
Marcin Grzejszczak
2016-07-11 15:14:21 +02:00
parent 81f70ff071
commit f199321878
13 changed files with 57 additions and 63 deletions

View File

@@ -41,6 +41,7 @@ import tools.AbstractIntegrationTest;
import zipkin.Constants;
import zipkin.Span;
import static java.util.concurrent.TimeUnit.SECONDS;
import static org.assertj.core.api.BDDAssertions.then;
@RunWith(SpringJUnit4ClassRunner.class)
@@ -63,9 +64,9 @@ public class MessagingApplicationTests extends AbstractIntegrationTest {
public void should_have_passed_trace_id_when_message_is_about_to_be_sent() {
long traceId = new Random().nextLong();
await().until(httpMessageWithTraceIdInHeadersIsSuccessfullySent(sampleAppUrl + "/", traceId));
await().atMost(5, SECONDS).until(httpMessageWithTraceIdInHeadersIsSuccessfullySent(sampleAppUrl + "/", traceId));
await().until(() -> {
await().atMost(5, SECONDS).until(() -> {
thenAllSpansHaveTraceIdEqualTo(traceId);
});
}
@@ -75,9 +76,9 @@ public class MessagingApplicationTests extends AbstractIntegrationTest {
long traceId = new Random().nextLong();
long spanId = new Random().nextLong();
await().until(httpMessageWithTraceIdInHeadersIsSuccessfullySent(sampleAppUrl + "/", traceId, spanId));
await().atMost(5, SECONDS).until(httpMessageWithTraceIdInHeadersIsSuccessfullySent(sampleAppUrl + "/", traceId, spanId));
await().until(() -> {
await().atMost(5, SECONDS).until(() -> {
thenAllSpansHaveTraceIdEqualTo(traceId);
thenTheSpansHaveProperParentStructure();
});
@@ -87,9 +88,9 @@ public class MessagingApplicationTests extends AbstractIntegrationTest {
public void should_have_passed_trace_id_with_annotations_in_async_thread_when_message_is_about_to_be_sent() {
long traceId = new Random().nextLong();
await().until(httpMessageWithTraceIdInHeadersIsSuccessfullySent(sampleAppUrl + "/xform", traceId));
await().atMost(5, SECONDS).until(httpMessageWithTraceIdInHeadersIsSuccessfullySent(sampleAppUrl + "/xform", traceId));
await().until(() -> {
await().atMost(5, SECONDS).until(() -> {
thenAllSpansHaveTraceIdEqualTo(traceId);
thenThereIsAtLeastOneBinaryAnnotationWithKey("background-sleep-millis");
});

View File

@@ -18,7 +18,6 @@ package integration;
import java.util.Collections;
import java.util.Random;
import example.ZipkinStreamServerApplication;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -37,8 +36,12 @@ import org.springframework.messaging.Message;
import org.springframework.messaging.MessageChannel;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import example.ZipkinStreamServerApplication;
import tools.AbstractIntegrationTest;
import static java.util.concurrent.TimeUnit.SECONDS;
@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = { TestSupportBinderAutoConfiguration.class,
ZipkinStreamServerApplication.class })
@@ -57,7 +60,7 @@ public class ZipkinStreamTests extends AbstractIntegrationTest {
@Before
public void setup() {
await().until(zipkinServerIsUp());
await().atMost(5, SECONDS).until(zipkinServerIsUp());
}
@Test
@@ -67,7 +70,7 @@ public class ZipkinStreamTests extends AbstractIntegrationTest {
this.input.send(messageWithSpan(span));
await().until(allSpansWereRegisteredInZipkinWithTraceIdEqualTo(this.traceId));
await().atMost(5, SECONDS).until(allSpansWereRegisteredInZipkinWithTraceIdEqualTo(this.traceId));
}
private Message<Spans> messageWithSpan(Span span) {

View File

@@ -40,6 +40,8 @@ import tools.AbstractIntegrationTest;
import zipkin.junit.ZipkinRule;
import zipkin.server.EnableZipkinServer;
import static java.util.concurrent.TimeUnit.SECONDS;
@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = { WaitUntilZipkinIsUpConfig.class,
SampleZipkinApplication.class })
@@ -67,10 +69,10 @@ public class ZipkinTests extends AbstractIntegrationTest {
public void should_propagate_spans_to_zipkin() {
long traceId = new Random().nextLong();
await().until(httpMessageWithTraceIdInHeadersIsSuccessfullySent(
await().atMost(5, SECONDS).until(httpMessageWithTraceIdInHeadersIsSuccessfullySent(
this.sampleAppUrl + "/hi2", traceId));
await().until(allSpansWereRegisteredInZipkinWithTraceIdEqualTo(traceId));
await().atMost(5, SECONDS).until(allSpansWereRegisteredInZipkinWithTraceIdEqualTo(traceId));
}
@Override