Skip to content

[test] chore: Throw a TestAbortedException on disabled tests#6576

Merged
adangel merged 1 commit into
pmd:mainfrom
UncleOwen:correctly-mark-disabled-tests
Apr 7, 2026
Merged

[test] chore: Throw a TestAbortedException on disabled tests#6576
adangel merged 1 commit into
pmd:mainfrom
UncleOwen:correctly-mark-disabled-tests

Conversation

@UncleOwen
Copy link
Copy Markdown
Member

@UncleOwen UncleOwen commented Apr 5, 2026

Describe the PR

Tests are skipped if

  • they are marked as disabled="true" OR
  • any other test in the same .xml file is marked as focused="true"

This change allows for correct reporting: Previously, UnusedAssignmentTest would show as "169 tests passed" in IntelliJ. Now it shows as "168 tests passed, 1 ignored", because one test is diabled. Also, the correct symbol is shown for the disabled test. (Other test runners will behave similarly.)

Related issues

none

Ready?

  • Added unit tests for fixed bug/feature - Should I? The only tests I could see for this involved a massive amount of mocking. Even more than the existing tests for RuleTst.java
  • Passing all unit tests
  • Complete build ./mvnw clean verify passes (checked automatically by github actions)
  • [n/a] Added (in-code) documentation (if needed)

Tests are skipped if
  * they are marked as disabled="true" OR
  * any other test in the same .xml file is marked as focused="true"

This change allows for correct reporting: Previously,
UnusedAssignmentTest would show as "169 tests passed" in IntelliJ. Now
it shows as "168 tests passed, 1 ignored". Also, the correct symbol is
shown for the disabled test. (Other test runners will behave similarly.)
@UncleOwen UncleOwen marked this pull request as draft April 5, 2026 18:27
@codacy-production
Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 duplication

Metric Results
Duplication 0

View in Codacy

TIP This summary will be updated as you push new changes. Give us feedback

@pmd-actions-helper
Copy link
Copy Markdown
Contributor

Documentation Preview

No regression tested rules have been changed.

(comment created at 2026-04-05 18:41:44+00:00 for 41f903b)

@UncleOwen UncleOwen marked this pull request as ready for review April 5, 2026 19:14
@adangel adangel changed the title [core] Throw a TestAbortedException on disabled tests [core] chore: Throw a TestAbortedException on disabled tests Apr 7, 2026
@adangel adangel added the in:pmd-internals Affects PMD's internals label Apr 7, 2026
@adangel adangel added this to the 7.24.0 milestone Apr 7, 2026
Copy link
Copy Markdown
Member

@adangel adangel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@adangel adangel changed the title [core] chore: Throw a TestAbortedException on disabled tests [test] chore: Throw a TestAbortedException on disabled tests Apr 7, 2026
adangel added a commit that referenced this pull request Apr 7, 2026
@adangel adangel merged commit 41f903b into pmd:main Apr 7, 2026
12 checks passed
@UncleOwen UncleOwen deleted the correctly-mark-disabled-tests branch April 16, 2026 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in:pmd-internals Affects PMD's internals

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants