-
Notifications
You must be signed in to change notification settings - Fork 8
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
Fix CI pipeline #13
Fix CI pipeline #13
Conversation
@@ -60,7 +59,6 @@ object EffectSuite { | |||
|
|||
} | |||
|
|||
@RunWith(classOf[weaver.junit.WeaverRunner]) |
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.
Mmm this annotation has a pretty significant importance (despite the fact that there's no test associated to it): it's what allows IntelliJ to run test suites by clicking on them.
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 thought it was important, but wanted to get to a green build before fixing it.
Our doc generation fails in Scala 3:
sbt:cats-core> doc
[error] -- Error: modules/core/shared/src/main/scala/weaver/suites.scala:63:0 ----------
[error] 63 |@RunWith(classOf[weaver.junit.WeaverRunner])
[error] |^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[error] |undefined: new org.junit.runner.RunWith # -1: TermRef(TypeRef(TermRef(ThisType(TypeRef(NoPrefix,module class junit)),object runner),RunWith),<init>) at readTasty
[error] one error found
I haven't dug deep into it yet, but it seems like a bug in dottydoc or the tasty reader. Possibly, it can't read the the tasty generated by suites.scala
.
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.
It's probably because the dependency is tagged as Optional in this module.
We could make the dependency required in the scope of the task that requires it maybe ? Not gonna lie, my SBT skills are not good enough to know how to do that from the top of my head
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.
That seems to be the problem.
junit
is anOptional
dependency ofcore
.coreJVM / doc
has the junit jar on the classpath.coreCats
depends oncore
. HowevercoreCatsJVM / doc
doesn't have the junit jar.
The classpath rules are the same for Scala 2.13 and 3, but dottydoc uses the tasty reader, which seems to need all jars to be present.
We can resolve this by adding the junit
dependency with a ScalaDocTool
configuration.
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.
that's great, thank you !
@@ -40,6 +40,6 @@ object Test { | |||
|
|||
def apply[F[_]](name: String, f: F[Expectations])( | |||
implicit F: EffectCompat[F] | |||
): F[TestOutcome] = apply(name, (_: Log[F]) => f) | |||
): F[TestOutcome] = apply[F](name, (_: Log[F]) => f) |
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.
We get the following error in 2.12, resolved by adding these type parameters:
[warn] compiler bug: Unexpected code path: testing two type variables for subtype relation:
[warn] ?F <:< ?F
[warn] Please report bug at https://github.com/scala/bug/issues
}.collect { case (taskDef, Some(suite)) => (taskDef, suite) } | ||
val tasksAndSuites = (taskDefs.toList.mapFilter { taskDef => | ||
suiteLoader(taskDef).map(loader => (taskDef, loader)) | ||
}) |
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.
The previous code flags up an unreachable case warning in Scala 3, although I'm not sure why:
[warn] 63 | }.collect { case (taskDef, Some(suite)) => (taskDef, suite) }
[warn] | ^^^^^^^^^^^^^^^^^^^^^^
[warn] | Unreachable case
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.
Til about mapFilter !
suites: Seq[Fingerprinted], | ||
logger: Logger): Resource[F, (WeaverRunner[F], Array[sbt.testing.Task])] = { | ||
suites: Seq[Fingerprinted] | ||
): Resource[F, (WeaverRunner[F], Array[sbt.testing.Task])] = { |
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 logger
looked safe enough to remove.
@@ -76,7 +76,7 @@ abstract class WeaverFingerprints[F[_]](implicit F: Sync[F]) { | |||
/** | |||
* A fingerprint that searches only for classes extending | |||
* [[weaver.EffectSuite]]. that have a constructor that takes a single | |||
* [[weaver.GlobalResources.Read]] parameter. | |||
* `weaver.GlobalResources.Read` parameter. |
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.
scaladoc can't find this symbol:
[warn] 81 | object ResourceSharingSuiteFingerprint extends WeaverFingerprint {
[warn] | ^
[warn] | No DRI found for query: weaver.GlobalResources.Read
Should this be weaver.GlobalRead
?
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 think so, indeed
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.
As far as I'm concerned, this is the last outstanding item for this PR to be merged 🎉
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.
GlobalRead
came from the cats module, so I went for weaver.GlobalResourceF.Read
instead.
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.
hah, good call, always mix them for one another
@@ -60,7 +59,6 @@ object EffectSuite { | |||
|
|||
} | |||
|
|||
@RunWith(classOf[weaver.junit.WeaverRunner]) |
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 thought it was important, but wanted to get to a green build before fixing it.
Our doc generation fails in Scala 3:
sbt:cats-core> doc
[error] -- Error: modules/core/shared/src/main/scala/weaver/suites.scala:63:0 ----------
[error] 63 |@RunWith(classOf[weaver.junit.WeaverRunner])
[error] |^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[error] |undefined: new org.junit.runner.RunWith # -1: TermRef(TypeRef(TermRef(ThisType(TypeRef(NoPrefix,module class junit)),object runner),RunWith),<init>) at readTasty
[error] one error found
I haven't dug deep into it yet, but it seems like a bug in dottydoc or the tasty reader. Possibly, it can't read the the tasty generated by suites.scala
.
@@ -132,7 +132,7 @@ object MetaJVM { | |||
} | |||
} | |||
|
|||
abstract class LazyAccessSequential(global: GlobalRead, index: Int) | |||
abstract class LazyAccessSequential(global: GlobalRead) |
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 index
stopped being used as of this commit to improve the sequential access tests. We can safely get rid of it.
We're all green! I'm happy with merging. |
This
almostfixes the CI pipeline.scalac-compat-annotation
and a load ofunused
annotations.junit
as a scaladoc dependency forcoreCats
.I'm hesitant to eagerly remove unused parameters as I don't have the context as to why they're there. If you'd like any removed, drop a comment next to them.
The only outstanding issue is doc generation and theRunWith
annotation. This is likely a scaladoc / tasty bug and needs a bit more investigation.