-
Notifications
You must be signed in to change notification settings - Fork 522
/
BUILD.bazel
267 lines (246 loc) · 10.1 KB
/
BUILD.bazel
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
# Copyright 2017 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
load(":test.bzl", "example_integration_test")
example_integration_test(
name = "examples_angular",
timeout = "long",
npm_packages = {
"//packages/esbuild:npm_package": "@bazel/esbuild",
"//packages/protractor:npm_package": "@bazel/protractor",
"//packages/rollup:npm_package": "@bazel/rollup",
"//packages/terser:npm_package": "@bazel/terser",
"//packages/typescript:npm_package": "@bazel/typescript",
},
owners = [
"@alan-agius4",
"@jbedard",
],
# bazel-in-bazel examples_angular fails on Windows on bazelci cloning a git repo:
# ```
# ERROR: no such package '@io_bazel_rules_k8s//k8s': Traceback (most recent call last):
# File "D:/b/ftxm343s/execroot/build_bazel_rules_nodejs/_tmp/3726d3573001cb4068a18af89eb255de/_bazel_b/ktluxf26/external/bazel_tools/tools/build_defs/repo/git.bzl", line 163
# _clone_or_update(ctx)
# File "D:/b/ftxm343s/execroot/build_bazel_rules_nodejs/_tmp/3726d3573001cb4068a18af89eb255de/_bazel_b/ktluxf26/external/bazel_tools/tools/build_defs/repo/git.bzl", line 36, in _clone_or_update
# git_repo(ctx, directory)
# ```
# This is most likely due to a memory issue with this large bazel-in-bazel test.
# TODO(gregmagolan): figure out what is broken with the above
tags = ["no-bazelci-windows"],
)
example_integration_test(
name = "examples_create-react-app",
npm_packages = {
"//packages/runfiles:npm_package": "@bazel/runfiles",
},
# TODO: figure out why this fails on Windows since setting
# symlink_node_modules to False in the test WORKSPACE
tags = ["no-bazelci-windows"],
)
example_integration_test(
name = "examples_react_webpack",
# TODO: add some tests in the example
bazel_commands = ["build ..."],
npm_packages = {
"//packages/typescript:npm_package": "@bazel/typescript",
},
# TODO(alexeagle): somehow this is broken by the new node-patches based node_patches script
# ERROR: D:/temp/tmp-6900sejcsrcttpdb/BUILD.bazel:37:1: output 'app.bundle.js' was not created
tags = ["no-bazelci-windows"],
)
example_integration_test(
name = "examples_app",
npm_packages = {
"//packages/concatjs:npm_package": "@bazel/concatjs",
"//packages/protractor:npm_package": "@bazel/protractor",
"//packages/rollup:npm_package": "@bazel/rollup",
"//packages/terser:npm_package": "@bazel/terser",
"//packages/typescript:npm_package": "@bazel/typescript",
},
)
example_integration_test(
name = "examples_toolchain",
repositories = {"//:release-core": "rules_nodejs"},
)
example_integration_test(
name = "examples_closure",
npm_packages = {
"//packages/runfiles:npm_package": "@bazel/runfiles",
},
# TODO: figure out why this fails on Windows since setting
# symlink_node_modules to False in the test WORKSPACE
tags = ["no-bazelci-windows"],
)
example_integration_test(
name = "examples_parcel",
# Parcel spawns a subprocess which requires our node-patches
# but we don't yet have a mechanism on Windows for spawned processes
# to inherit the --require script needed to install the patches
tags = ["no-bazelci-windows"],
)
example_integration_test(
name = "examples_cypress",
bazel_commands = ["test //..."],
npm_packages = {
"//packages/cypress:npm_package": "@bazel/cypress",
"//packages/typescript:npm_package": "@bazel/typescript",
},
owners = ["@mrmeku"],
tags = [
"cypress",
],
)
example_integration_test(
name = "examples_jest",
npm_packages = {
"//packages/typescript:npm_package": "@bazel/typescript",
},
owners = ["@mrmeku"],
tags = [
# ERROR: C:/users/b/_bazel_b/sbb5tpjc/external/npm/BUILD.bazel:5053:10: Copying directory external/npm/_/node_modules/jest-snapshot failed: (Exit 4): cmd.exe failed: error executing command cmd.exe /C bazel-out\x64_windows-fastbuild\bin\external\npm\node_modules\jest-snapshot--603629912-cmd.bat
# Insufficient memory
"no-bazelci-windows",
],
)
example_integration_test(
name = "examples_kotlin",
npm_packages = {
"//packages/jasmine:npm_package": "@bazel/jasmine",
"//packages/rollup:npm_package": "@bazel/rollup",
"//packages/terser:npm_package": "@bazel/terser",
},
tags = [
# Bintray was removed from the internet, and the version of
# kotlinx-html-js we depend on isn't mirrored anywhere else.
# See https://github.com/bazelbuild/rules_nodejs/issues/2747
"manual",
"no-circleci",
# Kotlin's kt_js_import relies on a helper written in Python
# https://github.com/bazelbuild/rules_kotlin/blob/master/kotlin/internal/js/importer.py
# but python isn't installed on BazelCI windows machines.
# Failure looks like
# [0 / 57] [Prepa] Expanding template external/io_bazel_rules_kotlin/kotlin/internal/js/importer.temp [for host]
# ERROR: D:/temp/tmp-67520fayqgbwmbgd/BUILD.bazel:10:1: Action kotlinx-html-js.js failed (Exit 2)
# LAUNCHER ERROR: Cannot launch process: "python.exe"
"no-bazelci-windows",
],
)
example_integration_test(
name = "examples_web_testing",
npm_packages = {
"//packages/concatjs:npm_package": "@bazel/concatjs",
"//packages/typescript:npm_package": "@bazel/typescript",
},
)
example_integration_test(
name = "examples_webapp",
bazel_commands = [
"info",
# enable runfiles explicitly so it is on for Windows since directory
# artifacts requires runfiles
"test ... --enable_runfiles",
],
npm_packages = {
"//packages/protractor:npm_package": "@bazel/protractor",
"//packages/rollup:npm_package": "@bazel/rollup",
"//packages/terser:npm_package": "@bazel/terser",
"//packages/typescript:npm_package": "@bazel/typescript",
},
)
example_integration_test(
name = "examples_nestjs",
bazel_commands = [
"test ...",
# Test cross-platform build
"build --platforms=@rules_nodejs//nodejs:linux_amd64 //src:docker",
],
npm_packages = {
"//packages/jasmine:npm_package": "@bazel/jasmine",
"//packages/typescript:npm_package": "@bazel/typescript",
},
owners = [
"@zachgrayio",
"@zMotivat0r",
"@rayman1104",
"@siberex",
],
# Fails on transitive dep of rules_docker
# error running 'git init C:/users/b/_bazel_b/3oe2yqkh/external/rules_cc' while working with @rules_cc:
# java.io.IOException: ERROR: src/main/native/windows/process.cc(199): CreateProcessW("git" init C:/users/b/_bazel_b/3oe2yqkh/external/rules_cc): The system cannot find the file specified
#
# NB: even after working around that by fetching rules_cc with an http_archive we get a follow-on failure
# ERROR: Analysis of target '//src:docker' failed; build aborted: no such package '@nodejs_image_base//image': Pull command failed: java.io.IOException: ERROR: src/main/native/windows/process.cc(199): CreateProcessW("C:\users\b\_bazel_b\vanuqgg3\external\go_puller_linux\file\downloaded" -directory C:/users/b/_bazel_b/vanuqgg3/external/nodejs_image_base/image -os linux -os-version "" -os-features "" -architecture amd64 -variant "" -features "" -name gcr.io/google-appengine/debian9@sha256:c05b781371f75d1bd7a199bc83de177173cc80c98dbfb6c1ef7075757addece4): %1 is not a valid Win32 application.
# (error: 193) (C:/users/b/_bazel_b/vanuqgg3/external/go_puller_linux/file/downloaded -directory
# C:/users/b/_bazel_b/vanuqgg3/external/nodejs_image_base/image -os linux -os-version -os-features -architecture amd64 -variant -features -name gcr.io/google-appengine/debian9@sha256:c05b781371f75d1bd7a199bc83de177173cc80c98dbfb6c1ef7075757addece4)
tags = ["no-bazelci-windows"],
)
example_integration_test(
name = "examples_protobufjs",
npm_packages = {
"//packages/jasmine:npm_package": "@bazel/jasmine",
"//packages/typescript:npm_package": "@bazel/typescript",
},
# Flakes on windows
# TODO: understand flake fail mode and re-enable
tags = ["no-bazelci-windows"],
)
example_integration_test(
name = "examples_vendored_node_and_yarn",
npm_packages = {
"//packages/jasmine:npm_package": "@bazel/jasmine",
},
# TODO: make it find node.exe rather than rely on us writing a .cmd wrapper
tags = ["no-bazelci-windows"],
)
example_integration_test(
name = "examples_vue",
npm_packages = {},
# TODO: figure out why this fails on Windows since setting
# symlink_node_modules to False in the test WORKSPACE
tags = ["no-bazelci-windows"],
)
example_integration_test(
name = "examples_worker",
# There are no tests in this example
bazel_commands = [
# By default this will build with worker enabled
"build //:do_work",
# Build again without the worker
"build --define=cache_bust=true --strategy=DoWork=standalone //:do_work",
],
npm_packages = {"//packages/worker:npm_package": "@bazel/worker"},
)
example_integration_test(
name = "examples_angular_bazel_architect",
timeout = "long",
bazel_commands = [
"test ...",
],
owners = [
"@alan-agius4",
"@jbedard",
],
tags = [
# TODO(alexeagle): re-enable when it stops timing out on 4.x branch
"manual",
],
)
example_integration_test(
name = "examples_esbuild",
timeout = "long",
npm_packages = {
"//packages/esbuild:npm_package": "@bazel/esbuild",
"//packages/typescript:npm_package": "@bazel/typescript",
},
owners = ["@mattem"],
)