[cleanup]: Remove testRuntimeMigration configuration
- Dominant language
- Java
- Stars
- 8.7k
- Forks
- 4.7k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 196
Description
### What needs to happen?
This custom configuration was added in #16307 to mitigate a breaking change of Gradle7, where `testRuntime` configuration was removed.
In the original TODO comment:
```
// TODO(BEAM-13430): We create a testRuntimeMigration configuration here
// to extend testImplementation and testRuntimeOnly (similar to what
// testRuntime did). This allows for the start of the migration to Gradle
// 7. We want to remove this and migrate usages onto testImplementation,
// testRuntimeOnly or both when declared as a dependency.
// TODO(BEAM-13430): Figure out whether the artifact should be part of
// testImplementation, testRuntimeOnly, or a new configuration.
// Also, should the normal project jar also be part of this
// configuration removing the need to declare a dependency on project(X)
// and on project(X/testRuntimeConfiguration) and should it mirror what
// we are doing with shadowTest or not?
```
these TODO string later removed in #16430 . Effectively, it is testImplementation + testRuntimeOnly + make the project depend on both main + test jar.
Since then this configuration is used in various places, in most cases it is not necessary. Moreover, it will cause issue if the main scope and test scope codes compile with different java language level. As we are migrating to build and running tests with Java11+ (but keep main artifact bytecode compatible to Java8), the main artifact cannot depend on test jar.
Ways to eliminate testRuntimeMigration:
* If the project A does not depend on the test jar of project B, one could simply remove testRuntimeMigration, e.g. #31713
* If the project A depends on the test jar of project B, and project B is a text fixture, move the classes to main scope of B, e.g. #31693
Another problem this custom configuration introduced is that `analyzeClassesDependencies` does not detect whether the transient dependency introduced from `testRuntimeMigration` is also declared in build.gradle.
### Issue Priority
Priority: 2 (default / most normal work should be filed as P2)
### Issue Components
- [ ] Component: Python SDK
- [ ] Component: Java SDK
- [ ] Component: Go SDK
- [ ] Component: Typescript SDK
- [ ] Component: IO connector
- [ ] Component: Beam YAML
- [ ] Component: Beam examples
- [ ] Component: Beam playground
- [ ] Component: Beam katas
- [ ] Component: Website
- [ ] Component: Spark Runner
- [ ] Component: Flink Runner
- [ ] Component: Samza Runner
- [ ] Component: Twister2 Runner
- [ ] Component: Hazelcast Jet Runner
- [ ] Component: Google Cloud Dataflow Runner
Contributor guide
Assessment
This issue has not been assessed yet.