Skip to content
This repository has been archived by the owner on Dec 23, 2023. It is now read-only.

Testing: Add a fake implementation of TraceService. #1481

Merged

Conversation

songy23
Copy link
Contributor

@songy23 songy23 commented Oct 5, 2018

This fake server will be used to test against the clients in #1476.

Equivalent to https://github.com/census-ecosystem/opencensus-go-exporter-ocagent/blob/master/mock_agent_test.go.

@codecov-io
Copy link

codecov-io commented Oct 5, 2018

Codecov Report

Merging #1481 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #1481   +/-   ##
=========================================
  Coverage     82.45%   82.45%           
  Complexity     1590     1590           
=========================================
  Files           243      243           
  Lines          7493     7493           
  Branches        702      702           
=========================================
  Hits           6178     6178           
  Misses         1099     1099           
  Partials        216      216

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 08d09c4...1ddc796. Read the comment docs.

Copy link
Contributor

@bogdandrutu bogdandrutu left a comment

Choose a reason for hiding this comment

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

Couple of things:

  1. I see no intention to publish this to the users.
  2. Why do we not have the Fake implementation in the test dir?

@songy23
Copy link
Contributor Author

songy23 commented Oct 8, 2018

@bogdandrutu I considered putting this fake server under io.opencensus.testing initially. A few concerns about doing so:

  1. This will add io.grpc and io.opencensus.proto dependencies to io.opencensus.testing.
  2. We have to make the fake server implementation public, while I don't think it will be useful outside the ocagent exporter package.

That being said, I agree that there's no need to include the fake server in the ocagent-exporter artifact. I've moved it to io.opencensus.testing.

@songy23 songy23 changed the title Exporter/OcAgent: Add a fake impl of TraceService. Testing: Add a fake implementation of TraceService. Oct 8, 2018
@bogdandrutu
Copy link
Contributor

@songy23 my suggestion was to have it in the src/test/java instead of src/main/java. What do you think?

@songy23
Copy link
Contributor Author

songy23 commented Oct 9, 2018

my suggestion was to have it in the src/test/java instead of src/main/java. What do you think?

SGTM, updated. (though it's a bit strange to have tests for a class under test directory.)

Copy link
Contributor

@bogdandrutu bogdandrutu left a comment

Choose a reason for hiding this comment

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

I agree with the fact that tests for test classes is strange; we can move it to the main later but I don't think this should be present in the artifact that gets exported to maven central for example even if this is package protected.

@songy23
Copy link
Contributor Author

songy23 commented Oct 9, 2018

we can move it to the main later but I don't think this should be present in the artifact that gets exported to maven central for example even if this is package protected.

Make sense to me.

@songy23 songy23 merged commit dea86ae into census-instrumentation:master Oct 9, 2018
@songy23 songy23 deleted the fake-agent-server-impl branch October 9, 2018 02:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants