Skip to content

Report eviction errors for Test dependencies #8410

@zainab-ali

Description

@zainab-ali

Eviction warnings and errors are currently not reported for test dependencies.

Example

If I have the following two (non-test) dependencies:

scalaVersion := "3.3.7"

libraryDependencies ++= Seq(
  "org.typelevel" %% "weaver-cats"       % "0.11.1",
  "com.siriusxm" %% "snapshot4s-weaver"       % "0.2.2",
)

And run update, I get the expected error:

[error] (update) found version conflict(s) in library dependencies; some are suspected to be binary incompatible:
[error]
[error]         * org.typelevel:weaver-cats_3:0.11.1 (early-semver) is selected over 0.10.1
[error]             +- default:sbt-test-project_3:0.1.0-SNAPSHOT          (depends on 0.11.1)
[error]             +- com.siriusxm:snapshot4s-weaver_3:0.2.2             (depends on 0.10.1)

But if I change them to Test dependencies, update is successful:

libraryDependencies ++= Seq(
  "org.typelevel" %% "weaver-cats"       % "0.11.1" % Test,
  "com.siriusxm" %% "snapshot4s-weaver"       % "0.2.2" % Test,
)

Feature

update could fail when Test dependencies have evictions.

The eviction check is currently only set for the Compile configuration. We can run the same check for Test if we tweak the error message to include the configuration name.

I'd be happy to contribute this feature, if given a few pointers on where to make the change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions