Skip to content

Commit 3bac870

Browse files
Daniel Mulleralexeagle
authored andcommitted
feat(cypress): add cypress_web_test rule and @bazel/cypress package
1 parent 6c81478 commit 3bac870

33 files changed

Lines changed: 9972 additions & 23 deletions

.bazelci/presubmit.yml

Lines changed: 41 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,17 @@ tasks:
2222
- "@bazel_workspace_b//subdir:bin"
2323
build_targets:
2424
- "//..."
25+
build_flags:
26+
# TODO(gregmagolan): figure out how to install missing shared libs
27+
# Without this filter the @cypress external repository will be built and that build will fail due to missing shared libs.
28+
- "--build_tag_filters=-cypress"
2529
test_flags:
2630
# Both chrome & firefox are missing shared libs on bazelci ubuntu.
2731
# On circleci we have the same issue but we can work around it using apt-get.
2832
# on bazelci apt-get fails with permission denied and there is no sudo
2933
# command to switch to root.
3034
# TODO(gregmagolan): figure out how to install missing shared libs
31-
- "--test_tag_filters=-e2e,-examples,-manual,-browser:chromium-local,-browser:firefox-local"
35+
- "--test_tag_filters=-e2e,-examples,-manual,-browser:chromium-local,-browser:firefox-local,-cypress"
3236
test_targets:
3337
- "//..."
3438
# //internal/node/test:nodejs_toolchain_linux_amd64_test is a "manual" test that must be run
@@ -46,7 +50,7 @@ tasks:
4650
shell_commands:
4751
- echo 'startup --host_jvm_args=-Xms256m --host_jvm_args=-Xmx1536m' >> .bazelrc
4852
build_flags:
49-
- "--build_tag_filters=e2e"
53+
- "--build_tag_filters=e2e,-cypress"
5054
build_targets:
5155
- "//..."
5256
# We control Bazel version in integration tests, so we don't need USE_BAZEL_VERSION for tests.
@@ -62,7 +66,7 @@ tasks:
6266
# on bazelci apt-get fails with permission denied and there is no sudo
6367
# command to switch to root.
6468
# TODO(gregmagolan): figure out how to install missing shared libs
65-
- "--test_arg=--test_tag_filters=-manual,-browser:chromium-local,-browser:firefox-local"
69+
- "--test_arg=--test_tag_filters=-manual,-browser:chromium-local,-browser:firefox-local,-cypress"
6670
test_targets:
6771
- "//..."
6872
ubuntu1604_examples:
@@ -77,13 +81,13 @@ tasks:
7781
shell_commands:
7882
- echo 'startup --host_jvm_args=-Xms256m --host_jvm_args=-Xmx1536m' >> .bazelrc
7983
build_flags:
80-
- "--build_tag_filters=examples"
84+
- "--build_tag_filters=examples,-cypress"
8185
build_targets:
8286
- "//..."
8387
# We control Bazel version in integration tests, so we don't need USE_BAZEL_VERSION for tests.
8488
skip_use_bazel_version_for_test: true
8589
test_flags:
86-
- "--test_tag_filters=examples"
90+
- "--test_tag_filters=examples,-cypress"
8791
- "--local_ram_resources=792"
8892
# test_args will be passed to the nested bazel process
8993
- "--test_arg=--local_ram_resources=13288"
@@ -93,7 +97,7 @@ tasks:
9397
# on bazelci apt-get fails with permission denied and there is no sudo
9498
# command to switch to root.
9599
# TODO(gregmagolan): figure out how to install missing shared libs
96-
- "--test_arg=--test_tag_filters=-manual,-browser:chromium-local,-browser:firefox-local"
100+
- "--test_arg=--test_tag_filters=-manual,-browser:chromium-local,-browser:firefox-local,-cypress"
97101
test_targets:
98102
- "//..."
99103
# The following examples only works on linux as it downloads the linux node distribution
@@ -120,6 +124,10 @@ tasks:
120124
- "@bazel_workspace_b//subdir:bin"
121125
build_targets:
122126
- "//..."
127+
build_flags:
128+
# TODO(gregmagolan): figure out how to install missing shared libs
129+
# Without this filter the @cypress external repository will be built and that build will fail due to missing shared libs.
130+
- "--build_tag_filters=-cypress"
123131
# This target is tagged "manual" but we want some CI
124132
# coverage of it to make sure it doesn't break.
125133
- "//docs"
@@ -129,7 +137,7 @@ tasks:
129137
# on bazelci apt-get fails with permission denied and there is no sudo
130138
# command to switch to root.
131139
# TODO(gregmagolan): figure out how to install missing shared libs
132-
- "--test_tag_filters=-e2e,-examples,-manual,-browser:chromium-local,-browser:firefox-local"
140+
- "--test_tag_filters=-e2e,-examples,-manual,-browser:chromium-local,-browser:firefox-local,-cypress"
133141
test_targets:
134142
- "//..."
135143
# //internal/node/test:nodejs_toolchain_linux_amd64_test is a "manual" test that must be run
@@ -138,6 +146,10 @@ tasks:
138146
ubuntu1804_debug:
139147
name: ubuntu1804_debug
140148
platform: ubuntu1804
149+
build_flags:
150+
# TODO(gregmagolan): figure out how to install missing shared libs
151+
# Without this filter the @cypress external repository will be built and that build will fail due to missing shared libs.
152+
- "--build_tag_filters=-cypress"
141153
test_flags:
142154
- "--compilation_mode=dbg"
143155
- "--define=VERBOSE_LOGS=1"
@@ -146,7 +158,7 @@ tasks:
146158
# on bazelci apt-get fails with permission denied and there is no sudo
147159
# command to switch to root.
148160
# TODO(gregmagolan): figure out how to install missing shared libs
149-
- "--test_tag_filters=-e2e,-examples,-manual,-browser:chromium-local,-browser:firefox-local"
161+
- "--test_tag_filters=-e2e,-examples,-manual,-browser:chromium-local,-browser:firefox-local,-cypress"
150162
test_targets:
151163
- "//..."
152164
ubuntu1804_e2e:
@@ -161,7 +173,7 @@ tasks:
161173
shell_commands:
162174
- echo 'startup --host_jvm_args=-Xms256m --host_jvm_args=-Xmx1536m' >> .bazelrc
163175
build_flags:
164-
- "--build_tag_filters=e2e"
176+
- "--build_tag_filters=e2e,-cypress"
165177
build_targets:
166178
- "//..."
167179
# We control Bazel version in integration tests, so we don't need USE_BAZEL_VERSION for tests.
@@ -177,7 +189,7 @@ tasks:
177189
# on bazelci apt-get fails with permission denied and there is no sudo
178190
# command to switch to root.
179191
# TODO(gregmagolan): figure out how to install missing shared libs
180-
- "--test_arg=--test_tag_filters=-manual,-browser:chromium-local,-browser:firefox-local"
192+
- "--test_arg=--test_tag_filters=-manual,-browser:chromium-local,-browser:firefox-local,-cypress"
181193
test_targets:
182194
- "//..."
183195
ubuntu1804_examples:
@@ -192,13 +204,13 @@ tasks:
192204
shell_commands:
193205
- echo 'startup --host_jvm_args=-Xms256m --host_jvm_args=-Xmx1536m' >> .bazelrc
194206
build_flags:
195-
- "--build_tag_filters=examples"
207+
- "--build_tag_filters=examples,-cypress"
196208
build_targets:
197209
- "//..."
198210
# We control Bazel version in integration tests, so we don't need USE_BAZEL_VERSION for tests.
199211
skip_use_bazel_version_for_test: true
200212
test_flags:
201-
- "--test_tag_filters=examples"
213+
- "--test_tag_filters=examples,-cypress"
202214
- "--local_ram_resources=792"
203215
# test_args will be passed to the nested bazel process
204216
- "--test_arg=--local_ram_resources=13288"
@@ -208,7 +220,7 @@ tasks:
208220
# on bazelci apt-get fails with permission denied and there is no sudo
209221
# command to switch to root.
210222
# TODO(gregmagolan): figure out how to install missing shared libs
211-
- "--test_arg=--test_tag_filters=-manual,-browser:chromium-local,-browser:firefox-local"
223+
- "--test_arg=--test_tag_filters=-manual,-browser:chromium-local,-browser:firefox-local,-cypress"
212224
test_targets:
213225
- "//..."
214226
# The following examples only works on linux as it downloads the linux node distribution
@@ -222,6 +234,9 @@ tasks:
222234
# Build on linux with the node --platform set to darwin
223235
build_flags:
224236
- "--platforms=@build_bazel_rules_nodejs//toolchains/node:darwin_amd64"
237+
# TODO(gregmagolan): figure out how to install missing shared libs
238+
# Without this filter the @cypress external repository will be built and that build will fail due to missing shared libs.
239+
- "--build_tag_filters=-cypress"
225240
build_targets:
226241
- "//internal/..."
227242
test_flags:
@@ -236,6 +251,9 @@ tasks:
236251
# Build on linux with the node --platform set to Windows
237252
build_flags:
238253
- "--platforms=@build_bazel_rules_nodejs//toolchains/node:windows_amd64"
254+
# TODO(gregmagolan): figure out how to install missing shared libs
255+
# Without this filter the @cypress external repository will be built and that build will fail due to missing shared libs.
256+
- "--build_tag_filters=-cypress"
239257
build_targets:
240258
- "//internal/..."
241259
test_flags:
@@ -380,7 +398,7 @@ tasks:
380398
test_flags:
381399
# Firefox not supported on Windows with rules_webtesting (if run it exit with success)
382400
# See https://github.com/bazelbuild/rules_webtesting/blob/0.3.3/browsers/BUILD.bazel#L66.
383-
- "--test_tag_filters=-e2e,-examples,-fix-windows,-manual,-browser:firefox-local"
401+
- "--test_tag_filters=-e2e,-examples,-fix-windows,-manual,-browser:firefox-local,-cypress"
384402
test_targets:
385403
- "//..."
386404
# //internal/node/test:nodejs_toolchain_windows_amd64_test is a "manual" test that must be run
@@ -417,15 +435,15 @@ tasks:
417435
# We control Bazel version in integration tests, so we don't need USE_BAZEL_VERSION for tests.
418436
skip_use_bazel_version_for_test: true
419437
test_flags:
420-
- "--test_tag_filters=examples,-manual,-fix-windows,-no-bazelci-windows"
438+
- "--test_tag_filters=examples,-manual,-fix-windows,-no-bazelci-windows,-cypress"
421439
- "--local_ram_resources=792"
422440
# test_args will be passed to the nested bazel process
423441
- "--test_arg=--local_ram_resources=13288"
424442
# Firefox not supported on Windows with rules_webtesting (if run it exit with success)
425443
# See https://github.com/bazelbuild/rules_webtesting/blob/0.3.3/browsers/BUILD.bazel#L66.
426444
# Chrome fails to launch on Windows inside bazel-in-bazel with: [17:12:04] E/launcher -
427445
# spawn D:\...\external\io_bazel_rules_webtesting\third_party\chromedriver\chromedriver.out\chromedriver_win32\chromedriver.exe ENOENT
428-
- "--test_arg=--test_tag_filters=-no-bazelci-windows,-fix-windows,-manual,-browser:chromium-local,-browser:firefox-local"
446+
- "--test_arg=--test_tag_filters=-no-bazelci-windows,-fix-windows,-manual,-browser:chromium-local,-browser:firefox-local,-cypress"
429447
test_targets:
430448
- "//..."
431449
windows_cross_compile_linux:
@@ -441,3 +459,10 @@ tasks:
441459
platform: rbe_ubuntu1604
442460
build_targets:
443461
- "//..."
462+
build_flags:
463+
# TODO(gregmagolan): figure out how to install missing shared libs
464+
# Without this filter the @cypress external repository will be built and that build will fail due to missing shared libs.
465+
- "--build_tag_filters=-cypress"
466+
test_flags:
467+
# TODO(gregmagolan): figure out how to install missing shared libs
468+
- "--test_arg=-cypress"

0 commit comments

Comments
 (0)