angular-cn/packages/zone.js/test/BUILD.bazel

326 lines
6.9 KiB
Python
Raw Normal View History

load("//tools:defaults.bzl", "jasmine_node_test", "ts_library")
load("//packages/zone.js/test:karma_test.bzl", "karma_test")
package(default_visibility = ["//:__pkg__"])
exports_files([
"assets/sample.json",
"assets/worker.js",
"assets/import.html",
])
ts_library(
name = "common_spec_env",
testonly = True,
srcs = [
"test-env-setup-jasmine.ts",
"test_fake_polyfill.ts",
"wtf_mock.ts",
],
deps = [
"//packages/zone.js/lib",
],
)
ts_library(
name = "common_spec_srcs",
testonly = True,
srcs = glob(
[
"common/*.ts",
"zone-spec/*.ts",
"rxjs/*.ts",
],
exclude = [
"common/Error.spec.ts",
],
),
deps = [
":common_spec_util",
"//packages/zone.js/lib",
"@npm//rxjs",
],
)
ts_library(
name = "common_spec_util",
testonly = True,
srcs = ["test-util.ts"],
deps = [
"//packages/zone.js/lib",
],
)
ts_library(
name = "error_spec_srcs",
testonly = True,
srcs = [
"common/Error.spec.ts",
],
deps = [
":common_spec_util",
"//packages/zone.js/lib",
],
)
ts_library(
name = "test_node_lib",
testonly = True,
srcs = glob(["node/*.ts"]) + [
"node-env-setup.ts",
"test-env-setup-jasmine-no-patch-clock.ts",
],
deps = [
":common_spec_env",
":common_spec_srcs",
":common_spec_util",
"//packages/zone.js/lib",
"@npm//@types/shelljs",
"@npm//@types/systemjs",
"@npm//rxjs",
"@npm//shelljs",
"@npm//systemjs",
],
)
ts_library(
name = "node_entry_point",
testonly = True,
srcs = ["node_entry_point.ts"],
deps = [
":common_spec_env",
":common_spec_srcs",
":common_spec_util",
"//packages/zone.js/lib",
"@npm//@types/shelljs",
"@npm//@types/systemjs",
"@npm//rxjs",
"@npm//shelljs",
"@npm//systemjs",
],
)
ts_library(
name = "node_entry_point_no_patch_clock",
testonly = True,
srcs = ["node_entry_point_no_patch_clock.ts"],
deps = [
":common_spec_env",
":common_spec_srcs",
":common_spec_util",
"//packages/zone.js/lib",
"@npm//@types/shelljs",
"@npm//@types/systemjs",
"@npm//rxjs",
"@npm//shelljs",
"@npm//systemjs",
],
)
ts_library(
name = "bluebird_spec",
testonly = True,
srcs = [
"extra/bluebird.spec.ts",
],
deps = [
":common_spec_env",
"//packages/zone.js/lib",
"@npm//bluebird",
],
)
ts_library(
name = "node_bluebird_entry_point",
testonly = True,
srcs = ["node_bluebird_entry_point.ts"],
deps = [
":common_spec_env",
"//packages/zone.js/lib",
"@npm//bluebird",
],
)
ts_library(
name = "node_error_disable_policy_entry_point",
testonly = True,
srcs = ["node_error_disable_policy_entry_point.ts"],
deps = [
":common_spec_env",
":common_spec_util",
":error_spec_srcs",
":node_error_entry_point",
"//packages/zone.js/lib",
],
)
ts_library(
name = "node_error_entry_point",
testonly = True,
srcs = ["node_error_entry_point.ts"],
deps = [
":common_spec_env",
":common_spec_util",
":error_spec_srcs",
"//packages/zone.js/lib",
],
)
ts_library(
name = "node_error_lazy_policy_entry_point",
testonly = True,
srcs = ["node_error_lazy_policy_entry_point.ts"],
deps = [
":common_spec_env",
":common_spec_util",
":error_spec_srcs",
":node_error_entry_point",
"//packages/zone.js/lib",
],
)
jasmine_node_test(
name = "test_node",
bootstrap = [":node_entry_point_es5"],
deps = [
":test_node_lib",
],
)
jasmine_node_test(
name = "test_node_no_jasmine_clock",
bootstrap = [":node_entry_point_no_patch_clock_es5"],
deps = [
":test_node_lib",
],
)
jasmine_node_test(
name = "test_node_bluebird",
bootstrap = [":node_bluebird_entry_point_es5"],
deps = [
":bluebird_spec",
],
)
jasmine_node_test(
name = "test_node_error_disable_policy",
bootstrap = [":node_error_disable_policy_entry_point_es5"],
)
jasmine_node_test(
name = "test_node_error_lazy_policy",
bootstrap = [":node_error_lazy_policy_entry_point_es5"],
)
ts_library(
name = "npm_package_spec_lib",
testonly = True,
srcs = ["npm_package/npm_package.spec.ts"],
deps = [
build: fix build failures with worker mode cache and @types/events (#31325) Errors observed only in tests on CircleCI — was not reproducible locally. ``` ERROR: /home/circleci/ng/packages/http/test/BUILD.bazel:3:1: Compiling TypeScript (devmode) //packages/http/test:test_lib failed (Exit 1): tsc_wrapped failed: error executing command (cd /home/circleci/.cache/bazel/_bazel_circleci/9ce5c2144ecf75d11717c0aa41e45a8d/execroot/angular && \ exec env - \ BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1 \ PATH=/bin:/usr/bin:/usr/local/bin \ bazel-out/host/bin/external/npm/@bazel/typescript/bin/tsc_wrapped @@bazel-out/k8-fastbuild/bin/packages/http/test/test_lib_es5_tsconfig.json) Execution platform: //tools:rbe_ubuntu1604-angular Compilation failed Error: missing input digest for /home/circleci/.cache/bazel/_bazel_circleci/9ce5c2144ecf75d11717c0aa41e45a8d/execroot/angular/external/npm/node_modules/@types/events/index.d.ts. ERROR: /home/circleci/ng/packages/benchpress/test/BUILD.bazel:3:1: Compiling TypeScript (devmode) //packages/benchpress/test:test_lib failed (Exit 1): tsc_wrapped failed: error executing command (cd /home/circleci/.cache/bazel/_bazel_circleci/9ce5c2144ecf75d11717c0aa41e45a8d/execroot/angular && \ exec env - \ BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1 \ PATH=/bin:/usr/bin:/usr/local/bin \ bazel-out/host/bin/external/npm/@bazel/typescript/bin/tsc_wrapped @@bazel-out/k8-fastbuild/bin/packages/benchpress/test/test_lib_es5_tsconfig.json) Execution platform: //tools:rbe_ubuntu1604-angular Compilation failed Error: missing input digest for /home/circleci/.cache/bazel/_bazel_circleci/9ce5c2144ecf75d11717c0aa41e45a8d/execroot/angular/external/npm/node_modules/@types/events/index.d.ts ERROR: C:/codefresh/volume/angular/packages/compiler/test/css_parser/BUILD.bazel:3:1: Compiling TypeScript (devmode) //packages/compiler/test/css_parser:css_parser_lib failed (Exit 1): tsc_wrapped.exe failed: error executing command cd C:/users/containeradministrator/_bazel_containeradministrator/zquin2l6/execroot/angular SET PATH=C:\msys64\usr\bin;C:\msys64\bin;C:\Windows;C:\Windows\System32;C:\Windows\System32\WindowsPowerShell\v1.0 SET RUNFILES_MANIFEST_ONLY=1 bazel-out/host/bin/external/npm/@bazel/typescript/bin/tsc_wrapped.exe @@bazel-out/x64_windows-fastbuild/bin/packages/compiler/test/css_parser/css_parser_lib_es5_tsconfig.json Execution platform: @bazel_tools//platforms:host_platform Compilation failed Error: missing input digest for C:/users/containeradministrator/_bazel_containeradministrator/zquin2l6/execroot/angular/external/npm/node_modules/@types/events/index. d.ts ``` PR Close #31325
2019-06-22 00:52:00 -04:00
"@npm//@types/shelljs",
],
)
jasmine_node_test(
name = "test_npm_package",
srcs = [":npm_package_spec_lib"],
data = [
"//packages/zone.js:npm_package",
"@npm//shelljs",
],
)
env_srcs = [
"browser-env-setup.ts",
"browser_symbol_setup.ts",
]
env_deps = [
":common_spec_env",
":common_spec_srcs",
":common_spec_util",
":error_spec_srcs",
"//packages/zone.js/lib",
"@npm//@types/shelljs",
"@npm//@types/systemjs",
"@npm//rxjs",
"@npm//shelljs",
"@npm//systemjs",
]
env_entry_point = ":browser-env-setup.ts"
test_srcs = glob(
["browser/*.ts"],
exclude = ["browser/shadydom.spec.ts"],
) + [
"extra/cordova.spec.ts",
"mocha-patch.spec.ts",
"jasmine-patch.spec.ts",
"common_tests.ts",
"browser_entry_point.ts",
]
test_deps = [
":common_spec_env",
":common_spec_srcs",
":common_spec_util",
":error_spec_srcs",
"//packages/zone.js/lib",
"@npm//@types/shelljs",
"@npm//@types/systemjs",
"@npm//rxjs",
"@npm//shelljs",
"@npm//systemjs",
]
test_entry_point = ":browser_entry_point.ts"
karma_tests = {
"browser_test": ["//packages/zone.js/dist:zone-testing-bundle.js"],
"browser_green_test": [
"//packages/zone.js/dist:zone-evergreen.js",
"//packages/zone.js/dist:zone-testing.js",
],
"browser_legacy_test": [
"//packages/zone.js/dist:zone-legacy.js",
"//packages/zone.js/dist:zone-evergreen.js",
"//packages/zone.js/dist:zone-testing.js",
],
}
karma_test(
name = "browser_test",
bootstraps = karma_tests,
ci = True,
env_deps = env_deps,
env_entry_point = env_entry_point,
env_srcs = env_srcs,
test_deps = test_deps,
test_entry_point = test_entry_point,
test_srcs = test_srcs,
)
karma_test(
name = "browser_shadydom",
bootstraps = {"browser_shadydom": [
"//packages/zone.js/dist:zone-testing-bundle.js",
"//packages/zone.js/dist:webapis-shadydom.js",
]},
ci = False,
env_deps = [
"//packages/zone.js/lib",
],
env_entry_point = ":browser_shadydom_setup.ts",
env_srcs = ["browser_shadydom_setup.ts"],
test_deps = [
"//packages/zone.js/lib",
],
test_entry_point = ":browser_shadydom_entry_point.ts",
test_srcs = [
"browser/shadydom.spec.ts",
"browser_shadydom_entry_point.ts",
],
)