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

root: Upgrade test library versions in preparation for 2.13 support #527

Closed
wants to merge 1 commit into from

Conversation

chrisbenincasa
Copy link
Contributor

Problem

Several libraries used for testing were using older versions that were
not cross-compiled for Scala 2.13.

Solution

Upgrade the relevant libraries to latest versions supporting Scala 2.13
and add new libraries necessary due to deprecations in the existing
libraries.

Result

Base testing libraries are now compatiable with a Scala 2.13 cross
builder. Building for Scala 2.12 and 2.11 still works as expected.

@CLAassistant
Copy link

CLAassistant commented Apr 2, 2020

CLA assistant check
All committers have signed the CLA.

@chrisbenincasa
Copy link
Contributor Author

JVM 11 failure in the build seems like twitter/finagle#832

@yufangong yufangong self-requested a review April 9, 2020 02:55
@@ -1,6 +1,6 @@
package com.twitter.inject

import org.mockito.Matchers
import org.mockito.ArgumentMatchers
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you also upgrade the mockito version? Matchers are not deprecated in the version we depend on currently.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated to the latest, 3.3.3.

@@ -2,7 +2,7 @@ package com.twitter.inject

import org.junit.runner.RunWith
import org.scalatest.FunSuite
import org.scalatest.junit.JUnitRunner
import org.scalatestplus.junit.JUnitRunner
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can instead just remove the RunWith and JunitRunner.
Here's a similar approach: twitter/util@ad9ccd0#diff-114c8b055e627e0231beb718ccbd9255. It looks like finatra test all extend this Test, so maybe only this one place.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

Copy link
Contributor

@yufangong yufangong left a comment

Choose a reason for hiding this comment

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

I did some test internally and surprised how challenging it could be to upgrade test deps versions. My theory is Finatra provides all these test suites to applications and exports the test deps versions, it could be breaking changes for all the applications. cc @cacoco can you confirm?

Since this is blocking @chrisbenincasa your other PRs, what do you think only updating the ones blocking 213 for now and file an issue for the rest so we can tackle those along the way?

val scalaTest = "3.0.8"
val scalaTest = "3.1.1"
val scalaTestPlusJunit = "1.0.0-M2"
val scalaTestPlusScalacheck = "3.1.0.0-RC2"
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we still need these?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the junit one is not necessary anymore, since we removed the RunWith annotation. the scalacheck one is still necessary due to a change between scalatest 3.0 and 3.1 that moved 3rd party integrations to separate packages.

@@ -137,6 +139,8 @@ lazy val baseSettings = Seq(
"org.mockito" % "mockito-core" % versions.mockito % Test,
"org.scalacheck" %% "scalacheck" % versions.scalaCheck % Test,
"org.scalatest" %% "scalatest" % versions.scalaTest % Test,
"org.scalatestplus" %% "scalatestplus-junit" % versions.scalaTestPlusJunit % Test,
"org.scalatestplus" %% "scalacheck-1-14" % versions.scalaTestPlusScalacheck % Test,
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

Copy link
Contributor Author

Choose a reason for hiding this comment

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

explained in the comment above - removed the junit one.

@cacoco
Copy link
Contributor

cacoco commented Apr 12, 2020

I did some test internally and surprised how challenging it could be to upgrade test deps versions. My theory is Finatra provides all these test suites to applications and exports the test deps versions, it could be breaking changes for all the applications. cc @cacoco can you confirm?

Since this is blocking @chrisbenincasa your other PRs, what do you think only updating the ones blocking 213 for now and file an issue for the rest so we can tackle those along the way?

@yufangong all of our versions should track what is in the monorepo 3rdparty, trying to diverge will likely not be possible. We should confirm these versions are in sync.

Problem

Several libraries used for testing were using older versions that were
not cross-compiled for Scala 2.13.

Solution

Upgrade the relevant libraries to latest versions supporting Scala 2.13
and add new libraries necessary due to deprecations in the existing
libraries.

Result

Base testing libraries are now compatiable with a Scala 2.13 cross
builder. Building for Scala 2.12 and 2.11 still works as expected.
@chrisbenincasa
Copy link
Contributor Author

Reverted the Mockito change based on @yufangong's comment since it's not strictly blocking for Scala 2.13.

@yufangong
Copy link
Contributor

Hi @chrisbenincasa, I apologize for the delay. After some investigation, our assumption is spec2 (mockito) upgrades are a bit challenging at this time, as our internal monorepo is still on an earlier version, Finatra changes will break internal usages. We are currently working on that, I will keep you posted when we can get unblocked. Sorry!

@mosesn mosesn mentioned this pull request Apr 24, 2020
9 tasks
@chrisbenincasa
Copy link
Contributor Author

Hey @yufangong, any updates?

@yufangong
Copy link
Contributor

Hi, @chrisbenincasa, we now have some folks are actively working on upgrading spec2/scalatest/mockito internally to unblock us here, I don't have an estimation (or, two or three weeks) but feel optimized it should be sorted out soon.

@mosesn
Copy link
Contributor

mosesn commented Jul 17, 2020

@chrisbenincasa some news! we were finally able to conduct the scalatest update. we're going to start looking at specs next. sorry again for the delay.

@cacoco
Copy link
Contributor

cacoco commented Jul 17, 2020

We're going to be removing the specs2 dependency soon and will replicate the behavior with mockito-scala. This should be (hopefully) completed in the next few weeks in time for our August release (will likely not make the July release).

@chrisbenincasa
Copy link
Contributor Author

Good news! Thanks for the update.

@yufangong
Copy link
Contributor

@chrisbenincasa good news, I believe we are unblocked! @mosesn and @cacoco made this happen.
The test dependencies are covered at fbb7b53, so we can probably close this PR. And when you get a chance, do you mind rebasing other PRs on the newest code?

@chrisbenincasa
Copy link
Contributor Author

@yufangong that's great! I've rebased all of the other PRs off of this one and straight onto develop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

5 participants