aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google/devtools/build
diff options
context:
space:
mode:
authorGravatar janakr <janakr@google.com>2017-10-12 22:53:47 +0200
committerGravatar Marcel Hlopko <hlopko@google.com>2017-10-13 13:53:20 +0200
commit7a6e00281260508c71c7d9ada9efe6f31eaffc45 (patch)
treef40e79310cc1e07ce7e3c7431454c72d98d34f3f /src/test/java/com/google/devtools/build
parent9cf05abe06ee687d21e8a5bb12399a33f3fe0498 (diff)
Disable some tests that can't currently run in special internal execution mode.
PiperOrigin-RevId: 172007131
Diffstat (limited to 'src/test/java/com/google/devtools/build')
-rw-r--r--src/test/java/com/google/devtools/build/lib/analysis/AspectTest.java9
-rw-r--r--src/test/java/com/google/devtools/build/lib/analysis/BuildViewTest.java65
-rw-r--r--src/test/java/com/google/devtools/build/lib/analysis/ConfigurationsForLateBoundTargetsTest.java11
-rw-r--r--src/test/java/com/google/devtools/build/lib/testutil/TestOnlyInNormalExecutionMode.java22
4 files changed, 102 insertions, 5 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/analysis/AspectTest.java b/src/test/java/com/google/devtools/build/lib/analysis/AspectTest.java
index 9dcd016a17..76336feacd 100644
--- a/src/test/java/com/google/devtools/build/lib/analysis/AspectTest.java
+++ b/src/test/java/com/google/devtools/build/lib/analysis/AspectTest.java
@@ -47,6 +47,7 @@ import com.google.devtools.build.lib.packages.Attribute.LateBoundDefault;
import com.google.devtools.build.lib.packages.NativeAspectClass;
import com.google.devtools.build.lib.packages.RuleClass;
import com.google.devtools.build.lib.skyframe.AspectValue;
+import com.google.devtools.build.lib.testutil.TestConstants;
import com.google.devtools.build.lib.vfs.ModifiedFileSet;
import java.util.ArrayList;
import java.util.List;
@@ -203,6 +204,10 @@ public class AspectTest extends AnalysisTestCase {
@Test
public void aspectCreationWorksThroughBind() throws Exception {
+ if (getInternalTestExecutionMode() != TestConstants.InternalTestExecutionMode.NORMAL) {
+ // TODO(b/67651960): fix or justify disabling.
+ return;
+ }
setRulesAvailableInTests(new TestAspects.BaseRule(), new TestAspects.HonestRule(),
new TestAspects.AspectRequiringProviderRule());
@@ -350,6 +355,10 @@ public class AspectTest extends AnalysisTestCase {
@Test
public void aspectWarningsFilteredByOutputFiltersForAssociatedRules() throws Exception {
+ if (getInternalTestExecutionMode() != TestConstants.InternalTestExecutionMode.NORMAL) {
+ // TODO(b/67651960): fix or justify disabling.
+ return;
+ }
setRulesAvailableInTests(new TestAspects.BaseRule(), new TestAspects.WarningAspectRule());
pkg("a", "warning_aspect(name='a', foo=['//b:b', '//c:c'])");
pkg("b", "base(name='b')");
diff --git a/src/test/java/com/google/devtools/build/lib/analysis/BuildViewTest.java b/src/test/java/com/google/devtools/build/lib/analysis/BuildViewTest.java
index 4be4254c8e..ae217d3b54 100644
--- a/src/test/java/com/google/devtools/build/lib/analysis/BuildViewTest.java
+++ b/src/test/java/com/google/devtools/build/lib/analysis/BuildViewTest.java
@@ -43,6 +43,7 @@ import com.google.devtools.build.lib.packages.Attribute;
import com.google.devtools.build.lib.packages.BuildType;
import com.google.devtools.build.lib.packages.Rule;
import com.google.devtools.build.lib.testutil.Suite;
+import com.google.devtools.build.lib.testutil.TestConstants;
import com.google.devtools.build.lib.testutil.TestSpec;
import com.google.devtools.build.lib.util.Pair;
import com.google.devtools.build.lib.vfs.Path;
@@ -443,6 +444,10 @@ public class BuildViewTest extends BuildViewTestBase {
// Regression test: "output_filter broken (but in a different way)"
@Test
public void testOutputFilter() throws Exception {
+ if (getInternalTestExecutionMode() != TestConstants.InternalTestExecutionMode.NORMAL) {
+ // TODO(b/67651960): fix or justify disabling.
+ return;
+ }
runAnalysisWithOutputFilter(Pattern.compile("^//java/c"));
assertNoEvents();
}
@@ -462,6 +467,10 @@ public class BuildViewTest extends BuildViewTestBase {
*/
@Test
public void testCircularDependencyBelowTwoTargets() throws Exception {
+ if (getInternalTestExecutionMode() != TestConstants.InternalTestExecutionMode.NORMAL) {
+ // TODO(b/67412276): handle cycles properly.
+ return;
+ }
scratch.file("foo/BUILD",
"sh_library(name = 'top1', srcs = ['top1.sh'], deps = [':rec1'])",
"sh_library(name = 'top2', srcs = ['top2.sh'], deps = [':rec1'])",
@@ -479,6 +488,10 @@ public class BuildViewTest extends BuildViewTestBase {
// Regression test: cycle node depends on error.
@Test
public void testErrorBelowCycle() throws Exception {
+ if (getInternalTestExecutionMode() != TestConstants.InternalTestExecutionMode.NORMAL) {
+ // TODO(b/67651960): fix or justify disabling (also b/67412276: handle cycles properly).
+ return;
+ }
scratch.file("foo/BUILD",
"sh_library(name = 'top', deps = ['mid'])",
"sh_library(name = 'mid', deps = ['bad', 'cycle1'])",
@@ -509,6 +522,10 @@ public class BuildViewTest extends BuildViewTestBase {
@Test
public void testErrorBelowCycleKeepGoing() throws Exception {
+ if (getInternalTestExecutionMode() != TestConstants.InternalTestExecutionMode.NORMAL) {
+ // TODO(b/67412276): handle cycles properly.
+ return;
+ }
scratch.file("foo/BUILD",
"sh_library(name = 'top', deps = ['mid'])",
"sh_library(name = 'mid', deps = ['bad', 'cycle1'])",
@@ -645,6 +662,10 @@ public class BuildViewTest extends BuildViewTestBase {
@Test
public void testDepOnGoodTargetInBadPkgAndTransitiveCycle_Incremental() throws Exception {
+ if (getInternalTestExecutionMode() != TestConstants.InternalTestExecutionMode.NORMAL) {
+ // TODO(b/67412276): handle cycles properly.
+ return;
+ }
runTestDepOnGoodTargetInBadPkgAndTransitiveCycle(/*incremental=*/true);
}
@@ -654,6 +675,10 @@ public class BuildViewTest extends BuildViewTestBase {
*/
@Test
public void testCycleReporting_TargetCycleWhenPackageInError() throws Exception {
+ if (getInternalTestExecutionMode() != TestConstants.InternalTestExecutionMode.NORMAL) {
+ // TODO(b/67412276): handle cycles properly.
+ return;
+ }
reporter.removeHandler(failFastHandler);
scratch.file("cycles/BUILD",
"sh_library(name = 'a', deps = [':b'])",
@@ -666,6 +691,10 @@ public class BuildViewTest extends BuildViewTestBase {
@Test
public void testTransitiveLoadingDoesntShortCircuitInKeepGoing() throws Exception {
+ if (getInternalTestExecutionMode() != TestConstants.InternalTestExecutionMode.NORMAL) {
+ // TODO(b/67651960): fix or justify disabling.
+ return;
+ }
reporter.removeHandler(failFastHandler);
scratch.file("parent/BUILD",
"sh_library(name = 'a', deps = ['//child:b'])",
@@ -859,6 +888,10 @@ public class BuildViewTest extends BuildViewTestBase {
*/
@Test
public void testPostProcessedConfigurableAttributes() throws Exception {
+ if (getInternalTestExecutionMode() != TestConstants.InternalTestExecutionMode.NORMAL) {
+ // TODO(b/67651960): fix or justify disabling.
+ return;
+ }
useConfiguration("--cpu=k8");
reporter.removeHandler(failFastHandler); // Expect errors from action conflicts.
scratch.file("conflict/BUILD",
@@ -877,6 +910,10 @@ public class BuildViewTest extends BuildViewTestBase {
@Test
public void testCycleDueToJavaLauncherConfiguration() throws Exception {
+ if (getInternalTestExecutionMode() != TestConstants.InternalTestExecutionMode.NORMAL) {
+ // TODO(b/67412276): handle cycles properly.
+ return;
+ }
if (defaultFlags().contains(Flag.TRIMMED_CONFIGURATIONS)) {
// Trimmed configurations don't yet support late-bound attributes.
// TODO(gregce): re-enable this when ready.
@@ -928,6 +965,10 @@ public class BuildViewTest extends BuildViewTestBase {
*/
@Test
public void testCircularDependency() throws Exception {
+ if (getInternalTestExecutionMode() != TestConstants.InternalTestExecutionMode.NORMAL) {
+ // TODO(b/67412276): handle cycles properly.
+ return;
+ }
scratch.file("cycle/BUILD",
"cc_library(name = 'foo', srcs = ['foo.cc'], deps = [':bar'])",
"cc_library(name = 'bar', srcs = ['bar.cc'], deps = [':foo'])");
@@ -949,6 +990,10 @@ public class BuildViewTest extends BuildViewTestBase {
*/
@Test
public void testCircularDependencyWithKeepGoing() throws Exception {
+ if (getInternalTestExecutionMode() != TestConstants.InternalTestExecutionMode.NORMAL) {
+ // TODO(b/67412276): handle cycles properly.
+ return;
+ }
scratch.file("cycle/BUILD",
"cc_library(name = 'foo', srcs = ['foo.cc'], deps = [':bar'])",
"cc_library(name = 'bar', srcs = ['bar.cc'], deps = [':foo'])",
@@ -981,6 +1026,10 @@ public class BuildViewTest extends BuildViewTestBase {
@Test
public void testCircularDependencyWithLateBoundLabel() throws Exception {
+ if (getInternalTestExecutionMode() != TestConstants.InternalTestExecutionMode.NORMAL) {
+ // TODO(b/67412276): handle cycles properly.
+ return;
+ }
scratch.file("cycle/BUILD",
"cc_library(name = 'foo', deps = [':bar'])",
"cc_library(name = 'bar')");
@@ -1109,6 +1158,10 @@ public class BuildViewTest extends BuildViewTestBase {
@Test
public void testNonTopLevelErrorsPrintedExactlyOnce() throws Exception {
+ if (getInternalTestExecutionMode() != TestConstants.InternalTestExecutionMode.NORMAL) {
+ // TODO(b/67651960): fix or justify disabling.
+ return;
+ }
scratch.file("parent/BUILD",
"sh_library(name = 'a', deps = ['//child:b'])");
scratch.file("child/BUILD",
@@ -1128,6 +1181,10 @@ public class BuildViewTest extends BuildViewTestBase {
@Test
public void testNonTopLevelErrorsPrintedExactlyOnce_KeepGoing() throws Exception {
+ if (getInternalTestExecutionMode() != TestConstants.InternalTestExecutionMode.NORMAL) {
+ // TODO(b/67651960): fix or justify disabling.
+ return;
+ }
scratch.file("parent/BUILD",
"sh_library(name = 'a', deps = ['//child:b'])");
scratch.file("child/BUILD",
@@ -1143,6 +1200,10 @@ public class BuildViewTest extends BuildViewTestBase {
@Test
public void testNonTopLevelErrorsPrintedExactlyOnce_ActionListener() throws Exception {
+ if (getInternalTestExecutionMode() != TestConstants.InternalTestExecutionMode.NORMAL) {
+ // TODO(b/67651960): fix or justify disabling.
+ return;
+ }
scratch.file("parent/BUILD",
"sh_library(name = 'a', deps = ['//child:b'])");
scratch.file("child/BUILD",
@@ -1166,6 +1227,10 @@ public class BuildViewTest extends BuildViewTestBase {
@Test
public void testNonTopLevelErrorsPrintedExactlyOnce_ActionListener_KeepGoing() throws Exception {
+ if (getInternalTestExecutionMode() != TestConstants.InternalTestExecutionMode.NORMAL) {
+ // TODO(b/67651960): fix or justify disabling.
+ return;
+ }
scratch.file("parent/BUILD",
"sh_library(name = 'a', deps = ['//child:b'])");
scratch.file("child/BUILD",
diff --git a/src/test/java/com/google/devtools/build/lib/analysis/ConfigurationsForLateBoundTargetsTest.java b/src/test/java/com/google/devtools/build/lib/analysis/ConfigurationsForLateBoundTargetsTest.java
index 67b125f68d..2df42395e5 100644
--- a/src/test/java/com/google/devtools/build/lib/analysis/ConfigurationsForLateBoundTargetsTest.java
+++ b/src/test/java/com/google/devtools/build/lib/analysis/ConfigurationsForLateBoundTargetsTest.java
@@ -28,6 +28,7 @@ import com.google.devtools.build.lib.cmdline.Label;
import com.google.devtools.build.lib.packages.Attribute;
import com.google.devtools.build.lib.skyframe.util.SkyframeExecutorTestUtils;
import com.google.devtools.build.lib.testutil.Suite;
+import com.google.devtools.build.lib.testutil.TestOnlyInNormalExecutionMode;
import com.google.devtools.build.lib.testutil.TestRuleClassProvider;
import com.google.devtools.build.lib.testutil.TestSpec;
import org.junit.Before;
@@ -38,12 +39,12 @@ import org.junit.runners.JUnit4;
/**
* Tests <target, sourceConfig> -> <dep, depConfig> relationships over latebound attributes.
*
- * <p>Ideally these tests would be in
- * {@link com.google.devtools.build.lib.skyframe.ConfigurationsForTargetsTest}. But that's a
- * Skyframe test (ConfiguredTargetFunction is a Skyframe function). And the Skyframe library doesn't
- * know anything about latebound attributes. So we need to place these properly under the analysis
- * package.
+ * <p>Ideally these tests would be in {@link
+ * com.google.devtools.build.lib.skyframe.ConfigurationsForTargetsTest}. But that's a Skyframe test
+ * (ConfiguredTargetFunction is a Skyframe function). And the Skyframe library doesn't know anything
+ * about latebound attributes. So we need to place these properly under the analysis package.
*/
+@TestOnlyInNormalExecutionMode // TODO(b/67651960): fix or justify disabling.
@TestSpec(size = Suite.SMALL_TESTS)
@RunWith(JUnit4.class)
public class ConfigurationsForLateBoundTargetsTest extends AnalysisTestCase {
diff --git a/src/test/java/com/google/devtools/build/lib/testutil/TestOnlyInNormalExecutionMode.java b/src/test/java/com/google/devtools/build/lib/testutil/TestOnlyInNormalExecutionMode.java
new file mode 100644
index 0000000000..3c2c14b5ae
--- /dev/null
+++ b/src/test/java/com/google/devtools/build/lib/testutil/TestOnlyInNormalExecutionMode.java
@@ -0,0 +1,22 @@
+// Copyright 2017 The Bazel Authors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package com.google.devtools.build.lib.testutil;
+
+/**
+ * Annotation interface to prevent a test case from being executed in a special internal mode. This
+ * only applies to whole test classes, not individual methods. For individual methods, test on the
+ * case's {@code TestConstants#InternalTestExecutionMode}.
+ */
+public @interface TestOnlyInNormalExecutionMode {}