-
Notifications
You must be signed in to change notification settings - Fork 25.7k
Simplify test artifact compile classpath #78238
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
Simplify test artifact compile classpath #78238
Conversation
- This fixes having transitive compile only dependencies on the classpath for consumers of test artifacts
f99fe3b to
ff977d0
Compare
|
Pinging @elastic/es-delivery (Team:Delivery) |
mark-vieira
left a comment
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.
Does this mean we now don't get any transitive dependencies from test artifacts?
|
@mark-vieira basically all elasticsearch transitive modules and their api dependencies end up on the classpath now instead of the whole compile classpath that has leaked compileOnly and implementation configurations too. |
mark-vieira
left a comment
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.
LGTM, although I think we might want to make some test dependencies api intead of implementation to reduce the need for consumers to have to declare those transitive dependencies that are obviously needed at compile time.
| dependencies { | ||
| testImplementation project(xpackModule('core')) | ||
| testImplementation(testArtifact(project(xpackModule('core')))) | ||
| testImplementation project(':test:framework') |
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'm wondering if instances like this should really be testApi since the intent is that folks that consume this test artifact will also obviously need the test framework to compile against this.
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.
yeah this makes kind of sense. I'd like to revisit the api of our testFixtures in a separate commit.
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.
FWIW, @dakrone already hit this issue, where he pulled in this change and then had too add a bunch of transitive dependencies to get things working again.
|
This fixes having transitive compile only dependencies on the classpath for consumers of test artifacts |
- This fixes having transitive compile only dependencies on the classpath for consumers of test artifacts - We remove compile dependencies from the testArtifact configuration dependencies here as this leaks implementation and compile only deps to consuming projects
- This fixes having transitive compile only dependencies on the classpath for consumers of test artifacts - We remove compile dependencies from the testArtifact configuration dependencies here as this leaks implementation and compile only deps to consuming projects

Uh oh!
There was an error while loading. Please reload this page.