Skip to content

Copilot/add context menu for disabled tests#2717

Closed
carstenartur wants to merge 25 commits into
eclipse-jdt:masterfrom
carstenartur:copilot/add-context-menu-for-disabled-tests
Closed

Copilot/add context menu for disabled tests#2717
carstenartur wants to merge 25 commits into
eclipse-jdt:masterfrom
carstenartur:copilot/add-context-menu-for-disabled-tests

Conversation

@carstenartur
Copy link
Copy Markdown
Contributor

What it does

Adds a Quick Assist Processor that provides context menu actions to disable and enable JUnit test methods in Eclipse JDT.

Features

Detects JUnit test methods (both JUnit 4 and JUnit 5)
Supports JUnit 5 parameterized tests (@ParameterizedTest)
Supports JUnit 5 repeated tests (@RepeatedTest)
Supports JUnit 5 test factories (@testfactory)
Supports JUnit 5 test templates (https://github.com/testtemplate)
Offers to add @disabled (JUnit 5) or @ignore (JUnit 4) annotations to disable tests
Offers to remove these annotations to enable disabled tests
Automatically handles imports for the annotations
How to Use

Place cursor on a JUnit test method (annotated with @test, @ParameterizedTest, @RepeatedTest, etc.)
Press Ctrl+1 (or Cmd+1 on Mac) to open the Quick Assist menu
Select "Disable test with @disabled" or "Disable test with @ignore"
To enable a disabled test, select "Enable test (remove @disabled)" or "Enable test (remove @ignore)"
Implementation

JUnitQuickAssistProcessor: Detects test methods and provides appropriate proposals
AddAnnotationProposal: Adds @disabled or @ignore annotation to test methods
RemoveAnnotationProposal: Removes @disabled or @ignore annotation from test methods
Registered as a Quick Assist Processor in plugin.xml
All message strings properly externalized in JUnitMessages.properties
Annotation Logic

@disabled is used for JUnit 5 tests (methods annotated with org.junit.jupiter.api.Test, @ParameterizedTest, @RepeatedTest, @testfactory, or @testtemplate)
@ignore is used for JUnit 4 tests (methods annotated with org.junit.Test)

How to test

Add @disabled to JUnit 5 test
Remove @disabled from JUnit 5 test
Add @ignore to JUnit 4 test
Remove @ignore from JUnit 4 test
No proposals for non-test methods
Add @disabled to parameterized test (@ParameterizedTest)
Add @disabled to repeated test (@RepeatedTest)

Author checklist

carstenartur and others added 25 commits October 14, 2025 22:06
* Bump codacy/codacy-analysis-cli-action from 1.1.0 to 4.4.0 (#19)

* Formaster3 (#20)

* Update maven.yml (#9)

* Formaster4 (#8)

* Create dependabot.yml

* Update dependabot.yml

* Update dependabot.yml

* Update dependabot.yml

* Create codacy.yml

* Update pom.xml

* Bump tycho.version from 2.3.0 to 2.7.3

Bumps `tycho.version` from 2.3.0 to 2.7.3.

Updates `tycho-surefire-plugin` from 2.3.0 to 2.7.3

Updates `tycho-source-plugin` from 2.3.0 to 2.7.3
- [Release notes](https://github.com/eclipse/tycho/releases)
- [Changelog](https://github.com/eclipse/tycho/blob/master/RELEASE_NOTES.md)
- [Commits](eclipse-tycho/tycho@tycho-2.3.0...tycho-2.7.3)

Updates `tycho-p2-plugin` from 2.3.0 to 2.7.3

---
updated-dependencies:
- dependency-name: org.eclipse.tycho:tycho-surefire-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: org.eclipse.tycho:tycho-source-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: org.eclipse.tycho:tycho-p2-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Create codeql.yml

* Create maven.yml

* Update README.md

* Update README.md

* Update README.md

* Bump tycho.version from 2.7.3 to 2.7.4

Bumps `tycho.version` from 2.7.3 to 2.7.4.

Updates `tycho-surefire-plugin` from 2.7.3 to 2.7.4

Updates `tycho-source-plugin` from 2.7.3 to 2.7.4
- [Release notes](https://github.com/eclipse/tycho/releases)
- [Changelog](https://github.com/eclipse/tycho/blob/tycho-2.7.4/RELEASE_NOTES.md)
- [Commits](eclipse-tycho/tycho@tycho-2.7.3...tycho-2.7.4)

Updates `tycho-p2-plugin` from 2.7.3 to 2.7.4

---
updated-dependencies:
- dependency-name: org.eclipse.tycho:tycho-surefire-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.eclipse.tycho:tycho-source-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.eclipse.tycho:tycho-p2-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump tycho.version from 2.7.4 to 2.7.5

Bumps `tycho.version` from 2.7.4 to 2.7.5.

Updates `tycho-surefire-plugin` from 2.7.4 to 2.7.5

Updates `tycho-source-plugin` from 2.7.4 to 2.7.5
- [Release notes](https://github.com/eclipse/tycho/releases)
- [Changelog](https://github.com/eclipse-tycho/tycho/blob/tycho-2.7.5/RELEASE_NOTES.md)
- [Commits](eclipse-tycho/tycho@tycho-2.7.4...tycho-2.7.5)

Updates `tycho-p2-plugin` from 2.7.4 to 2.7.5

---
updated-dependencies:
- dependency-name: org.eclipse.tycho:tycho-surefire-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.eclipse.tycho:tycho-source-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.eclipse.tycho:tycho-p2-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update README.md

* Update maven.yml

* Update codeql.yml

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update dependabot.yml

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update maven.yml

* Update maven.yml (#10)

* Update maven.yml for java 20 (#11)

* Update codeql.yml (#12)

* Update maven.yml

* Update codeql.yml

* Update codeql.yml

* Bump actions/setup-java from 2 to 4 (#17)

Bumps [actions/setup-java](https://github.com/actions/setup-java) from 2 to 4.
- [Release notes](https://github.com/actions/setup-java/releases)
- [Commits](actions/setup-java@v2...v4)

---
updated-dependencies:
- dependency-name: actions/setup-java
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump github/codeql-action from 2 to 3 (#16)

Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2 to 3.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](github/codeql-action@v2...v3)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump codacy/codacy-analysis-cli-action from 1.1.0 to 4.3.0 (#15)

Bumps [codacy/codacy-analysis-cli-action](https://github.com/codacy/codacy-analysis-cli-action) from 1.1.0 to 4.3.0.
- [Release notes](https://github.com/codacy/codacy-analysis-cli-action/releases)
- [Commits](codacy/codacy-analysis-cli-action@d840f88...5cc54a7)

---
updated-dependencies:
- dependency-name: codacy/codacy-analysis-cli-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump cirrus-actions/rebase from 1.7 to 1.8 (#14)

Bumps [cirrus-actions/rebase](https://github.com/cirrus-actions/rebase) from 1.7 to 1.8.
- [Release notes](https://github.com/cirrus-actions/rebase/releases)
- [Commits](cirrus-actions/rebase@1.7...1.8)

---
updated-dependencies:
- dependency-name: cirrus-actions/rebase
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update codeql.yml

* Update codacy.yml

* Bump actions/checkout from 3 to 4 (#13)

* Update codacy.yml

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump stCarolas/setup-maven from 4.5 to 5 (#22)

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: carstenartur <3164220+carstenartur@users.noreply.github.com>
…ze loop

Co-authored-by: carstenartur <3164220+carstenartur@users.noreply.github.com>
Co-authored-by: carstenartur <3164220+carstenartur@users.noreply.github.com>
…r, improve type safety

Co-authored-by: carstenartur <3164220+carstenartur@users.noreply.github.com>
Co-authored-by: carstenartur <3164220+carstenartur@users.noreply.github.com>
Co-authored-by: carstenartur <3164220+carstenartur@users.noreply.github.com>
Co-authored-by: carstenartur <3164220+carstenartur@users.noreply.github.com>
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.

2 participants