Skip to content

Add control of PMD execution threads to plugin goal#700

Open
harrisric wants to merge 1 commit intoapache:masterfrom
harrisric:feature/pmd-plugin-thread-control
Open

Add control of PMD execution threads to plugin goal#700
harrisric wants to merge 1 commit intoapache:masterfrom
harrisric:feature/pmd-plugin-thread-control

Conversation

@harrisric
Copy link
Copy Markdown

Following this checklist to help us incorporate your
contribution quickly and easily:

  • Your pull request should address just one issue, without pulling in other changes.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Each commit in the pull request should have a meaningful subject line and body.
    Note that commits might be squashed by a maintainer on merge.
  • Write unit tests that match behavioral changes, where the tests fail if the changes to the runtime are not applied.
    This may not always be possible but is a best-practice.
  • Run mvn verify to make sure basic checks pass.
    A more thorough check will be performed on your pull request automatically.
  • You have run the integration tests successfully (mvn -Prun-its verify).

If your pull request is about ~20 lines of code you don't need to sign an
Individual Contributor License Agreement if you are unsure
please ask on the developers list.

To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.

This change adds feature #380
Tested locally but I have not yet written any unit tests as I was not sure of the style/approach that would be considered suitable for this type of additional configuration. as it doesn't change the output of the analysis/report in anyway. It would be easy to separate the handling of the configuration and add tests for that if required.

@harrisric
Copy link
Copy Markdown
Author

@adangel what needs to happen for this to be reviewed and accepted?

@slawekjaranowski
Copy link
Copy Markdown
Member

A test will be appreciated for it

@harrisric
Copy link
Copy Markdown
Author

harrisric commented Apr 28, 2026

@slawekjaranowski happy to do that, could you suggest where this would fit in the existing tests? As I noted above this doesn't change the output of the analysis / report in any way.
I could write a unit test which shows that the numThreadsConverter method works, particularly by separating it from the mojo (and possibly needing to further abstract away the use of Runtime.getRuntime().availableProcessors()).
Or I could write a test which shows that the value is propagated to the PMDConfiguration on the executor, but there are no existing tests like this.
Or I could write a further integration-test, though it would likely be a simple copy of an existing test with the new configuration. Also the variations using a multiple of the cores available are not really testable in this sense as we cannot control the cores available in the test environment.
Just want to make sure any tests I do add here provide some material value to the project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[MPMD-413] Add support for configuring the max number of threads to use

2 participants