Skip to content

Fix empty view list in performance tests and migrate OpenCloseViewTest to JUnit 5 - #4615

Merged
HeikoKlare merged 2 commits into
eclipse-platform:masterfrom
ravnskjaer:junit5-open-close-view-test-3639
Dec 6, 2026
Merged

HeikoKlare merged 2 commits into
eclipse-platform:masterfrom
ravnskjaer:junit5-open-close-view-test-3639

Conversation

@ravnskjaer

@ravnskjaer ravnskjaer commented Dec 5, 2026 •

Copy link
Copy Markdown
Contributor

Migrates the last performance test that still used PerformanceTestCaseJunit4, as part of #3639.

Commit 1: Fix ViewPerformanceUtil.getAllTestableViewIds()

It always returned an empty set: in the e4 compatibility layer, IViewDescriptor.getCategoryPath() contains the category label (e.g. "General") instead of the category id (org.eclipse.ui), so no view matched. Views are now selected via IViewRegistry.getCategories() by category id, and returned sorted so the test order is deterministic.

This PR only fixes the test utility. Whether IViewDescriptor.getCategoryPath() should return ids again is an API question; I'm happy to open a separate issue for it.

Test Before After
ResizeTest 5 cases (perspectives only) 14 cases (+9 views)
OpenCloseViewTest 0 cases 9 cases

All green locally (macOS). Note: OpenCloseViewTest now takes about 6 minutes locally (26–59 s per view); ResizeTest takes less than 10 s more.

Views now covered
  • org.eclipse.ui.navigator.ProjectExplorer
  • org.eclipse.ui.views.AllMarkersView
  • org.eclipse.ui.views.BookmarkView
  • org.eclipse.ui.views.ContentOutline
  • org.eclipse.ui.views.ProblemView
  • org.eclipse.ui.views.ProgressView
  • org.eclipse.ui.views.PropertySheet
  • org.eclipse.ui.views.TaskList
  • org.eclipse.ui.views.minimap.MinimapView

Commit 2: Migrate OpenCloseViewTest to JUnit 5

  • Use PerformanceTestCaseJunit5 instead of PerformanceTestCaseJunit4.
  • Use CloseTestWindowsExtension instead of CloseTestWindowsRule.
  • Use @ParameterizedTest instead of RunWith(Parameterized.class).
  • Update the outdated class Javadoc.

With this, nothing in eclipse.platform.ui uses PerformanceTestCaseJunit4 anymore. What to do with it afterwards is still an open question on #3639.

@github-actions

github-actions Bot commented Dec 5, 2026 •

Copy link
Copy Markdown
Contributor

Test Results

   867 files  ±0     867 suites  ±0   1h 10m 9s ⏱️ + 17m 59s
 8 640 tests ±0   8 400 ✅ ±0  240 💤 ±0  0 ❌ ±0 
21 789 runs  ±0  21 116 ✅ ±0  673 💤 ±0  0 ❌ ±0 

Results for commit c412216. ± Comparison against base commit db49304.

♻️ This comment has been updated with latest results.

@HeikoKlare HeikoKlare left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for fixing this and for the detailed description! Looking the views up by category ID fixes the empty list, and the extra runtime you describe is fine with me.

One general remark: this PR has two independent changes, the fix in ViewPerformanceUtil and the JUnit 5 migration of OpenCloseViewTest. In general, please put independent changes in separate PRs rather than separate commits in one PR, so each can be reviewed, tested and reverted on its own. I'm fine with it this time to avoid the extra work of splitting it up.

With the test name changed (see inline comment), this looks good to me.


@Test
public void test() throws Throwable {
@ParameterizedTest(name = "{index}: {0}")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sorting keeps the indices stable between runs, but only while the set of views doesn't change. PerformanceTestCaseJunit5 builds the ID it stores results under from the display name. So when a view is added, removed or hidden by an activity, every view after it moves to a new position and gets a new ID, and its history and baseline comparison are lost. The view ID alone is already unique and stable, so could you drop the index?

Suggested change
@ParameterizedTest(name = "{index}: {0}")
@ParameterizedTest(name = "{0}")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good point, thanks! I dropped the index, so the scenario ID is now just the view ID. I also reworded the commit message and description, which claimed the sorting keeps the IDs stable. It now only keeps the test order deterministic.

In the e4 compatibility layer, IViewDescriptor.getCategoryPath()
contains the category label ("General") instead of the category id
("org.eclipse.ui"), so no view ever matched and the view cases of
OpenCloseViewTest and ResizeTest did not run.

Select the views via IViewRegistry.getCategories() by category id
instead, and return them sorted so that the test order is deterministic.

Part of eclipse-platform#3639
* Use PerformanceTestCaseJunit5 instead of PerformanceTestCaseJunit4.
* Use CloseTestWindowsExtension instead of CloseTestWindowsRule.
* Use @ParameterizedTest instead of RunWith(Parameterized.class).
* Update the outdated class Javadoc.

Part of eclipse-platform#3639
@ravnskjaer
ravnskjaer force-pushed the junit5-open-close-view-test-3639 branch from 44ed50d to c412216 Compare December 6, 2026 18:08
@ravnskjaer
ravnskjaer requested a review from HeikoKlare December 6, 2026 18:12

@HeikoKlare HeikoKlare left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you!

@HeikoKlare
HeikoKlare merged commit 8e514b1 into eclipse-platform:master Dec 6, 2026
18 checks passed
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