Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase coverage for IT tests #19

Merged
merged 4 commits into from
Feb 14, 2019
Merged

Conversation

zhenik
Copy link
Contributor

@zhenik zhenik commented Feb 12, 2019

  1. Separate reports for IT and unit tests
  2. Added more tests

ps. I would like to receive feedback @jeqo, are there any priority for feature to test first ?

@@ -27,11 +21,17 @@
import org.junit.Rule;
import org.junit.Test;
import org.testcontainers.containers.KafkaContainer;
import zipkin2.Endpoint;
import zipkin2.Span;
import zipkin2.*;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sure you apply https://github.com/square/java-code-styles to avoid auto-generated import all.

import java.io.IOException;
import java.time.Duration;
import java.time.Instant;
import java.util.*;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

public void shouldFindTracesByAnnotation() throws IOException, InterruptedException {

// todo: it is not explicit that annotations applied for tags
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be related to: openzipkin/zipkin#2236

// query by annotation {"key_tag_a":"value_tag_a"} = 1 trace
await()
.pollDelay(5, TimeUnit.SECONDS)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't the .atMost(5, TimeUnit.SECONDS) a better match for this case?

We are waiting for the store to pick up the change on the output topic, after we have validated that messages are published on the topic L210.
If we are validating that message is already published, then any moment, from that point, the storage could be updated.

Using atMost we are telling to check condition during 5 secs, and if not match, then fail.
With pollDelay we are waiting 5secs and then validating the condition.

It seems that the first one covers better the eventual consistency on this operation.

WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree.

// query by annotation {"key_tag_non_exist_a":"value_tag_non_exist_a"} = 1 trace
await()
.pollDelay(5, TimeUnit.SECONDS)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some cases, where it should not found traces (f.ex. with non_existing_service_name), in that case exactly need delayPoll.
I will update comment

// query by span name `op_a` = 1 trace
await()
.atMost(5, TimeUnit.SECONDS)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here.

// query by span name `op_b` = 1 trace
await()
.atMost(5, TimeUnit.SECONDS)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

@Test
public void topicDefault() {
try{
KafkaStorage.Topic.Builder topicBuilder = KafkaStorage.Topic.builder(null);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: remove unused topicBuilder variable.

@jeqo jeqo merged commit 7424761 into openzipkin-contrib:master Feb 14, 2019
@jeqo
Copy link
Collaborator

jeqo commented Feb 14, 2019

LGTM thanks @NikitaZhevnitskiy !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants