2019-01-16 04:19:01 -05:00
|
|
|
load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary")
|
|
|
|
|
2017-06-02 12:43:52 -04:00
|
|
|
package(default_visibility = ["//visibility:public"])
|
2017-12-06 09:56:49 -05:00
|
|
|
|
2018-12-18 01:09:39 -05:00
|
|
|
load("//tools:defaults.bzl", "karma_web_test")
|
2018-03-20 16:13:06 -04:00
|
|
|
|
2017-12-17 18:10:54 -05:00
|
|
|
exports_files([
|
|
|
|
"tsconfig.json",
|
2018-03-01 13:41:35 -05:00
|
|
|
"LICENSE",
|
2018-07-06 18:42:07 -04:00
|
|
|
"protractor-perf.conf.js",
|
2018-12-18 01:09:39 -05:00
|
|
|
"karma-js.conf.js",
|
|
|
|
"browser-providers.conf.js",
|
2017-12-17 18:10:54 -05:00
|
|
|
])
|
2017-06-02 12:43:52 -04:00
|
|
|
|
2017-12-16 14:35:47 -05:00
|
|
|
filegroup(
|
2017-12-18 18:37:05 -05:00
|
|
|
name = "web_test_bootstrap_scripts",
|
2017-12-16 14:35:47 -05:00
|
|
|
# do not sort
|
|
|
|
srcs = [
|
2018-12-18 01:09:39 -05:00
|
|
|
"@ngdeps//node_modules/core-js:client/core.js",
|
2018-10-04 16:14:14 -04:00
|
|
|
"@ngdeps//node_modules/zone.js:dist/zone.js",
|
|
|
|
"@ngdeps//node_modules/zone.js:dist/zone-testing.js",
|
|
|
|
"@ngdeps//node_modules/zone.js:dist/task-tracking.js",
|
2018-06-04 17:58:23 -04:00
|
|
|
"//:test-events.js",
|
2018-12-18 01:09:39 -05:00
|
|
|
"//:shims_for_IE.js",
|
|
|
|
# Including systemjs because it defines `__eval`, which produces correct stack traces.
|
|
|
|
"@ngdeps//node_modules/systemjs:dist/system.src.js",
|
|
|
|
"@ngdeps//node_modules/reflect-metadata:Reflect.js",
|
2017-12-16 14:35:47 -05:00
|
|
|
],
|
|
|
|
)
|
2017-12-18 18:37:05 -05:00
|
|
|
|
|
|
|
filegroup(
|
2018-05-31 02:49:37 -04:00
|
|
|
name = "angularjs_scripts",
|
2017-12-18 18:37:05 -05:00
|
|
|
srcs = [
|
2018-12-17 12:28:06 -05:00
|
|
|
# We also declare the unminfied AngularJS files since these can be used for
|
|
|
|
# local debugging (e.g. see: packages/upgrade/test/common/test_helpers.ts)
|
2018-10-04 16:14:14 -04:00
|
|
|
"@ngdeps//node_modules/angular:angular.js",
|
2018-12-17 12:28:06 -05:00
|
|
|
"@ngdeps//node_modules/angular:angular.min.js",
|
2018-10-04 16:14:14 -04:00
|
|
|
"@ngdeps//node_modules/angular-1.5:angular.js",
|
2018-12-17 12:28:06 -05:00
|
|
|
"@ngdeps//node_modules/angular-1.5:angular.min.js",
|
2018-10-04 16:14:14 -04:00
|
|
|
"@ngdeps//node_modules/angular-1.6:angular.js",
|
2018-12-17 12:28:06 -05:00
|
|
|
"@ngdeps//node_modules/angular-1.6:angular.min.js",
|
2018-10-04 16:14:14 -04:00
|
|
|
"@ngdeps//node_modules/angular-mocks:angular-mocks.js",
|
|
|
|
"@ngdeps//node_modules/angular-mocks-1.5:angular-mocks.js",
|
|
|
|
"@ngdeps//node_modules/angular-mocks-1.6:angular-mocks.js",
|
2017-12-18 18:37:05 -05:00
|
|
|
],
|
|
|
|
)
|
2018-10-04 16:14:14 -04:00
|
|
|
|
2018-10-16 16:20:00 -04:00
|
|
|
# A nodejs_binary for @angular/bazel/ngc-wrapped to use by default in
|
|
|
|
# ng_module that depends on @npm//@angular/bazel instead of the
|
|
|
|
# output of the //packages/bazel/src/ngc-wrapped ts_library rule. This
|
|
|
|
# default is for downstream users that depend on the @angular/bazel npm
|
|
|
|
# package. The generated @npm//@angular/bazel/ngc-wrapped target
|
|
|
|
# does not work because it does not have the node `--expose-gc` flag
|
|
|
|
# set which is required to support the call to `global.gc()`.
|
2018-10-04 16:14:14 -04:00
|
|
|
nodejs_binary(
|
2018-10-16 16:20:00 -04:00
|
|
|
name = "@angular/bazel/ngc-wrapped",
|
2018-10-22 16:04:01 -04:00
|
|
|
configuration_env_vars = ["compile"],
|
2018-10-16 16:20:00 -04:00
|
|
|
data = ["@npm//@angular/bazel"],
|
|
|
|
entry_point = "@angular/bazel/src/ngc-wrapped/index.js",
|
2018-10-04 16:14:14 -04:00
|
|
|
install_source_map_support = False,
|
|
|
|
templated_args = ["--node_options=--expose-gc"],
|
|
|
|
)
|
2018-12-18 01:09:39 -05:00
|
|
|
|
|
|
|
# To run a karma_web_test target locally on SauceLabs:
|
|
|
|
# 1) have SAUCE_USERNAME, SAUCE_ACCESS_KEY (and optionally a SAUCE_TUNNEL_IDENTIFIER) set in your environment
|
|
|
|
# 2) open a sauce connection with `./scripts/saucelabs/start-tunnel.sh`
|
|
|
|
# NOTE: start-tunnel.sh uses `node_modules/sauce-connect` which is current linux specific:
|
|
|
|
# "sauce-connect": "https://saucelabs.com/downloads/sc-4.5.3-linux.tar.gz".
|
|
|
|
# On OSX or Windows you'll need to use the appropriate sauce-connect binary.
|
|
|
|
# 3) run target with `yarn bazel test --config=saucelabs <target>`
|
2019-02-21 13:57:56 -05:00
|
|
|
# NOTE: --config=saucelabs is required as it makes the SAUCE_XXX environment variables available to
|
|
|
|
# the action. See /.bazelrc.
|
2018-12-18 01:09:39 -05:00
|
|
|
karma_web_test(
|
|
|
|
name = "test_web_all",
|
|
|
|
tags = [
|
|
|
|
"local",
|
|
|
|
"manual",
|
|
|
|
"saucelabs",
|
|
|
|
],
|
|
|
|
deps = [
|
2019-02-21 12:13:44 -05:00
|
|
|
# We combine all tests into a single karma_web_test target
|
|
|
|
# as running them as seperate targets in parallel leads to too many
|
|
|
|
# browsers being acquired at once in SauceLabs and the tests flake out
|
|
|
|
# TODO: this is an example subset of tests below, add all remaining angular tests
|
2018-12-18 01:09:39 -05:00
|
|
|
"//packages/common/http/test:test_lib",
|
|
|
|
"//packages/common/http/testing/test:test_lib",
|
|
|
|
"//packages/common/test:test_lib",
|
|
|
|
"//packages/core/test:test_lib",
|
|
|
|
"//packages/forms/test:test_lib",
|
|
|
|
"//packages/http/test:test_lib",
|
|
|
|
# "//packages/router/test:test_lib",
|
|
|
|
# //packages/router/test:test_lib fails with:
|
|
|
|
# IE 11.0.0 (Windows 8.1.0.0) bootstrap should restore the scrolling position FAILED
|
|
|
|
# Expected undefined to equal 5000.
|
|
|
|
# at stack (eval code:2338:11)
|
|
|
|
# at buildExpectationResult (eval code:2305:5)
|
|
|
|
# at expectationResultFactory (eval code:858:11)
|
|
|
|
# at Spec.prototype.addExpectationResult (eval code:487:5)
|
|
|
|
# at addExpectationResult (eval code:802:9)
|
|
|
|
# at Anonymous function (eval code:2252:7)
|
|
|
|
# at Anonymous function (eval code:339:25)
|
|
|
|
# at step (eval code:133:17)
|
|
|
|
# at Anonymous function (eval code:114:50)
|
|
|
|
# at fulfilled (eval code:104:47)
|
|
|
|
],
|
|
|
|
)
|