Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests(devtools): skip type checking in local builds #15858

Merged
merged 1 commit into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions core/scripts/build-devtools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ set -euo pipefail
# 1) Builds Lighthouse bundle for DevTools
# 2) Rolls to local devtools repo. By default, this is the temporary checkout in .tmp
# 3) Builds devtools frontend with new Lighthouse roll
#
#
# Run `bash core/test/devtools-tests/setup.sh` first to update the temporary devtools checkout.
# Specify `$DEVTOOLS_PATH` to use a different devtools repo.
# Specify `$BUILD_FOLDER` to use a build other than 'LighthouseIntegration' (ex: Default).
Expand All @@ -22,6 +22,7 @@ TEST_DIR="$LH_ROOT/.tmp/chromium-web-tests"
DEFAULT_DEVTOOLS_PATH="$TEST_DIR/devtools/devtools-frontend"
DEVTOOLS_PATH=${DEVTOOLS_PATH:-"$DEFAULT_DEVTOOLS_PATH"}
BUILD_FOLDER="${BUILD_FOLDER:-LighthouseIntegration}"
CI="${CI:-}"

echo "DEVTOOLS_PATH: $DEVTOOLS_PATH"

Expand All @@ -43,10 +44,10 @@ fi
yarn devtools "$DEVTOOLS_PATH"

cd "$DEVTOOLS_PATH"
if git config user.email | grep -q '@google.com'; then
gn gen "out/$BUILD_FOLDER" --args='devtools_dcheck_always_on=true is_debug=false use_goma=true'
else
if [[ "$CI" ]]; then
gn gen "out/$BUILD_FOLDER" --args='devtools_dcheck_always_on=true is_debug=false'
else
gn gen "out/$BUILD_FOLDER" --args='devtools_dcheck_always_on=true is_debug=false devtools_skip_typecheck=true'
fi
gclient sync
autoninja -C "out/$BUILD_FOLDER"
7 changes: 4 additions & 3 deletions core/test/devtools-tests/download-devtools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ set -euxo pipefail
##

BUILD_FOLDER="${BUILD_FOLDER:-LighthouseIntegration}"
CI="${CI:-}"

if [ -d "$DEVTOOLS_PATH" ]
then
Expand All @@ -34,8 +35,8 @@ cd `dirname $DEVTOOLS_PATH`
fetch --nohooks --no-history devtools-frontend
cd devtools-frontend
gclient sync
if git config user.email | grep -q '@google.com'; then
gn gen "out/$BUILD_FOLDER" --args='devtools_dcheck_always_on=true is_debug=false use_goma=true'
else
if [[ "$CI" ]]; then
gn gen "out/$BUILD_FOLDER" --args='devtools_dcheck_always_on=true is_debug=false'
else
gn gen "out/$BUILD_FOLDER" --args='devtools_dcheck_always_on=true is_debug=false devtools_skip_typecheck=true'
fi
7 changes: 4 additions & 3 deletions core/test/devtools-tests/roll-devtools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ set -euo pipefail
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
LH_ROOT="$SCRIPT_DIR/../../.."
BUILD_FOLDER="${BUILD_FOLDER:-LighthouseIntegration}"
CI="${CI:-}"

roll_devtools() {
# Roll devtools. Besides giving DevTools the latest lighthouse source files,
Expand All @@ -29,10 +30,10 @@ roll_devtools
# `yarn devtools` deleted.
gclient sync --delete_unversioned_trees --reset

if git config user.email | grep -q '@google.com'; then
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please replace this with the new remote option instead of removing.

Copy link
Member Author

@adamraine adamraine Mar 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure DT frontend can be built on reclient (TBH I don't know if it was every working with goma either)

Following the Chromium instructions for reclient leads to build issues talking about a missing reclient config :/

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❯❯❯ gn args out/Default
Waiting for editor on "/Users/asraine/src/devtools/devtools-frontend/out/Default/args.gn"...
Generating files...
ERROR at //build/toolchain/rbe.gni:58:3: Script returned non-zero exit code.
  exec_script(rebase_path("//build/toolchain/check_rewrapper_cfg.py"),
  ^----------
Current dir: /Users/asraine/src/devtools/devtools-frontend/out/Default/
Command: python3 /Users/asraine/src/devtools/devtools-frontend/build/toolchain/check_rewrapper_cfg.py ../../buildtools/reclient_cfgs/chromium-browser-clang/rewrapper_mac.cfg
Returned 1.
stderr:

reclient config file '/Users/asraine/src/devtools/devtools-frontend/buildtools/reclient_cfgs/chromium-browser-clang/rewrapper_mac.cfg' doesn't exist

To build with gn arg 'use_remoteexec=true' as a googler on a corp machine
set "download_remoteexec_cfg" in .gclient like

solutions = [
    {
        "name"        : "src",
        # ...
        "custom_vars" : {
            "download_remoteexec_cfg": True,
        },
    },
]

and re-run `gclient sync`.

See http://go/chrome-linux-build#setup-remote-execution
for more details.

See //third_party/typescript/typescript.gni:5:1: whence it was imported.
import("//build/toolchain/rbe.gni")
^---------------------------------
See //BUILD.gn:11:1: whence it was imported.
import("./third_party/typescript/typescript.gni")
^-----------------------------------------------

gn gen "out/$BUILD_FOLDER" --args='devtools_dcheck_always_on=true is_debug=false use_goma=true'
else
if [[ "$CI" ]]; then
gn gen "out/$BUILD_FOLDER" --args='devtools_dcheck_always_on=true is_debug=false'
else
gn gen "out/$BUILD_FOLDER" --args='devtools_dcheck_always_on=true is_debug=false devtools_skip_typecheck=true'
fi

# Build devtools. By default, this creates `out/LighthouseIntegration/gen/front_end`.
Expand Down
Loading