Skip to content

Commit 5dc4c0a

Browse files
committed
Disable test_PlaceholderOnTopStackSwitch() on MacOS I-builds
PartOnTopManagerTest.test_PlaceholderOnTopStackSwitch() fails stabily in MacOS I-builds. Since its unclear what is wrong, the test is now disabled to reduce noise in test results. See: #3893
1 parent 27c8c9d commit 5dc4c0a

2 files changed

Lines changed: 38 additions & 0 deletions

File tree

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2026 Simeon Andreev and others.
3+
*
4+
* This program and the accompanying materials
5+
* are made available under the terms of the Eclipse Public License 2.0
6+
* which accompanies this distribution, and is available at
7+
* https://www.eclipse.org/legal/epl-2.0/
8+
*
9+
* SPDX-License-Identifier: EPL-2.0
10+
*
11+
* Contributors:
12+
* Simeon Andreev - initial API and implementation
13+
******************************************************************************/
14+
15+
package org.eclipse.e4.ui.tests.model.test.util;
16+
17+
public class E4UITestUtils {
18+
19+
public static final String JENKINS_JOB_NAME_ENV_VAR = "JOB_NAME";
20+
21+
/**
22+
* Return {@code true} if we are probably running on Jenkins, i.e. if
23+
* {@link #JENKINS_JOB_NAME_ENV_VAR} is set. Jenkins jobs are:
24+
* <ul>
25+
* <li>I-builds</li>
26+
* <li>GitHub PR test job, excluding the Windows/Linux/MacOS test jobs ran with
27+
* Tycho</li>
28+
* </ul>
29+
*/
30+
public static boolean isRunningOnJenkins() {
31+
return System.getenv(JENKINS_JOB_NAME_ENV_VAR) != null;
32+
}
33+
}

tests/org.eclipse.e4.ui.tests/src/org/eclipse/e4/ui/tests/workbench/PartOnTopManagerTest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import static org.junit.jupiter.api.Assertions.assertTrue;
2020

2121
import jakarta.inject.Inject;
22+
import org.eclipse.core.runtime.Platform;
2223
import org.eclipse.e4.ui.internal.workbench.PartOnTopManager;
2324
import org.eclipse.e4.ui.model.application.MApplication;
2425
import org.eclipse.e4.ui.model.application.ui.MContext;
@@ -29,10 +30,12 @@
2930
import org.eclipse.e4.ui.model.application.ui.basic.MPartSashContainer;
3031
import org.eclipse.e4.ui.model.application.ui.basic.MPartStack;
3132
import org.eclipse.e4.ui.model.application.ui.basic.MWindow;
33+
import org.eclipse.e4.ui.tests.model.test.util.E4UITestUtils;
3234
import org.eclipse.e4.ui.tests.rules.WorkbenchContextExtension;
3335
import org.eclipse.e4.ui.workbench.IWorkbench;
3436
import org.eclipse.e4.ui.workbench.modeling.EModelService;
3537
import org.eclipse.e4.ui.workbench.modeling.EPartService;
38+
import org.junit.jupiter.api.Assumptions;
3639
import org.junit.jupiter.api.Test;
3740
import org.junit.jupiter.api.extension.RegisterExtension;
3841

@@ -136,6 +139,8 @@ public void test_PartOnTopStackSwitch() {
136139

137140
@Test
138141
public void test_PlaceholderOnTopStackSwitch() {
142+
Assumptions.assumeFalse(Platform.OS.isMac() && E4UITestUtils.isRunningOnJenkins(),
143+
"test fails stably on MacOS I-builds, its unclear how to fix it, see: https://github.com/eclipse-platform/eclipse.platform.ui/issues/3893");
139144
MWindow window = ems.createModelElement(MWindow.class);
140145
application.getChildren().add(window);
141146
application.setSelectedElement(window);

0 commit comments

Comments
 (0)