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

scalafix-testkit users cannot use scalatest >= 3.2.0 #1172

Closed
bjaglin opened this issue Jun 19, 2020 · 3 comments · Fixed by #1176
Closed

scalafix-testkit users cannot use scalatest >= 3.2.0 #1172

bjaglin opened this issue Jun 19, 2020 · 3 comments · Fixed by #1176
Assignees

Comments

@bjaglin
Copy link
Collaborator

bjaglin commented Jun 19, 2020

See #1083

Experienced in scalacenter/sbt-scalafix#131: scalatest 3.1.x users could still use scalafix-testkit as long as they didn't treat deprecations as warnings, but scalatest 3.2.x cannot as deprecated classes have been removed.

@bjaglin
Copy link
Collaborator Author

bjaglin commented Jun 19, 2020

Maybe we could publish several scalafix-testkit versions, one for each breaking change of scalatest?

@bjaglin bjaglin changed the title scalafix-testkit users cannot use scalatest >= 3.1.0 scalafix-testkit users cannot use scalatest >= 3.2.0 Jun 19, 2020
@olafurpg
Copy link
Contributor

Is there a stable ScalaTest API that we could use that's consistent between 3.0 and 3.1? Scalafix testkit doesn't need much from ScalaTest, just the ability to submit a test with a name and body.

I have considered replacing the ScalaTest dependency in favor of MUnit/JUnit for Scalafix 1.x. The binary breaking changes in ScalaTest 3.1.x make it hard to support a library API such as scalafix-testkit.

At Twitter, we have many custom Scalafix rules that are tested with scalafix-testkit and we're still on ScalaTest 3.0.x and I don't know when we will invest in doing the 3.1.x upgrade. It might happen soon, it might happen next year.

Cross-building testkit against two ScalaTest versions is the path of resistance. We could publish the 3.2.x artifacts with an additional _scalatest3.2 suffix and keep the current 3.0.x artifact unchanged (no suffix).

@bjaglin
Copy link
Collaborator Author

bjaglin commented Jun 19, 2020

Is there a stable ScalaTest API that we could use that's consistent between 3.0 and 3.1?

Good point, I'll have a look.

I don't know when we will invest in doing the 3.1.x upgrade

Out of curiosity, why isnt' https://github.com/scalatest/autofix/tree/master/3.1.x enough for a smooth migration? Other libraries built against scalatest like scalafix maybe?

We could publish the 3.2.x artifacts with an additional _scalatest3.2 suffix and keep the current 3.0.x artifact unchanged (no suffix).

That's what I had in mind, but I agree that should be the last resort.

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 a pull request may close this issue.

2 participants