Skip to content

Commit

Permalink
chore: remove local_resources flag
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeagle committed Feb 10, 2020
1 parent d3c6f63 commit 693ed8a
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 25 deletions.
36 changes: 20 additions & 16 deletions .bazelci/presubmit.yml
Expand Up @@ -52,9 +52,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.0"
# 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
Expand Down Expand Up @@ -82,9 +83,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.0"
# 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
Expand Down Expand Up @@ -164,9 +166,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.0"
# 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
Expand Down Expand Up @@ -194,9 +197,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.0"
# 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
Expand Down Expand Up @@ -286,10 +290,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"
Expand All @@ -314,10 +318,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"
Expand Down Expand Up @@ -389,9 +393,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 -
Expand All @@ -410,9 +414,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 -
Expand Down
3 changes: 2 additions & 1 deletion .circleci/bazel.rc
Expand Up @@ -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.0

# 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
Expand Down
6 changes: 3 additions & 3 deletions .circleci/config.yml
Expand Up @@ -180,7 +180,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.0 --test_arg=--test_tag_filters=-manual ...
no_output_timeout: 20m

test_examples:
Expand Down Expand Up @@ -208,13 +208,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.0 --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.0 //examples:examples_vendored_node //examples:examples_vendored_node_and_yarn
no_output_timeout: 20m

test_user_managed_deps:
Expand Down
4 changes: 2 additions & 2 deletions DEVELOPING.md
Expand Up @@ -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:

Expand Down
6 changes: 3 additions & 3 deletions package.json
Expand Up @@ -79,9 +79,9 @@
"scripts": {
"test": "bazel test --test_tag_filters=-e2e,-examples,-manual,-browser:firefox-local",
"test_windows": "bazel test --test_tag_filters=-e2e,-examples,-fix-windows,-manual,-browser:firefox-local",
"test_e2e": "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",
"test_examples": "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",
"run_integration_test": "bazel --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": "bazel --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": "bazel --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": "bazel --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",
Expand Down

0 comments on commit 693ed8a

Please sign in to comment.