diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index fffd97e3f6..c6a7fea0c0 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -53,9 +53,10 @@ tasks: skip_use_bazel_version_for_test: true test_flags: - "--test_tag_filters=e2e" - - "--local_resources=792,1.0,1.0" + - "--local_ram_resources=792" # test_args will be passed to the nested bazel process - - "--test_arg=--local_resources=13288,7.0,1.0" + - "--test_arg=--local_ram_resources=13288" + - "--test_arg=--local_cpu_resources=7" # Both chrome & firefox are missing shared libs on bazelci ubuntu. # On circleci we have the same issue but we can work around it using apt-get. # on bazelci apt-get fails with permission denied and there is no sudo @@ -83,9 +84,10 @@ tasks: skip_use_bazel_version_for_test: true test_flags: - "--test_tag_filters=examples" - - "--local_resources=792,1.0,1.0" + - "--local_ram_resources=792" # test_args will be passed to the nested bazel process - - "--test_arg=--local_resources=13288,7.0,1.0" + - "--test_arg=--local_ram_resources=13288" + - "--test_arg=--local_cpu_resources=7" # Both chrome & firefox are missing shared libs on bazelci ubuntu. # On circleci we have the same issue but we can work around it using apt-get. # on bazelci apt-get fails with permission denied and there is no sudo @@ -166,9 +168,10 @@ tasks: skip_use_bazel_version_for_test: true test_flags: - "--test_tag_filters=e2e" - - "--local_resources=792,1.0,1.0" + - "--local_ram_resources=792" # test_args will be passed to the nested bazel process - - "--test_arg=--local_resources=13288,7.0,1.0" + - "--test_arg=--local_ram_resources=13288" + - "--test_arg=--local_cpu_resources=7" # Both chrome & firefox are missing shared libs on bazelci ubuntu. # On circleci we have the same issue but we can work around it using apt-get. # on bazelci apt-get fails with permission denied and there is no sudo @@ -196,9 +199,10 @@ tasks: skip_use_bazel_version_for_test: true test_flags: - "--test_tag_filters=examples" - - "--local_resources=792,1.0,1.0" + - "--local_ram_resources=792" # test_args will be passed to the nested bazel process - - "--test_arg=--local_resources=13288,7.0,1.0" + - "--test_arg=--local_ram_resources=13288" + - "--test_arg=--local_cpu_resources=7" # Both chrome & firefox are missing shared libs on bazelci ubuntu. # On circleci we have the same issue but we can work around it using apt-get. # on bazelci apt-get fails with permission denied and there is no sudo @@ -289,10 +293,10 @@ tasks: skip_use_bazel_version_for_test: true test_flags: - "--test_tag_filters=e2e" - - "--local_resources=792,1.0,1.0" + - "--local_ram_resources=792" # test_args will be passed to the nested bazel process # TODO(gregmagolan): fix frequent flake with multiple cores in nested bazel (osx buildkite & local) - - "--test_arg=--local_resources=13288,1.0,1.0" + - "--test_arg=--local_ram_resources=13288" # Firefox are missing shared libs on bazelci mac # TODO(gregmagolan): figure out how to install missing shared libs - "--test_arg=--test_tag_filters=-manual,-browser:firefox-local" @@ -317,10 +321,10 @@ tasks: skip_use_bazel_version_for_test: true test_flags: - "--test_tag_filters=examples,-manual" - - "--local_resources=792,1.0,1.0" + - "--local_ram_resources=792" # test_args will be passed to the nested bazel process # TODO(gregmagolan): fix frequent flake with multiple cores in nested bazel (osx buildkite & local) - - "--test_arg=--local_resources=13288,1.0,1.0" + - "--test_arg=--local_ram_resources=13288" # Firefox are missing shared libs on bazelci mac # TODO(gregmagolan): figure out how to install missing shared libs - "--test_arg=--test_tag_filters=-no-bazelci-mac,-manual,-browser:firefox-local" @@ -393,9 +397,9 @@ tasks: skip_use_bazel_version_for_test: true test_flags: - "--test_tag_filters=e2e,-fix-windows" - - "--local_resources=792,1.0,1.0" + - "--local_ram_resources=792" # test_args will be passed to the nested bazel process - - "--test_arg=--local_resources=13288,1.0,1.0" + - "--test_arg=--local_ram_resources=13288" # Firefox not supported on Windows with rules_webtesting (if run it exit with success) # See https://github.com/bazelbuild/rules_webtesting/blob/0.3.3/browsers/BUILD.bazel#L66. # Chrome fails to launch on Windows inside bazel-in-bazel with: [17:12:04] E/launcher - @@ -414,9 +418,9 @@ tasks: skip_use_bazel_version_for_test: true test_flags: - "--test_tag_filters=examples,-manual,-fix-windows,-no-bazelci-windows" - - "--local_resources=792,1.0,1.0" + - "--local_ram_resources=792" # test_args will be passed to the nested bazel process - - "--test_arg=--local_resources=13288,1.0,1.0" + - "--test_arg=--local_ram_resources=13288" # Firefox not supported on Windows with rules_webtesting (if run it exit with success) # See https://github.com/bazelbuild/rules_webtesting/blob/0.3.3/browsers/BUILD.bazel#L66. # Chrome fails to launch on Windows inside bazel-in-bazel with: [17:12:04] E/launcher - diff --git a/.circleci/bazel.rc b/.circleci/bazel.rc index 6465bbbbfa..ea3fb904dc 100644 --- a/.circleci/bazel.rc +++ b/.circleci/bazel.rc @@ -13,7 +13,8 @@ build --announce_rc # Bazel doesn't calculate the memory ceiling correctly when running under Docker. # Limit Bazel to consuming resources that fit in CircleCI "xlarge" class # https://circleci.com/docs/2.0/configuration-reference/#resource_class -build --local_resources=14336,8.0,1.0 +build --local_ram_resources=14336 +build --local_cpu_resources=8 # Our integration tests rely on accessing public registries which can fail # Let's give all failing tests a second try to mostly paper over flakiness diff --git a/.circleci/config.yml b/.circleci/config.yml index 3604af7759..2703fecf4d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -182,7 +182,7 @@ jobs: # to build the release package with this configuration. - run: bazel build --build_tag_filters=e2e ... - run: - command: bazel test --test_tag_filters=e2e --local_resources=792,1.0,1.0 --test_arg=--local_resources=13288,7.0,1.0 --test_arg=--test_tag_filters=-manual ... + command: bazel test --test_tag_filters=e2e --local_ram_resources=792 --test_arg=--local_ram_resources=13288 --test_arg=--local_cpu_resources=7 --test_arg=--test_tag_filters=-manual ... no_output_timeout: 20m test_examples: @@ -213,13 +213,13 @@ jobs: - run: bazel build --build_tag_filters=examples ... - run: # We don't have java installed on our circleci docker image - command: bazel test --test_tag_filters=examples,-requires-java --local_resources=792,1.0,1.0 --test_arg=--local_resources=13288,7.0,1.0 --test_arg=--test_tag_filters=-manual ... + command: bazel test --test_tag_filters=examples,-requires-java --local_ram_resources=792 --test_arg=--local_ram_resources=13288 --test_arg=--local_cpu_resources=7 --test_arg=--test_tag_filters=-manual ... no_output_timeout: 20m # The following examples only works on linux as it downloads the linux node distribution # It is tagged "manual" so we run it explicitly here # TODO(gregmagolan): make node_repositories acccept different archives for different platforms - run: - command: bazel test --local_resources=792,1.0,1.0 --test_arg=--local_resources=13288,7.0,1.0 //examples:examples_vendored_node //examples:examples_vendored_node_and_yarn + command: bazel test --local_ram_resources=792 --test_arg=--local_ram_resources=13288 --test_arg=--local_cpu_resources=7 //examples:examples_vendored_node //examples:examples_vendored_node_and_yarn no_output_timeout: 20m test_user_managed_deps: diff --git a/DEVELOPING.md b/DEVELOPING.md index 9016310ac2..4ba51a1ab0 100644 --- a/DEVELOPING.md +++ b/DEVELOPING.md @@ -8,9 +8,9 @@ This repository contains nested workspaces which are tested with the bazel-in-ba `bazel test ...` includes all these integration tests so if you want to run all tests except the integration tests you can use `bazel test ... --test_tag_filters=-e2e,-examples`. A shortcut for this is `yarn test`. -When running the e2e tests, it is recommended to tune the memory usage of Bazel locally. This can be done with `bazel --host_jvm_args=-Xms256m --host_jvm_args=-Xmx1280m test ... --test_tag_filters=e2e --local_resources=792,1.0,1.0 --test_arg=--local_resources=13288,1.0,1.0`. A shortcut for this is `yarn test_e2e`. +When running the e2e tests, it is recommended to tune the memory usage of Bazel locally. This can be done with `bazel --host_jvm_args=-Xms256m --host_jvm_args=-Xmx1280m test ... --test_tag_filters=e2e --local_ram_resources=792 --test_arg=--local_ram_resources=13288`. A shortcut for this is `yarn test_e2e`. -Similarly, for test examples run `bazel --host_jvm_args=-Xms256m --host_jvm_args=-Xmx1280m test ... --test_tag_filters=examples --local_resources=792,1.0,1.0 --test_arg=--local_resources=13288,1.0,1.0`. A shortcut for this is `yarn test_examples`. +Similarly, for test examples run `bazel --host_jvm_args=-Xms256m --host_jvm_args=-Xmx1280m test ... --test_tag_filters=examples --local_ram_resources=792 --test_arg=--local_ram_resources=13288`. A shortcut for this is `yarn test_examples`. To test all targets locally in the main workspace and in all nested workspaces run: diff --git a/package.json b/package.json index b5160e16e2..96c90b0c01 100644 --- a/package.json +++ b/package.json @@ -82,9 +82,9 @@ "scripts": { "test": "bazelisk test --test_tag_filters=-e2e,-examples,-manual,-browser:firefox-local", "test_windows": "bazelisk test --test_tag_filters=-e2e,-examples,-fix-windows,-manual,-browser:firefox-local", - "test_e2e": "bazelisk --host_jvm_args=-Xms256m --host_jvm_args=-Xmx1280m test --test_tag_filters=e2e --local_resources=792,1.0,1.0 --test_arg=--local_resources=13288,1.0,1.0", - "test_examples": "bazelisk --host_jvm_args=-Xms256m --host_jvm_args=-Xmx1280m test --test_tag_filters=examples --local_resources=792,1.0,1.0 --test_arg=--local_resources=13288,1.0,1.0", - "run_integration_test": "bazelisk --host_jvm_args=-Xms256m --host_jvm_args=-Xmx1280m run --local_resources=792,1.0,1.0 --test_arg=--local_resources=13288,1.0,1.0", + "test_e2e": "bazelisk --host_jvm_args=-Xms256m --host_jvm_args=-Xmx1280m test --test_tag_filters=e2e --local_ram_resources=792 --test_arg=--local_ram_resources=13288", + "test_examples": "bazelisk --host_jvm_args=-Xms256m --host_jvm_args=-Xmx1280m test --test_tag_filters=examples --local_ram_resources=792 --test_arg=--local_ram_resources=13288", + "run_integration_test": "bazelisk --host_jvm_args=-Xms256m --host_jvm_args=-Xmx1280m run --local_ram_resources=792 --test_arg=--local_ram_resources=13288", "run_integration_test_debug": "yarn run_integration_test --define=BAZEL_INTEGRATION_TEST_DEBUG=1", "test_all": "./scripts/test_all.sh", "clean_all": "./scripts/clean_all.sh",