Skip to content

Commit

Permalink
refactor: green up tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeagle committed Aug 28, 2019
1 parent d8a0ccb commit 2d6931c
Show file tree
Hide file tree
Showing 15 changed files with 49 additions and 12 deletions.
1 change: 1 addition & 0 deletions e2e/karma/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ ts_web_test_suite(
# in "tslib" transitively.
"init-test.js",
],
tags = ["native"],
deps = [
"init-test.js",
"requirejs-config.js",
Expand Down
5 changes: 4 additions & 1 deletion e2e/karma/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,7 @@ web_test_repositories()

load("@io_bazel_rules_webtesting//web/versioned:browsers-0.3.2.bzl", "browser_repositories")

browser_repositories(chromium = True)
browser_repositories(
chromium = True,
firefox = True,
)
5 changes: 4 additions & 1 deletion e2e/karma_stack_trace/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ ts_web_test_suite(
"@io_bazel_rules_webtesting//browsers:chromium-local",
"@io_bazel_rules_webtesting//browsers:firefox-local",
],
tags = ["manual"], # not run by CI
tags = [
"manual", # not run by CI
"native",
],
deps = [
":test_lib",
"//test_folder:test_lib",
Expand Down
5 changes: 4 additions & 1 deletion e2e/karma_stack_trace/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ web_test_repositories()

load("@io_bazel_rules_webtesting//web/versioned:browsers-0.3.2.bzl", "browser_repositories")

browser_repositories(chromium = True)
browser_repositories(
chromium = True,
firefox = True,
)

load("@npm_bazel_typescript//:index.bzl", "ts_setup_workspace")

Expand Down
3 changes: 2 additions & 1 deletion e2e/karma_stack_trace/test_sourcemap.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# Execute first test.
OUTPUT=$(${RUNFILES_DIR}/e2e_karma_stack_trace/karma_test_chromium-local)
OUTPUT=$(${RUNFILES_DIR}/e2e_karma_stack_trace/karma_test_chromium-local.sh)

# Test whether the package relative TS path is printed in stack trace.
echo ${OUTPUT} | grep -q "(failing.spec.ts:7:17"
if [[ "$?" != "0" ]]; then
echo "Did not find 'failing.spec.ts:7:17' in Karma stack trace"
echo $OUTPUT
exit 1
fi

Expand Down
1 change: 1 addition & 0 deletions e2e/karma_typescript/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ ts_web_test_suite(
"@io_bazel_rules_webtesting//browsers:chromium-local",
"@io_bazel_rules_webtesting//browsers:firefox-local",
],
tags = ["native"],
runtime_deps = [
# typescript targets only in runtime_deps, must be TS module
":hello_world",
Expand Down
5 changes: 4 additions & 1 deletion e2e/karma_typescript/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ web_test_repositories()

load("@io_bazel_rules_webtesting//web/versioned:browsers-0.3.2.bzl", "browser_repositories")

browser_repositories(chromium = True)
browser_repositories(
chromium = True,
firefox = True,
)

load("@npm_bazel_typescript//:index.bzl", "ts_setup_workspace")

Expand Down
1 change: 1 addition & 0 deletions examples/protocol_buffers/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ ts_web_test_suite(
"@io_bazel_rules_webtesting//browsers:chromium-local",
"@io_bazel_rules_webtesting//browsers:firefox-local",
],
tags = ["native"],
deps = ["test_lib"],
)

Expand Down
5 changes: 4 additions & 1 deletion examples/protocol_buffers/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ web_test_repositories()

load("@io_bazel_rules_webtesting//web/versioned:browsers-0.3.2.bzl", "browser_repositories")

browser_repositories(chromium = True)
browser_repositories(
chromium = True,
firefox = True,
)

load("@npm_bazel_typescript//:defs.bzl", "ts_setup_workspace")

Expand Down
6 changes: 6 additions & 0 deletions examples/web_testing/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ karma_web_test_suite(
static_files = [
"static_script.js",
],
tags = ["native"],
runtime_deps = [
":tests_setup",
],
Expand All @@ -60,7 +61,9 @@ karma_web_test_suite(
"@io_bazel_rules_webtesting//browsers/sauce:chrome-win10",
],
tags = [
"exclusive",
"sauce",
"native",
# TODO(alexeagle): enable on CI once we have set the SAUCE env variables
"manual",
],
Expand All @@ -78,6 +81,7 @@ ts_web_test_suite(
static_files = [
"static_script.js",
],
tags = ["native"],
runtime_deps = [
":tests_setup",
],
Expand All @@ -92,6 +96,8 @@ ts_web_test_suite(
"@io_bazel_rules_webtesting//browsers/sauce:chrome-win10",
],
tags = [
"exclusive",
"native",
"sauce",
# TODO(alexeagle): enable on CI once we have set the SAUCE env variables
"manual",
Expand Down
7 changes: 6 additions & 1 deletion packages/karma/src/karma_web_test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ def karma_web_test(

def karma_web_test_suite(
name,
browsers = ["@io_bazel_rules_webtesting//browsers:chromium-local"],
browsers = None,
args = None,
browser_overrides = None,
config = None,
Expand Down Expand Up @@ -419,6 +419,11 @@ def karma_web_test_suite(
if wrapped_test_tags == None:
wrapped_test_tags = DEFAULT_WRAPPED_TEST_TAGS

if browsers == None:
browsers = ["@io_bazel_rules_webtesting//browsers:chromium-local"]
if not "native" in tags:
tags = tags + ["native"]

size = size or "large"

wrapped_test_name = name + "_wrapped_test"
Expand Down
7 changes: 6 additions & 1 deletion packages/karma/src/ts_web_test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def ts_web_test(

def ts_web_test_suite(
name,
browsers = ["@io_bazel_rules_webtesting//browsers:chromium-local"],
browsers = None,
args = None,
browser_overrides = None,
config = None,
Expand Down Expand Up @@ -161,6 +161,11 @@ def ts_web_test_suite(
if wrapped_test_tags == None:
wrapped_test_tags = DEFAULT_WRAPPED_TEST_TAGS

if browsers == None:
browsers = ["@io_bazel_rules_webtesting//browsers:chromium-local"]
if not "native" in tags:
tags = tags + ["native"]

size = size or "large"

wrapped_test_name = name + "_wrapped_test"
Expand Down
7 changes: 6 additions & 1 deletion packages/protractor/src/protractor_web_test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ def protractor_web_test_suite(
deps = [],
data = [],
server = None,
browsers = ["@io_bazel_rules_webtesting//browsers:chromium-local"],
browsers = None,
args = None,
browser_overrides = None,
config = None,
Expand Down Expand Up @@ -314,6 +314,11 @@ def protractor_web_test_suite(
if wrapped_test_tags == None:
wrapped_test_tags = DEFAULT_WRAPPED_TEST_TAGS

if browsers == None:
browsers = ["@io_bazel_rules_webtesting//browsers:chromium-local"]
if not "native" in tags:
tags = tags + ["native"]

size = size or "large"

wrapped_test_name = name + "_wrapped_test"
Expand Down
2 changes: 0 additions & 2 deletions packages/protractor/test/protractor-2/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ protractor_web_test_suite(
tags = [
"fix-bazelci-ubuntu", # ubuntu docker images on buildkite missing chrome dependencies & apt-get install not possible
"fix-windows", # http_server (and history_server) do not work on Windows
"native",
],
deps = [
":ts_spec",
Expand All @@ -71,7 +70,6 @@ protractor_web_test_suite(
server = ":devserver",
tags = [
"fix-bazelci-ubuntu", # ubuntu docker images on buildkite missing chrome dependencies & apt-get install not possible
"native",
],
deps = [
":ts_spec",
Expand Down
1 change: 0 additions & 1 deletion packages/protractor/test/protractor/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ protractor_web_test_suite(
configuration = ":ts_conf",
tags = [
"fix-bazelci-ubuntu", # ubuntu docker images on buildkite missing chrome dependencies & apt-get install not possible
"native",
],
deps = [
":ts_spec",
Expand Down

0 comments on commit 2d6931c

Please sign in to comment.