build: polish up bazel karma saucelabs info tools/saucelabs/README.md (#35667)

PR Close #35667
This commit is contained in:
Greg Magolan 2020-02-25 09:43:23 -08:00 committed by Miško Hevery
parent 500e49f0ac
commit f9f44bf743
1 changed files with 23 additions and 8 deletions

View File

@ -6,17 +6,28 @@ Setup your `SAUCE_USERNAME`, `SAUCE_ACCESS_KEY` & `SAUCE_TUNNEL_IDENTIFIER` envi
To run tests use: To run tests use:
``` ``` bash
yarn bazel run //tools/saucelabs:sauce_service_setup yarn bazel run //tools/saucelabs:sauce_service_setup
yarn bazel test //path/to:saucelabs_test_target_1 --config=saucelabs [--config=ivy] yarn bazel test //path/to:saucelabs_test_target_1 --config=saucelabs [--config=ivy]
yarn bazel test //path/to:saucelabs_test_target_2 --config=saucelabs [--config=ivy] yarn bazel test //path/to:saucelabs_test_target_2 --config=saucelabs [--config=ivy]
``` ```
or if the tests are combined into a test suite: `bazel query` is required gather up all karma saucelabs test labels so they can be run in one command as they are tagged `manual`.
``` Running all ViewEngine karma tests in Saucelabs:
``` bash
yarn bazel run //tools/saucelabs:sauce_service_setup yarn bazel run //tools/saucelabs:sauce_service_setup
yarn bazel test //path/to:saucelabs_test_suite --config=saucelabs [--config=ivy] TESTS=$(./node_modules/.bin/bazel query --output label '(kind(karma_web_test, ...) intersect attr("tags", "saucelabs", ...)) except attr("tags", "ivy-only", ...) except attr("tags", "fixme-saucelabs-ve", ...)')
yarn bazel test --config=saucelabs ${TESTS}
```
Running all Ivy karma tests in Saucelabs:
``` bash
yarn bazel run //tools/saucelabs:sauce_service_setup
TESTS=$(./node_modules/.bin/bazel query --output label '(kind(karma_web_test, ...) intersect attr("tags", "saucelabs", ...)) except attr("tags", "no-ivy-aot", ...) except attr("tags", "fixme-saucelabs-ivy", ...)')
yarn bazel test --config=saucelabs --config=ivy ${TESTS}
``` ```
To see the test output while the tests are running as these are long tests, add the `--test_output=streamed` option. Note, this option will also prevent bazel from using the test cache and will force the test to run. To see the test output while the tests are running as these are long tests, add the `--test_output=streamed` option. Note, this option will also prevent bazel from using the test cache and will force the test to run.
@ -31,14 +42,16 @@ script which configures the saucelabs environment and starts Sauce Connect befor
For example, For example,
``` ``` python
karma_web_test( karma_web_test(
name = "saucelabs_core_acceptance_tests", name = "saucelabs_core_acceptance_tests",
timeout = "long", timeout = "long",
karma = "//tools/saucelabs:karma-saucelabs", karma = "//tools/saucelabs:karma-saucelabs",
tags = [ tags = [
"exclusive",
"manual", "manual",
"no-remote-exec", "no-remote-exec",
"saucelabs",
], ],
deps = [ deps = [
"//packages/core/test/acceptance:acceptance_lib", "//packages/core/test/acceptance:acceptance_lib",
@ -46,6 +59,8 @@ karma_web_test(
) )
``` ```
These saucelabs targets must be tagged `no-remote-exec` as they cannot be executed remotely since These saucelabs targets must have a few important tags:
they require a local Sauce Connect process. They should also be tagged `manual` so they are not * `no-remote-exec` as they cannot be executed remotely since they require a local Sauce Connect process
automatically tested with `//...`. * `manual` so they are not automatically tested with `//...`
* `exclusive` as they must be run serially in order to not over-provision Saucelabs browsers
* `saucelabs` so that they can be easily gathered up for testing in a `bazel query`