From 5599a0eb3d91ff7778acc79a3c4650220f26f2c0 Mon Sep 17 00:00:00 2001 From: Ben McIlwain Date: Mon, 1 Jun 2026 15:11:05 -0400 Subject: [PATCH] Add buildAll task and fix fragile builds (#3077) This commit adds the buildAll task to restore the existence of a target that builds everything, which was unintentionally removed when the default build was stripped down in PR #3068. It also introduces necessary sequential constraints to the console-webapp build tasks to prevent parallel execution from corrupting the Angular CLI cache. Finally, it addresses paths for the newer Angular esbuild output and hardens the style injection in ConsoleScreenshotTest to prevent fragile test failures. --- build.gradle | 12 ++++++++++++ console-webapp/build.gradle | 8 ++++++++ .../google/registry/server/RegistryTestServer.java | 2 +- .../registry/webdriver/ConsoleScreenshotTest.java | 4 +++- 4 files changed, 24 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index d066f7873..7c8b51fb2 100644 --- a/build.gradle +++ b/build.gradle @@ -609,3 +609,15 @@ gradle.taskGraph.whenReady { graph -> } } } + +task buildAll { + group = 'build' + description = 'Runs the standard build plus all heavy staging/Docker dependencies and fragile tests that were stripped out of the default build for performance.' + dependsOn build + dependsOn ':core:fragileTest' + dependsOn ':core:sqlIntegrationTest' + dependsOn ':core:buildToolImage' + dependsOn ':stage' + dependsOn ':jetty:buildNomulusImage' + dependsOn ':console-webapp:buildConsoleForAll' +} diff --git a/console-webapp/build.gradle b/console-webapp/build.gradle index 24f788739..2a47ed708 100644 --- a/console-webapp/build.gradle +++ b/console-webapp/build.gradle @@ -74,6 +74,14 @@ def createConsoleTask = { env -> createConsoleTask(env) } +// Force an order so we don't run these tasks in parallel. +tasks.buildConsoleForCrash.mustRunAfter(tasks.buildConsoleForAlpha) +tasks.buildConsoleForQa.mustRunAfter(tasks.buildConsoleForCrash) +tasks.buildConsoleForSandbox.mustRunAfter(tasks.buildConsoleForQa) +tasks.buildConsoleForProduction.mustRunAfter(tasks.buildConsoleForSandbox) +// This task must run last, otherwise the previous tasks will have deleted the "dist" folder. +tasks.buildConsoleWebapp.mustRunAfter(tasks.buildConsoleForProduction) + task applyFormatting(type: Exec) { workingDir "${consoleDir}/" executable 'npm' diff --git a/core/src/test/java/google/registry/server/RegistryTestServer.java b/core/src/test/java/google/registry/server/RegistryTestServer.java index 89c2a42f0..700b60f50 100644 --- a/core/src/test/java/google/registry/server/RegistryTestServer.java +++ b/core/src/test/java/google/registry/server/RegistryTestServer.java @@ -33,7 +33,7 @@ public final class RegistryTestServer { public static final ImmutableMap RUNFILES = new ImmutableMap.Builder() - .put("/console/*", PROJECT_ROOT.resolve("console-webapp/staged/dist")) + .put("/console/*", PROJECT_ROOT.resolve("console-webapp/staged/dist/browser")) .build(); public static final ImmutableList ROUTES = diff --git a/core/src/test/java/google/registry/webdriver/ConsoleScreenshotTest.java b/core/src/test/java/google/registry/webdriver/ConsoleScreenshotTest.java index d57eb7efe..7663134e2 100644 --- a/core/src/test/java/google/registry/webdriver/ConsoleScreenshotTest.java +++ b/core/src/test/java/google/registry/webdriver/ConsoleScreenshotTest.java @@ -174,7 +174,9 @@ public class ConsoleScreenshotTest { // Script that set cursor to transparent to prevent blanking cursor flakiness when comparing // screenshots String script = - "document.styleSheets[0].insertRule(\"html * {caret-color: transparent !important;}\")"; + "var style = document.createElement('style');" + + "style.innerHTML = 'html * {caret-color: transparent !important;}';" + + "document.head.appendChild(style);"; driver.executeScript(script); }