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

Replace TestSourcesPlugin with Gradle test fixture support #23550

Closed
sbrannen opened this issue Aug 30, 2019 · 2 comments
Closed

Replace TestSourcesPlugin with Gradle test fixture support #23550

sbrannen opened this issue Aug 30, 2019 · 2 comments
Assignees
Labels
type: task A general task
Milestone

Comments

@sbrannen
Copy link
Member

sbrannen commented Aug 30, 2019

Overview

We should consider replacing our custom TestSourcesPlugin with Gradle's official support for Test Fixtures.

Rationale

  • Currently all test code is visible in all other (downstream) projects, and that makes it too easy to introduce unnecessary coupling.
    • For example, this made it more difficult to migrate to JUnit Jupiter.
  • Having test fixture code in a dedicated source folder makes it readily apparent that the code is reused across the test suite.
  • It will be much cleaner if projects explicitly declare that they rely on specific test fixtures of upstream projects.

Related Issues

@sbrannen sbrannen added the type: task A general task label Aug 30, 2019
@sbrannen sbrannen mentioned this issue Aug 30, 2019
13 tasks
@sbrannen sbrannen added this to the 5.2 GA milestone Aug 30, 2019
@marcphilipp
Copy link
Contributor

It will also make builds faster because test classes in downstream projects won't have to be recompiled and tests won't have to be executed if only a test class changes in an upstream project.

@sbrannen sbrannen modified the milestones: 5.2 GA, 5.2.1 Sep 23, 2019
@sbrannen sbrannen modified the milestones: 5.2.1, 5.3 M1 Oct 28, 2019
@sbrannen sbrannen self-assigned this Oct 30, 2019
@sbrannen sbrannen modified the milestones: 5.3 M1, 5.2.2 Oct 30, 2019
@sbrannen sbrannen modified the milestones: 5.2.2, 5.3 M1 Nov 24, 2019
@sbrannen sbrannen modified the milestones: 5.3 M1, 5.2.3 Dec 31, 2019
@sbrannen
Copy link
Member Author

Update: the work on this is essentially complete and can be viewed in the following feature branch.

https://github.com/sbrannen/spring-framework/commits/issues/gh-23550-test-fixtures

The only open issue is disabling the publication of *-test-fixtures artifacts. There is a built-in feature for that in Gradle 6.x, but we'll have to find a custom workaround for Gradle 5.6.x.

sbrannen added a commit to sbrannen/spring-framework that referenced this issue Jan 2, 2020
sbrannen added a commit to sbrannen/spring-framework that referenced this issue Jan 2, 2020
sbrannen added a commit to sbrannen/spring-framework that referenced this issue Jan 2, 2020
sbrannen added a commit to sbrannen/spring-framework that referenced this issue Jan 2, 2020
sbrannen added a commit to sbrannen/spring-framework that referenced this issue Jan 2, 2020
sbrannen added a commit to sbrannen/spring-framework that referenced this issue Jan 2, 2020
sbrannen added a commit to sbrannen/spring-framework that referenced this issue Jan 2, 2020
sbrannen added a commit to sbrannen/spring-framework that referenced this issue Jan 2, 2020
sbrannen added a commit to sbrannen/spring-framework that referenced this issue Jan 2, 2020
sbrannen added a commit to sbrannen/spring-framework that referenced this issue Jan 2, 2020
sbrannen added a commit to sbrannen/spring-framework that referenced this issue Jan 2, 2020
sbrannen added a commit to sbrannen/spring-framework that referenced this issue Jan 2, 2020
Since we have migrated to Gradle's built-in test fixture support, the
custom TestSourcesPlugin Gradle plugin is now obsolete.

See spring-projectsgh-23550
sbrannen added a commit to sbrannen/spring-framework that referenced this issue Jan 2, 2020
Thanks to @melix for providing the code snippet necessary to achieve
this with Gradle 5.6.x.

See spring-projectsgh-23550
sbrannen added a commit that referenced this issue Jan 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: task A general task
Projects
None yet
Development

No branches or pull requests

2 participants