-
Notifications
You must be signed in to change notification settings - Fork 2
[DiscoveryTestClassesTask] Task that discovers testClasses in spock and junit-jupiter test engines #297
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
base: develop
Are you sure you want to change the base?
Conversation
…-testing into cr/discover-tests
Generate changelog in
|
✅ Successfully generated changelog entry!Need to regenerate?Simply interact with the changelog bot comment again to regenerate these entries. 📋Changelog Preview💡 Improvements
|
discover-tests-cli/src/main/java/com/palantir/gradle/plugintesting/SubClassesOfCommand.java
Outdated
Show resolved
Hide resolved
...plugin-testing/src/main/java/com/palantir/gradle/plugintesting/DiscoveryTestClassesTask.java
Outdated
Show resolved
Hide resolved
...-plugin-testing/src/main/java/com/palantir/gradle/plugintesting/DiscoverTestClassesTask.java
Show resolved
Hide resolved
...plugin-testing/src/main/java/com/palantir/gradle/plugintesting/DiscoveryTestClassesTask.java
Outdated
Show resolved
Hide resolved
gradle-plugin-testing/src/main/java/com/palantir/gradle/plugintesting/PluginTestingPlugin.java
Outdated
Show resolved
Hide resolved
|
|
||
| project.getTasks().withType(DiscoveryTestClassesTask.class, task -> { | ||
| SourceSetContainer sourceSetContainer = project.getExtensions().getByType(SourceSetContainer.class); | ||
| SourceSet testSourceSet = sourceSetContainer.getByName(SourceSet.TEST_SOURCE_SET_NAME); |
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 we want to capture integrationTest as well? That said, there aren't that many of them internally.
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 don't think this project is wiring in other places other sourceSets besides the test one. Should we add it as a FLUP ?
| SourceSetContainer sourceSetContainer = project.getExtensions().getByType(SourceSetContainer.class); | ||
| SourceSet testSourceSet = sourceSetContainer.getByName(SourceSet.TEST_SOURCE_SET_NAME); | ||
| task.getTestClasspath().setFrom(testSourceSet.getRuntimeClasspath()); | ||
| task.getRuntimeClasspath().setFrom(project.getConfigurations().getByName("runtimeClasspath")); |
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.
how are you capturing the classes that are discover-tests-cli ?
I think it's a little weird to put the runtimeClasspath on here.
We should probably make a configuration that contains just the discovery-tests-cli module and union that with the test classpath.
We should probably lock it as well since we wouldn't want it to clash - although we can probably hold off on this part until we see any issues.
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 actually don't need this anymore - as the "testImplementation" of the project already has the "discovery-tests-cli" here: https://github.com/palantir/gradle-plugin-testing/pull/297/files#diff-ca7ede7b34d2580d6fdb25b3707c5007eb08095357c26ab8c22bcb48236f2b85R232. Let me know if you prefer to have a separate config for this though
Before this PR
After this PR
FLUP for https://pl.ntr/2ye. We can now auto-discover the testClasesFiles in a repo using a
DiscoveryTestClassesTasktask. Introducing 2 tasks:discoverGradlePluginTestsdiscovers GradlePluginTests annotated test classes. This will be used by the Configuration cache enablement migration to discover the tests that need to be annotated with@DisabledConfigurationCache.discoverGroovyTestClassesToMigratediscovers the groovy test classes that extendIntegrationSpec,IntegrationTeskKitSpecexcluding theConfigurationCacheSpectests. This will be used by the excavator to discover the groovy tests that need to be migrated to the new junit framework.==COMMIT_MSG==
[DiscoveryTestClassesTask] Task that discovers testClasses in spock and junit-jupiter test engines
==COMMIT_MSG==
Possible downsides?