-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Migrate finagle-thrift/finagle-stream tests to ScalaTest #291
Conversation
Yeah, that sounds promising. We'll probably publish our first 2.11 util in the next couple weeks. |
Problem ThriftTest has testing functionality that was marked flaky but currently passes. I am unsure if these are desired tests but they pass and may be useful. Solution Given that there is a convention for including flaky tests by default - and disabling via ENV variable - I reenabled test paths that pass. For paths that do not pass I created a skipThriftTest method. Result Potentially higher test coverage in the package.
@mosesn - I completed the specs -> scalatest conversion for finagle-thrift and finagle-stream. Please let me know any feedback you may have so I can rebase the work into a set of final commits that conform to the commit standard. Lastly, I came across two issues that I would like some more input on:
|
Hey @bajohns this looks great! Unfortunately, I've been snowed in work-wise, and haven't had a chance to take a look at this yet. It's still on my plate, but it will take a little while to get to it. Sorry! 😬 |
Hey @mosesn, no rush I see there is a lot of activity around these change sets. Thanks for all your work to accept contributions! |
val protocolFactory = new TBinaryProtocol.Factory() | ||
|
||
test("async Thrift server should work"){ | ||
// ** Set up the server. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rm the ** while we're in here.
@evnm - Thanks for reviewing. All comments handling in next commit: bajohns@255983d |
Looks like the build failed only for artifact resolution. Rebuild should clear it out.
|
import org.jboss.netty.handler.codec.http._ | ||
import org.scalatest.{OneInstancePerTest, FunSuite} | ||
|
||
class EndToEndTest extends FunSuite with OneInstancePerTest { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't love the style of OneInstancePerTest, it's not particularly idiomatic scalatest. Generally we just make a context class and import its contents in each test. By sticking to one style, it's easier for us to reason about different tests, and by having tightly scoped context classes, we can have more sophisticated fixtures if we have a big test suite, for example.
with BeforeAndAfter | ||
with OneInstancePerTest | ||
{ | ||
class ClientIdContextTest extends FunSuite with BeforeAndAfter with OneInstancePerTest { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like this style, but probably not worth changing, since you don't need to change it for any other reason.
LGTM other than a couple style nits. The context class vs. OneInstancePerTest thing is up to you--I prefer having a single paradigm across finagle, and OneInstancePerTest is only used twelve times in finagle, but it does make the code cleaner, so maybe we'll want to investigate just using OneInstancePerTest across the board in the future. |
I am going to take care of the feedback this weekend. I am more than willing to convert the tests from OneInstancePerTest to the context object - this would make the changeset larger. The specs default behavior is OneInstancePerTest-like so the shortest path forward was OIPT. Unless I hear otherwise - I will do the work to migrate this from OIPT -> Context object pattern. |
@mosesn - finished reviewing your feedback. Please confirm that my changes meet your expectations. Re: ignore showing up for flaky - here is the test output https://gist.github.com/bajohns/e1a03cad4b401ae5fd83 |
This is looking pretty awesome, thanks a ton! 👍 LGTM |
Great to hear - would you like me to squash commits down to a single? That was my plan to conform to the commit message standard. |
That would be rad, it would probably help minimize conflicts too. Could you make a new PR though, so the history for this branch is still one to reason about? |
|
||
class EndToEndTest extends FunSuite { | ||
|
||
case class MyStreamResponse( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This indentation's a bit weird. Let's use:
case class MyStreamResponse(
httpResponse: HttpResponse,
messages: Offer[ChannelBuffer],
error: Offer[Throwable]
) extends StreamResponse {
LGTM. Just some dumb style nits. |
b524ea8
to
16f2a50
Compare
Took care of feedback from @evnm I will create a final pull request based on these commits. |
Squashed and rebased against current master - the complete work in one commit is here: #308 |
Any chances for this PR being merged ? |
We're in the process of doing it today! 🎩 |
In preparation for 2.11.x finagle-thrift tests will migrate to ScalaTest
Remaining Work: