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

Stackdriver integration tests #140

Merged

Conversation

saturnism
Copy link
Collaborator

@saturnism saturnism commented Aug 26, 2019

#130

  • Renamed existing ITStackdriverSendertest to AsyncReporterStackdriverSenderTest.java
  • Updated ITStackdriverSender to test against a service account
  • Configure the service account path via GOOGLE_APPLICATION_CREDENTIALS env var

@saturnism
Copy link
Collaborator Author

saturnism commented Aug 26, 2019

eak, travis encrypt-file reformatted .travis.yml. Let me know if you'd like to format it back.

also, i'm unsure whether the encrypted file will decrypt post merge.

@saturnism
Copy link
Collaborator Author

saturnism commented Aug 26, 2019

ok, it seems like i may have to add the encrypted key via zipkin-gcp repo.

@adriancole let me know if you are OK w/ me adding the encrypted key directly on master,
and whether reformatted .travis.yml is ok

@saturnism saturnism requested a review from elefeint August 26, 2019 21:21
@codefromthecrypt
Copy link
Member

I have a change in brave I've neglected for a long time so look at this closer after that. thanks for the help!

Copy link
Contributor

@elefeint elefeint left a comment

Choose a reason for hiding this comment

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

Looks good from my end; a couple of optional comments [on comments, as it happens].

sender-stackdriver/pom.xml Show resolved Hide resolved
sender-stackdriver/pom.xml Outdated Show resolved Hide resolved
public void setUp() {
server.getServiceRegistry().addService(traceService);
public void setUp() throws IOException {
// Application Default credential is configured using the GOOGLE_APPLICATION_CREDENTIALS env var
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe or gcloud SDK when run locally.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

in the context of this test, i think the env var is better way, the other ways should be documented in the linked page (but also, not recommended).

Copy link
Member

Choose a reason for hiding this comment

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

I'd prefer to see an assumeThat here which will ignore the test vs break the build, when remote stuff is not around. That way you can craft a better error. PS I think the build is broke not sure intended or not.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

TIL :D updated to use assumeThatCode since GoogleCredentials.getApplicationDefault throws an exception that we need to catch.

.travis.yml Outdated Show resolved Hide resolved
Copy link
Member

@codefromthecrypt codefromthecrypt left a comment

Choose a reason for hiding this comment

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

looks good. one note besides looking into why this doesn't run in travis. If it is a permissions concern, odd, but let me know. maybe it is one of those things where you need to merge first. At any rate, let's use assume.. in order to keep it green.

public void setUp() {
server.getServiceRegistry().addService(traceService);
public void setUp() throws IOException {
// Application Default credential is configured using the GOOGLE_APPLICATION_CREDENTIALS env var
Copy link
Member

Choose a reason for hiding this comment

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

I'd prefer to see an assumeThat here which will ignore the test vs break the build, when remote stuff is not around. That way you can craft a better error. PS I think the build is broke not sure intended or not.

@codefromthecrypt
Copy link
Member

something still seems busted..

@saturnism
Copy link
Collaborator Author

it looks like the assumption was determined not met

org.junit.AssumptionViolatedException: assumption was not met due to: 
Expecting code not to raise a throwable but caught

but it's still a failure rather than a skip.

@codefromthecrypt
Copy link
Member

if me, I'd check the state it needs instead as the error message isn't 100% clear anyway. there's a slight drift risk, but then if there was, we'd have to reconfig the job

@saturnism
Copy link
Collaborator Author

even if i tried a simple assumeThat(System.getenv("GOOGLE_APPLICATION_CREDENTIALS")).isNotBlank();, in intelliJ it shows yellow X, but is marked as a test failure, and in maven, it's marked as failure rather than skip.

@saturnism
Copy link
Collaborator Author

ok i think i found the issue...

…ailing tests.

during tear down, only close reporter if reporter is not null, otherwise, tearDown() will cause test failures.
@codefromthecrypt
Copy link
Member

looks like you did. good detective work again @saturnism. Thanks for all the work.

Thanks for the review @elefeint and @anuraaga!

@codefromthecrypt codefromthecrypt merged commit 791fd0b into openzipkin:master Aug 30, 2019
@saturnism saturnism deleted the stackdriver-integration-tests branch August 30, 2019 18:42
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.

4 participants