Skip to content

Commit f9f44bf

Browse files
gregmagolanmhevery
authored andcommitted
build: polish up bazel karma saucelabs info tools/saucelabs/README.md (angular#35667)
PR Close angular#35667
1 parent 500e49f commit f9f44bf

File tree

1 file changed

+22
-7
lines changed

1 file changed

+22
-7
lines changed

tools/saucelabs/README.md

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,28 @@ Setup your `SAUCE_USERNAME`, `SAUCE_ACCESS_KEY` & `SAUCE_TUNNEL_IDENTIFIER` envi
66

77
To run tests use:
88

9-
```
9+
``` bash
1010
yarn bazel run //tools/saucelabs:sauce_service_setup
1111
yarn bazel test //path/to:saucelabs_test_target_1 --config=saucelabs [--config=ivy]
1212
yarn bazel test //path/to:saucelabs_test_target_2 --config=saucelabs [--config=ivy]
1313
```
1414

15-
or if the tests are combined into a test suite:
15+
`bazel query` is required gather up all karma saucelabs test labels so they can be run in one command as they are tagged `manual`.
16+
17+
Running all ViewEngine karma tests in Saucelabs:
1618

19+
``` bash
20+
yarn bazel run //tools/saucelabs:sauce_service_setup
21+
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", ...)')
22+
yarn bazel test --config=saucelabs ${TESTS}
1723
```
24+
25+
Running all Ivy karma tests in Saucelabs:
26+
27+
``` bash
1828
yarn bazel run //tools/saucelabs:sauce_service_setup
19-
yarn bazel test //path/to:saucelabs_test_suite --config=saucelabs [--config=ivy]
29+
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", ...)')
30+
yarn bazel test --config=saucelabs --config=ivy ${TESTS}
2031
```
2132

2233
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,21 +42,25 @@ script which configures the saucelabs environment and starts Sauce Connect befor
3142

3243
For example,
3344

34-
```
45+
``` python
3546
karma_web_test(
3647
name = "saucelabs_core_acceptance_tests",
3748
timeout = "long",
3849
karma = "//tools/saucelabs:karma-saucelabs",
3950
tags = [
51+
"exclusive",
4052
"manual",
4153
"no-remote-exec",
54+
"saucelabs",
4255
],
4356
deps = [
4457
"//packages/core/test/acceptance:acceptance_lib",
4558
],
4659
)
4760
```
4861

49-
These saucelabs targets must be tagged `no-remote-exec` as they cannot be executed remotely since
50-
they require a local Sauce Connect process. They should also be tagged `manual` so they are not
51-
automatically tested with `//...`.
62+
These saucelabs targets must have a few important tags:
63+
* `no-remote-exec` as they cannot be executed remotely since they require a local Sauce Connect process
64+
* `manual` so they are not automatically tested with `//...`
65+
* `exclusive` as they must be run serially in order to not over-provision Saucelabs browsers
66+
* `saucelabs` so that they can be easily gathered up for testing in a `bazel query`

0 commit comments

Comments
 (0)