Skip to content

Commit

Permalink
Remove flaky test on macOS (#264)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yannic authored and jart committed Apr 26, 2018
1 parent f04ee86 commit dea4d34
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 26 deletions.
3 changes: 0 additions & 3 deletions .bazelci/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,4 @@ platforms:
build_targets:
- "..."
test_targets:
- "--"
- "..."
# See https://github.com/bazelbuild/rules_closure/issues/247
- "-//closure/testing/test:noto_fonts_render_as_expected"
9 changes: 1 addition & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,6 @@ before_install:
script:
- |
excludes=()
if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
# https://github.com/bazelbuild/rules_closure/issues/247
excludes+=('//closure/testing/test:noto_fonts_render_as_expected')
fi
targets=$(bazel query "... except set($excludes)")
bazel \
--output_base=$HOME/.cache/bazel \
--batch \
Expand All @@ -54,7 +47,7 @@ script:
--local_resources=400,2,1.0 \
--strategy=Javac=worker \
--strategy=Closure=worker \
$targets
...
notifications:
email: false
2 changes: 1 addition & 1 deletion closure/compiler/closure_js_library.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def closure_js_library_impl(
srcs, deps, testonly, suppress,
closure_library_base, closure_library_deps, _ClosureWorker,

includes=[],
includes=(),
exports=depset(),
internal_descriptors=depset(),
convention='CLOSURE',
Expand Down
3 changes: 2 additions & 1 deletion closure/protobuf/closure_proto_library.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ load("//closure/private:defs.bzl",
"CLOSURE_LIBRARY_DEPS_ATTR",
"unfurl")

# This was taken from https://github.com/bazelbuild/rules_go/blob/67f44035d84a352cffb9465159e199066ecb814c/proto/compiler.bzl#L72
# This was borrowed from Rules Go, licensed under Apache 2.
# https://github.com/bazelbuild/rules_go/blob/67f44035d84a352cffb9465159e199066ecb814c/proto/compiler.bzl#L72
def _proto_path(proto):
path = proto.path
root = proto.root.path
Expand Down
33 changes: 20 additions & 13 deletions closure/testing/test/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,23 @@ genrule(
tools = ["//third_party/phantomjs"],
)

files_equal_test(
name = "noto_fonts_render_as_expected",
actual = "fontdemo-generated.png",
golden = select({
":darwin": "fontdemo-darwin.png",
"//conditions:default": "fontdemo.png",
}),
)

config_setting(
name = "darwin",
values = {"cpu": "darwin"},
)
# This test shows how to write tests to verify rendered output from phantomjs.
# However, you shouln't do this because the output image depends on a lot of
# external factors like operating system, GPU, ..., and therefore has a
# very hight chance of being flaky.
# https://github.com/bazelbuild/rules_closure/issues/247
# https://github.com/bazelbuild/rules_closure/pull/186#issuecomment-279115018
#
# files_equal_test(
# name = "noto_fonts_render_as_expected",
# actual = "fontdemo-generated.png",
# golden = select({
# ":darwin": "fontdemo-darwin.png",
# "//conditions:default": "fontdemo.png",
# }),
# )
#
# config_setting(
# name = "darwin",
# values = {"cpu": "darwin"},
# )

0 comments on commit dea4d34

Please sign in to comment.