test: switch to ts_web_test_suite (#23859)

Unit tests now run on Firefox too

PR Close #23859
This commit is contained in:
Alex Eagle 2018-05-11 09:43:06 -07:00 committed by Alex Rickabaugh
parent 83631b28cb
commit 017d67cdf8
22 changed files with 46 additions and 39 deletions

View File

@ -13,9 +13,9 @@ http_archive(
http_archive(
name = "io_bazel_rules_webtesting",
url = "https://github.com/bazelbuild/rules_webtesting/archive/ca7b8062d9cf4ef2fde9193c7d37a0764c4262d7.zip",
strip_prefix = "rules_webtesting-ca7b8062d9cf4ef2fde9193c7d37a0764c4262d7",
sha256 = "28c73cf9d310fa6dba30e66bdb98071341c99c3feb8662f2d3883a632de97d72",
url = "https://github.com/bazelbuild/rules_webtesting/archive/cfcaaf98553fee8e7063b5f5c11fd1b77e43d683.zip",
strip_prefix = "rules_webtesting-cfcaaf98553fee8e7063b5f5c11fd1b77e43d683",
sha256 = "636c7a9ac2ca13a04d982c2f9c874876ecc90a7b9ccfe4188156122b26ada7b3",
)
http_archive(

View File

@ -1,4 +1,4 @@
load("//tools:defaults.bzl", "ts_library", "ts_web_test")
load("//tools:defaults.bzl", "ts_library", "ts_web_test_suite")
load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
ts_library(
@ -29,7 +29,7 @@ jasmine_node_test(
],
)
ts_web_test(
ts_web_test_suite(
name = "test_web",
deps = [
":test_lib",

View File

@ -1,4 +1,4 @@
load("//tools:defaults.bzl", "ts_library", "ts_web_test")
load("//tools:defaults.bzl", "ts_library")
load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
# Uses separate test rules to allow the tests to run in parallel

View File

@ -1,4 +1,4 @@
load("//tools:defaults.bzl", "ts_library", "ts_web_test")
load("//tools:defaults.bzl", "ts_library")
load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
ts_library(

View File

@ -1,4 +1,4 @@
load("//tools:defaults.bzl", "ts_library", "ts_web_test")
load("//tools:defaults.bzl", "ts_library")
load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
ts_library(

View File

@ -1,4 +1,4 @@
load("//tools:defaults.bzl", "ts_library", "ts_web_test")
load("//tools:defaults.bzl", "ts_library")
load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
ts_library(

View File

@ -1,4 +1,4 @@
load("//tools:defaults.bzl", "ts_library", "ts_web_test")
load("//tools:defaults.bzl", "ts_library")
load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
ts_library(

View File

@ -1,4 +1,4 @@
load("//tools:defaults.bzl", "ts_library", "ts_web_test")
load("//tools:defaults.bzl", "ts_library", "ts_web_test_suite")
load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
# Test that should only be run in node
@ -80,7 +80,7 @@ jasmine_node_test(
],
)
ts_web_test(
ts_web_test_suite(
name = "test_web",
deps = [
":test_lib",

View File

@ -1,4 +1,4 @@
load("//tools:defaults.bzl", "ts_library", "ts_web_test")
load("//tools:defaults.bzl", "ts_library")
load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
ts_library(

View File

@ -1,6 +1,6 @@
package(default_visibility = ["//visibility:public"])
load("//tools:defaults.bzl", "ts_library", "ts_web_test")
load("//tools:defaults.bzl", "ts_library", "ts_web_test_suite")
load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
ts_library(
@ -60,7 +60,7 @@ jasmine_node_test(
],
)
ts_web_test(
ts_web_test_suite(
name = "test_web",
deps = [
":test_lib",

View File

@ -1,6 +1,6 @@
package(default_visibility = ["//visibility:public"])
load("//tools:defaults.bzl", "ts_library", "ts_web_test")
load("//tools:defaults.bzl", "ts_library", "ts_web_test_suite")
load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
ts_library(
@ -52,7 +52,7 @@ jasmine_node_test(
],
)
ts_web_test(
ts_web_test_suite(
name = "render3_web",
deps = [
":render3_lib",

View File

@ -1,5 +1,5 @@
load("//tools:defaults.bzl", "ts_library")
load("@build_bazel_rules_typescript//:defs.bzl", "ts_web_test")
load("@build_bazel_rules_typescript//:defs.bzl", "ts_web_test_suite")
load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
ts_library(
@ -31,7 +31,7 @@ filegroup(
],
)
ts_web_test(
ts_web_test_suite(
name = "test",
bootstrap = [
":elements_test_bootstrap_scripts",

View File

@ -1,4 +1,4 @@
load("//tools:defaults.bzl", "ts_library", "ts_web_test")
load("//tools:defaults.bzl", "ts_library", "ts_web_test_suite")
load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
ts_library(
@ -25,7 +25,7 @@ jasmine_node_test(
],
)
ts_web_test(
ts_web_test_suite(
name = "test_web",
deps = [
":test_lib",

View File

@ -1,4 +1,4 @@
load("//tools:defaults.bzl", "ts_library", "ts_web_test")
load("//tools:defaults.bzl", "ts_library", "ts_web_test_suite")
load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
ts_library(
@ -25,7 +25,7 @@ jasmine_node_test(
],
)
ts_web_test(
ts_web_test_suite(
name = "test_web",
deps = [
":test_lib",

View File

@ -1,4 +1,4 @@
load("//tools:defaults.bzl", "ts_library", "ts_web_test")
load("//tools:defaults.bzl", "ts_library")
load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
ts_library(

View File

@ -1,4 +1,4 @@
load("//tools:defaults.bzl", "ts_library", "ts_web_test")
load("//tools:defaults.bzl", "ts_library", "ts_web_test_suite")
load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
ts_library(
@ -27,7 +27,7 @@ jasmine_node_test(
],
)
ts_web_test(
ts_web_test_suite(
name = "test_web",
# disable since tests are running but not yet passing
tags = ["manual"],

View File

@ -1,4 +1,4 @@
load("//tools:defaults.bzl", "ts_library", "ts_web_test")
load("//tools:defaults.bzl", "ts_library", "ts_web_test_suite")
load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
ts_library(
@ -33,7 +33,7 @@ jasmine_node_test(
],
)
ts_web_test(
ts_web_test_suite(
name = "test_web",
# disable since tests are running but not yet passing
tags = ["manual"],

View File

@ -1,4 +1,4 @@
load("//tools:defaults.bzl", "ts_library", "ts_web_test")
load("//tools:defaults.bzl", "ts_library", "ts_web_test_suite")
load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
ts_library(
@ -27,7 +27,7 @@ jasmine_node_test(
],
)
ts_web_test(
ts_web_test_suite(
name = "test_web",
deps = [
":test_lib",

View File

@ -1,4 +1,4 @@
load("//tools:defaults.bzl", "ts_library", "ts_web_test")
load("//tools:defaults.bzl", "ts_library", "ts_web_test_suite")
load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
ts_library(
@ -29,7 +29,7 @@ jasmine_node_test(
],
)
ts_web_test(
ts_web_test_suite(
name = "test_web",
deps = [
":test_lib",

View File

@ -1,4 +1,4 @@
load("//tools:defaults.bzl", "ts_library", "ts_web_test")
load("//tools:defaults.bzl", "ts_library", "ts_web_test_suite")
load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
ts_library(
@ -27,7 +27,7 @@ jasmine_node_test(
],
)
ts_web_test(
ts_web_test_suite(
name = "test_web",
deps = [
":test_lib",

View File

@ -1,4 +1,4 @@
load("//tools:defaults.bzl", "ts_library", "ts_web_test")
load("//tools:defaults.bzl", "ts_library", "ts_web_test_suite")
load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
ts_library(
@ -18,7 +18,7 @@ ts_library(
],
)
ts_web_test(
ts_web_test_suite(
name = "test_web",
bootstrap = [
# "//:angularjs",

View File

@ -1,6 +1,6 @@
"""Re-export of some bazel rules with repository-wide defaults."""
load("@build_bazel_rules_nodejs//:defs.bzl", _npm_package = "npm_package")
load("@build_bazel_rules_typescript//:defs.bzl", _ts_library = "ts_library", _ts_web_test = "ts_web_test")
load("@build_bazel_rules_typescript//:defs.bzl", _ts_library = "ts_library", _ts_web_test_suite = "ts_web_test_suite")
load("//packages/bazel:index.bzl", _ng_module = "ng_module", _ng_package = "ng_package")
load("//packages/bazel/src:ng_module.bzl", _ivy_ng_module = "internal_ivy_ng_module")
@ -68,7 +68,7 @@ def npm_package(name, replacements = {}, **kwargs):
replacements = dict(replacements, **PKG_GROUP_REPLACEMENTS),
**kwargs)
def ts_web_test(bootstrap = [], deps = [], **kwargs):
def ts_web_test_suite(bootstrap = [], deps = [], **kwargs):
if not bootstrap:
bootstrap = ["//:web_test_bootstrap_scripts"]
local_deps = [
@ -76,9 +76,16 @@ def ts_web_test(bootstrap = [], deps = [], **kwargs):
"//tools/testing:browser",
] + deps
_ts_web_test(
_ts_web_test_suite(
bootstrap = bootstrap,
deps = local_deps,
# Run unit tests on Chromium and Firefox by default.
# You can exclude tests based on tags, e.g. to skip Firefox testing,
# `bazel test --test_tag_filters=-browser:firefox-local [targets]`
browsers = [
"@io_bazel_rules_webtesting//browsers:chromium-local",
"@io_bazel_rules_webtesting//browsers:firefox-local",
],
**kwargs)
def ivy_ng_module(name, tsconfig = None, **kwargs):