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( http_archive(
name = "io_bazel_rules_webtesting", name = "io_bazel_rules_webtesting",
url = "https://github.com/bazelbuild/rules_webtesting/archive/ca7b8062d9cf4ef2fde9193c7d37a0764c4262d7.zip", url = "https://github.com/bazelbuild/rules_webtesting/archive/cfcaaf98553fee8e7063b5f5c11fd1b77e43d683.zip",
strip_prefix = "rules_webtesting-ca7b8062d9cf4ef2fde9193c7d37a0764c4262d7", strip_prefix = "rules_webtesting-cfcaaf98553fee8e7063b5f5c11fd1b77e43d683",
sha256 = "28c73cf9d310fa6dba30e66bdb98071341c99c3feb8662f2d3883a632de97d72", sha256 = "636c7a9ac2ca13a04d982c2f9c874876ecc90a7b9ccfe4188156122b26ada7b3",
) )
http_archive( 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") load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
ts_library( ts_library(
@ -29,7 +29,7 @@ jasmine_node_test(
], ],
) )
ts_web_test( ts_web_test_suite(
name = "test_web", name = "test_web",
deps = [ deps = [
":test_lib", ":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") load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
# Uses separate test rules to allow the tests to run in parallel # 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") load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
ts_library( 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") load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
ts_library( 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") load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
ts_library( 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") load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
ts_library( 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") load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
# Test that should only be run in node # 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", name = "test_web",
deps = [ deps = [
":test_lib", ":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") load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
ts_library( ts_library(

View File

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

View File

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

View File

@ -1,5 +1,5 @@
load("//tools:defaults.bzl", "ts_library") 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") load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
ts_library( ts_library(
@ -31,7 +31,7 @@ filegroup(
], ],
) )
ts_web_test( ts_web_test_suite(
name = "test", name = "test",
bootstrap = [ bootstrap = [
":elements_test_bootstrap_scripts", ":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") load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
ts_library( ts_library(
@ -25,7 +25,7 @@ jasmine_node_test(
], ],
) )
ts_web_test( ts_web_test_suite(
name = "test_web", name = "test_web",
deps = [ deps = [
":test_lib", ":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") load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
ts_library( ts_library(
@ -25,7 +25,7 @@ jasmine_node_test(
], ],
) )
ts_web_test( ts_web_test_suite(
name = "test_web", name = "test_web",
deps = [ deps = [
":test_lib", ":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") load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
ts_library( 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") load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
ts_library( ts_library(
@ -27,7 +27,7 @@ jasmine_node_test(
], ],
) )
ts_web_test( ts_web_test_suite(
name = "test_web", name = "test_web",
# disable since tests are running but not yet passing # disable since tests are running but not yet passing
tags = ["manual"], 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") load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
ts_library( ts_library(
@ -33,7 +33,7 @@ jasmine_node_test(
], ],
) )
ts_web_test( ts_web_test_suite(
name = "test_web", name = "test_web",
# disable since tests are running but not yet passing # disable since tests are running but not yet passing
tags = ["manual"], 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") load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
ts_library( ts_library(
@ -27,7 +27,7 @@ jasmine_node_test(
], ],
) )
ts_web_test( ts_web_test_suite(
name = "test_web", name = "test_web",
deps = [ deps = [
":test_lib", ":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") load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
ts_library( ts_library(
@ -29,7 +29,7 @@ jasmine_node_test(
], ],
) )
ts_web_test( ts_web_test_suite(
name = "test_web", name = "test_web",
deps = [ deps = [
":test_lib", ":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") load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
ts_library( ts_library(
@ -27,7 +27,7 @@ jasmine_node_test(
], ],
) )
ts_web_test( ts_web_test_suite(
name = "test_web", name = "test_web",
deps = [ deps = [
":test_lib", ":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") load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
ts_library( ts_library(
@ -18,7 +18,7 @@ ts_library(
], ],
) )
ts_web_test( ts_web_test_suite(
name = "test_web", name = "test_web",
bootstrap = [ bootstrap = [
# "//:angularjs", # "//:angularjs",

View File

@ -1,6 +1,6 @@
"""Re-export of some bazel rules with repository-wide defaults.""" """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_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:index.bzl", _ng_module = "ng_module", _ng_package = "ng_package")
load("//packages/bazel/src:ng_module.bzl", _ivy_ng_module = "internal_ivy_ng_module") 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), replacements = dict(replacements, **PKG_GROUP_REPLACEMENTS),
**kwargs) **kwargs)
def ts_web_test(bootstrap = [], deps = [], **kwargs): def ts_web_test_suite(bootstrap = [], deps = [], **kwargs):
if not bootstrap: if not bootstrap:
bootstrap = ["//:web_test_bootstrap_scripts"] bootstrap = ["//:web_test_bootstrap_scripts"]
local_deps = [ local_deps = [
@ -76,9 +76,16 @@ def ts_web_test(bootstrap = [], deps = [], **kwargs):
"//tools/testing:browser", "//tools/testing:browser",
] + deps ] + deps
_ts_web_test( _ts_web_test_suite(
bootstrap = bootstrap, bootstrap = bootstrap,
deps = local_deps, 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) **kwargs)
def ivy_ng_module(name, tsconfig = None, **kwargs): def ivy_ng_module(name, tsconfig = None, **kwargs):