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

Adds additional server definitions tests #23

Merged
merged 2 commits into from
Jul 6, 2017

Conversation

juanpedromoreno
Copy link
Member

This PR completes #15

Now, rpc server module reaches almost the 100% of test coverage. In the next PRs I'll cover the client definition tests.

Please, @fedefernandez could you take a look? Thanks!

@juanpedromoreno juanpedromoreno force-pushed the jp-server-defs-tests-part-2 branch from b3ebcda to 55bb9d2 Compare July 5, 2017 21:40
@juanpedromoreno juanpedromoreno force-pushed the jp-server-defs-tests-part-2 branch from 55bb9d2 to 77198b3 Compare July 5, 2017 21:54
@codecov-io
Copy link

codecov-io commented Jul 5, 2017

Codecov Report

Merging #23 into master will increase coverage by 14.15%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master      #23       +/-   ##
===========================================
+ Coverage   34.78%   48.93%   +14.15%     
===========================================
  Files           7        8        +1     
  Lines          46       47        +1     
===========================================
+ Hits           16       23        +7     
+ Misses         30       24        -6
Impacted Files Coverage Δ
rpc/src/main/scala/server/package.scala 100% <100%> (+100%) ⬆️
rpc/src/main/scala/server/GrpcConfig.scala 100% <100%> (ø)
rpc/src/main/scala/server/implicits.scala 100% <0%> (+50%) ⬆️

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 07e91af...2e528e6. Read the comment docs.

Copy link
Contributor

@fedefernandez fedefernandez left a comment

Choose a reason for hiding this comment

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

Great work, just left some comments. Maybe we could add an interpreter ServerConfig.Op ~> Id for the tests.

"work as expected" in {

val configList: List[GrpcConfig] = List(AddService(sd1))
val server: Server = SServerBuilder(port).withGrpcConfigList(configList).buildServer
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not just:

SServerBuilder(port, configList)

Copy link
Member Author

Choose a reason for hiding this comment

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

Because this test is covering withGrpcConfigList branch ;)

Copy link
Contributor

Choose a reason for hiding this comment

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

👍


val serverF = BuildServerFromConfig[ServerConfig.Op]("rpc.server.port").interpret[Future]

serverF map (_.getPort shouldBe port)
Copy link
Contributor

Choose a reason for hiding this comment

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

Because this is a Future, this test is not verifying the value. I've tried different values for port and it succeeds for all of them


"load the default port when the config port path is not found" in {

val serverF = BuildServerFromConfig[ServerConfig.Op]("rpc.wrong.path").interpret[Future]
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above

@juanpedromoreno juanpedromoreno force-pushed the jp-server-defs-tests-part-2 branch from 193d7bf to 43ab1ec Compare July 6, 2017 08:58
@juanpedromoreno juanpedromoreno force-pushed the jp-server-defs-tests-part-2 branch from 43ab1ec to 2e528e6 Compare July 6, 2017 09:13
Copy link
Contributor

@fedefernandez fedefernandez left a comment

Choose a reason for hiding this comment

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

giphy

@juanpedromoreno juanpedromoreno merged commit 5762208 into master Jul 6, 2017
@juanpedromoreno juanpedromoreno deleted the jp-server-defs-tests-part-2 branch July 6, 2017 10:03
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.

3 participants