FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
angular/integration/index.bzl at v21.2.24 · angular/angular · GitHub
angular
angular
Repository navigation
Code
Issues
895
(895)
Pull requests
165
(165)
Discussions
Actions
Projects
Security and quality
39
(39)
Insights
Expand file tree
Breadcrumbs
angular
/
integration
/
index.bzl
Copy path
More file actions
More file actions
Latest commit
History
History
History
82 lines (74 loc) · 2.97 KB
Breadcrumbs
angular
/
integration
/
index.bzl
Copy path
File metadata and controls
82 lines (74 loc) · 2.97 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
# Copyright Google LLC All Rights Reserved.
#
# Use of this source code is governed by an MIT-style license that can be
# found in the LICENSE file at https://angular.dev/license
"""Angular integration testing
"""
load
(
"@devinfra//bazel/integration:index.bzl"
,
"integration_test"
)
load
(
"//:packages.bzl"
,
"INTEGRATION_PACKAGES"
)
def
_ng_integration_test
(
name
,
setup_chromium
=
False
,
**
kwargs
):
"Set defaults for the npm_integration_test common to the angular repo"
toolchains
=
kwargs
.
pop
(
"toolchains"
, [])
environment
=
kwargs
.
pop
(
"environment"
, {})
data
=
kwargs
.
pop
(
"data"
, [])
if
setup_chromium
:
data
.
append
(
"@rules_browsers//browsers/chromium"
)
toolchains
.
append
(
"@rules_browsers//browsers/chromium:toolchain_alias"
)
environment
.
update
({
"CHROMEDRIVER_BIN"
:
"$(CHROMEDRIVER)"
,
"CHROME_BIN"
:
"$(CHROME-HEADLESS-SHELL)"
,
})
# By default run `pnpm install` followed by `pnpm test` using the tools linked
# into the integration tests (using the `tool_mappings` attribute).
commands
=
kwargs
.
pop
(
"commands"
, [
"pnpm install"
,
"pnpm run test"
,
])
# Complete list of npm packages to override in the test's package.json file mapped to
# tgz archive to use for the replacement. This is the full list for all integration
# tests. Any given integration does not need to use all of these packages.
npm_packages
=
{}
for
pkg
in
INTEGRATION_PACKAGES
:
npm_packages
[
"//:node_modules/%s/dir"
%
pkg
]
=
pkg
integration_test
(
name
=
name
,
commands
=
commands
,
npm_packages
=
npm_packages
,
tags
=
kwargs
.
pop
(
"tags"
, [])
+
[
# `integration` tag is used for filtering out these tests from the normal
# developer workflow
"integration"
,
# Integration tests do not work inside of a sandbox as they may run host applications such
# as chrome (which is run by ng) that require access to files outside of the sandbox.
"no-sandbox"
,
],
data
=
data
,
environment
=
environment
,
toolchains
=
toolchains
,
tool_mappings
=
{
"@pnpm//:pnpm"
:
"pnpm"
,
"@nodejs_toolchains//:resolved_toolchain"
:
"node"
,
},
# 15-minute timeout
timeout
=
"long"
,
# Tells bazel that this test should be allocated a large amount of memory.
# See https://docs.bazel.build/versions/2.0.0/be/common-definitions.html#common-attributes-tests.
size
=
"enormous"
,
**
kwargs
)
def
ng_integration_test
(
name
,
**
kwargs
):
"Sets up the integration test target based on the test folder name"
native
.
filegroup
(
name
=
"_%s_sources"
%
name
,
srcs
=
native
.
glob
(
include
=
[
"**/*"
],
exclude
=
[
"node_modules/**"
,
],
),
)
_ng_integration_test
(
name
=
name
,
srcs
=
kwargs
.
pop
(
"srcs"
, [
"_%s_sources"
%
name
]),
**
kwargs
)
Back
|
FazBrowse Home
|
New Git URL