-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Decouple published modules from scalatest #2970
Decouple published modules from scalatest #2970
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2970 +/- ##
==========================================
+ Coverage 93.93% 93.98% +0.04%
==========================================
Files 371 369 -2
Lines 7061 7052 -9
Branches 177 178 +1
==========================================
- Hits 6633 6628 -5
+ Misses 428 424 -4 Continue to review full report at Codecov.
|
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.
Nice! Thanks!
|
||
For most of the type classes included in Cats, the above will work great. | ||
However, the law tests for the type classes inside `cats.kernel` are located in `cats.kernel.laws.discipline.*` instead. | ||
So we have to import from there to test type classes like `Semigroup`, `Monoid`, `Group` or `Semilattice`. | ||
|
||
Let's test it out, by defining a `Semigroup` instance for our `Tree` type. | ||
Let's test it out by defining a `Semigroup` instance for our `Tree` type. |
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.
Random grammar fixes in the middle of an otherwise pure refactoring will never cease to bemuse and satisfy me.
I have no strong attachment to Now that I'm typing this out I'm realizing that I should probably just finally make the effort to convert some of my Scalatest tests to use a more lightweight testing library. But lots of people are still going to use Scalatest, and it's not easy for big code bases to transition all at once. |
I wouldn't object to that being a microlibrary in a separate repo -- and we even could bring back a |
Ah sorry about that I didn't take the time to fully understand the context. I agree that it doesn't belong in this repo. And it is a small enough amount of code that I would probably copy and paste it as opposed to getting a new repo and build set up 😵 |
👍 for creating a Cats-testkit-scalatest repo. Copy pasting code from two files + finding out what extra dependencies are needed is a bit too much for someone trying to figure out how to law testing instances for cats type classes. |
This isolates our ScalaTest dependency to tests and docs so we can publish cats-2.0.0 before scalatest-3.1.0 is released.
CatsSuite
andCatsEquality
, which depend on ScalaTest, are moved from cats-testkit to cats-tests' tests. This means we can continue to use them internally, but they are no longer available to external projects.The docs depend on discipline-scalatest for a full example. These examples assume a ScalaTest 3.1.0, which we hope will follow quickly after cats-2.0.0 is published. We can update the docs if there is a breaking change before scalatest-3.1.0.
If there is external demand for
CatsSuite
, we could consider a separatecats-scalatest
repo with its own release cycle.cats-testkit is no longer directly mentioned in the docs, calling into question its value as a module. That debate is for another PR, but is worth considering before we commit to cats-2.0.0.