microsoft / thrifty

Thrift for Android that saves you methods
Apache License 2.0
544 stars 102 forks source link

Make TestServer instances reusable for whole suites #513

Closed benjamin-bader closed 1 year ago

benjamin-bader commented 1 year ago

Integration tests are flaking on Windows with timeouts. In an effort to reduce the possible surface area for timeouts, and to gather more information, I'm overhauling the TestServer and its integrations. Instead of spinning up a new instance for every test method, we'll use one per test class instead - the handler that it runs is stateless, so there should be no issue.

Because JUnit BeforeAll and AfterAll methods and extensions must be static, we can't rely on inheritance to pass parameters, so now those params will live in a new @ServerConfig annotation that must be present on test classes.

We'll also plug in some logging around test-server startup (and errors, if any).

codecov-commenter commented 1 year ago

Codecov Report

Merging #513 (5e8a208) into master (564909f) will decrease coverage by 0.04%. The diff coverage is 44.44%.

@@             Coverage Diff              @@
##             master     #513      +/-   ##
============================================
- Coverage     59.84%   59.80%   -0.05%     
- Complexity      880      883       +3     
============================================
  Files            70       70              
  Lines          7025     7035      +10     
  Branches       1031     1034       +3     
============================================
+ Hits           4204     4207       +3     
- Misses         2520     2524       +4     
- Partials        301      304       +3     
Impacted Files Coverage Δ
...java/com/microsoft/thrifty/testing/TestServer.java 74.71% <44.44%> (-5.81%) :arrow_down:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.