From a3030444ecd7b134fa207f3ec4168a7655dffae3 Mon Sep 17 00:00:00 2001 From: Vadim Tryshev Date: Tue, 12 Sep 2023 14:55:43 -0700 Subject: [PATCH] If running in presubmit, ignore @PortraitLandscape annotation. It's important to keep presubmits fast even if we will occasionally miss regressions in presubmit. Bug: 295939967 Test: presubmit Flag: N/A Change-Id: I9b65a2dc1e912fbfe834d7eee67815cb05f30bb2 --- .../android/launcher3/ui/PortraitLandscapeRunner.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/src/com/android/launcher3/ui/PortraitLandscapeRunner.java b/tests/src/com/android/launcher3/ui/PortraitLandscapeRunner.java index f0875f8104..ad1126832f 100644 --- a/tests/src/com/android/launcher3/ui/PortraitLandscapeRunner.java +++ b/tests/src/com/android/launcher3/ui/PortraitLandscapeRunner.java @@ -1,9 +1,12 @@ package com.android.launcher3.ui; +import static com.android.launcher3.util.rule.TestStabilityRule.PLATFORM_PRESUBMIT; + import android.util.Log; import android.view.Surface; import com.android.launcher3.tapl.TestHelpers; +import com.android.launcher3.util.rule.TestStabilityRule; import org.junit.rules.TestRule; import org.junit.runner.Description; @@ -30,8 +33,12 @@ public class PortraitLandscapeRunner implements TestRule { @Override public Statement apply(Statement base, Description description) { - if (!TestHelpers.isInLauncherProcess() || - description.getAnnotation(PortraitLandscape.class) == null) { + if (!TestHelpers.isInLauncherProcess() + || description.getAnnotation(PortraitLandscape.class) == null + // If running in presubmit, don't run in both orientations. + // It's important to keep presubmits fast even if we will occasionally miss + // regressions in presubmit. + || TestStabilityRule.getRunFlavor() == PLATFORM_PRESUBMIT) { return base; }