Skip to content

Conversation

dubinsky
Copy link

@dubinsky dubinsky commented Mar 11, 2025

DefaultTestExecuter hard-codes the use of ForkingTestClassProcessor. This pull request introduces a way to use alternative TestClassProcessor.

When running tests on Scala.js, forking is not an option, so Gradle Scala.js plugin needs to use a TestClassProcessor that does not fork.

Without an extension point, the only way to make this work is to fork DefaultTestExecuter class and track changes to its Gradle original in a different repository just to be able to override one method - which is sub-optimal ;)

Contributor Checklist

  • Review Contribution Guidelines.
  • Make sure that all commits are signed off to indicate that you agree to the terms of Developer Certificate of Origin.
  • Make sure all contributed code can be distributed under the terms of the Apache License 2.0, e.g. the code was written by yourself or the original code is licensed under a license compatible to Apache License 2.0.
  • Check "Allow edit from maintainers" option in pull request so that additional changes can be pushed by Gradle team.
  • Provide integration tests (under <subproject>/src/integTest) to verify changes from a user perspective.
  • Provide unit tests (under <subproject>/src/test) to verify logic.
  • Update User Guide, DSL Reference, and Javadoc for public-facing changes.
  • Ensure that tests pass sanity check: ./gradlew sanityCheck.
  • Ensure that tests pass locally: ./gradlew <changed-subproject>:quickTest.

Reviewing cheatsheet

Before merging the PR, comments starting with

  • ❌ ❓must be fixed
  • 🤔 💅 should be fixed
  • 💭 may be fixed
  • 🎉 celebrate happy things

@dubinsky dubinsky requested review from a team as code owners March 11, 2025 01:30
@dubinsky dubinsky requested a review from ghale March 11, 2025 01:30
@bot-gradle bot-gradle added from:contributor PR by an external contributor to-triage labels Mar 11, 2025
DefaultTestExecuter hard-codes the use of ForkingTestClassProcessor. This pull request introduces a way to use alternative TestClassProcessor.

When running tests on Scala.js, forking is not an option, so Gradle Scala.js plugin needs to use a TestClassProcessor that does not fork.

Without an extension point, the only way to make this work is to fork DefaultTestExecuter class and track changes to its Gradle original in a different repository just to be able to override one method - which is sub-optimal ;)

Signed-off-by: Leonid Dubinsky <dub@podval.org>
@mlopatkin
Copy link
Member

Thank you for your interest in Gradle.

Please create an issue first justifying these changes. We cannot accept them otherwise.


This exposes a method of an internal class, which already indicates an unwanted dependency. Please file an issue describing your use case, so we can discuss implementation options there.

@mlopatkin mlopatkin closed this Mar 11, 2025
@mlopatkin mlopatkin added closed:issue-first PR closed as there needs to be an issue first to discuss validity and removed to-triage labels Mar 11, 2025
@dubinsky
Copy link
Author

fixes #32666

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed:issue-first PR closed as there needs to be an issue first to discuss validity from:contributor PR by an external contributor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants