From 13031e5b3bd7c8f29b96b2fee1b380160e0e27fc Mon Sep 17 00:00:00 2001 From: John Cater Date: Tue, 26 Jan 2021 13:30:46 -0800 Subject: [PATCH] Update SkyframeTests to not rely on filegroup not using toolchain resolution. Part of work on #12899. Closes #12907. PiperOrigin-RevId: 353937486 --- .../lib/skyframe/RegisteredExecutionPlatformsFunctionTest.java | 3 ++- .../build/lib/skyframe/ToolchainResolutionFunctionTest.java | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/test/java/com/google/devtools/build/lib/skyframe/RegisteredExecutionPlatformsFunctionTest.java b/src/test/java/com/google/devtools/build/lib/skyframe/RegisteredExecutionPlatformsFunctionTest.java index 96363200404593..32b5da41ac9217 100644 --- a/src/test/java/com/google/devtools/build/lib/skyframe/RegisteredExecutionPlatformsFunctionTest.java +++ b/src/test/java/com/google/devtools/build/lib/skyframe/RegisteredExecutionPlatformsFunctionTest.java @@ -221,7 +221,8 @@ public void testRegisteredExecutionPlatforms_targetPattern_flagOverride() throws @Test public void testRegisteredExecutionPlatforms_notExecutionPlatform() throws Exception { rewriteWorkspace("register_execution_platforms(", " '//error:not_an_execution_platform')"); - scratch.file("error/BUILD", "filegroup(name = 'not_an_execution_platform')"); + // Have to use a rule that doesn't require a target platform, or else there will be a cycle. + scratch.file("error/BUILD", "toolchain_type(name = 'not_an_execution_platform')"); // Request the executionPlatforms. SkyKey executionPlatformsKey = RegisteredExecutionPlatformsValue.key(targetConfigKey); diff --git a/src/test/java/com/google/devtools/build/lib/skyframe/ToolchainResolutionFunctionTest.java b/src/test/java/com/google/devtools/build/lib/skyframe/ToolchainResolutionFunctionTest.java index 3c2f0b64d4b626..7488bb4859720b 100644 --- a/src/test/java/com/google/devtools/build/lib/skyframe/ToolchainResolutionFunctionTest.java +++ b/src/test/java/com/google/devtools/build/lib/skyframe/ToolchainResolutionFunctionTest.java @@ -299,7 +299,8 @@ public void resolve_invalidHostPlatform() throws Exception { @Test public void resolve_invalidExecutionPlatform() throws Exception { - scratch.file("invalid/BUILD", "filegroup(name = 'not_a_platform')"); + // Have to use a rule that doesn't require a target platform, or else there will be a cycle. + scratch.file("invalid/BUILD", "toolchain_type(name = 'not_a_platform')"); useConfiguration("--extra_execution_platforms=//invalid:not_a_platform"); ToolchainContextKey key = ToolchainContextKey.key()