Repository navigation
Fix empty view list in performance tests and migrate OpenCloseViewTest to JUnit 5 - #4615
Conversation
HeikoKlare
left a comment
There was a problem hiding this comment.
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}") |
There was a problem hiding this comment.
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?
| @ParameterizedTest(name = "{index}: {0}") | |
| @ParameterizedTest(name = "{0}") |
There was a problem hiding this comment.
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
44ed50d to
c412216
Compare
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 viaIViewRegistry.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.ResizeTestOpenCloseViewTestAll green locally (macOS). Note:
OpenCloseViewTestnow takes about 6 minutes locally (26–59 s per view);ResizeTesttakes less than 10 s more.Views now covered
Commit 2: Migrate
OpenCloseViewTestto JUnit 5PerformanceTestCaseJunit5instead ofPerformanceTestCaseJunit4.CloseTestWindowsExtensioninstead ofCloseTestWindowsRule.@ParameterizedTestinstead ofRunWith(Parameterized.class).With this, nothing in eclipse.platform.ui uses
PerformanceTestCaseJunit4anymore. What to do with it afterwards is still an open question on #3639.