From dea4d340763f4943e42c70b28ac39c26bda009c3 Mon Sep 17 00:00:00 2001 From: Yannic Date: Thu, 26 Apr 2018 19:48:19 +0200 Subject: [PATCH] Remove flaky test on macOS (#264) --- .bazelci/presubmit.yml | 3 -- .travis.yml | 9 +----- closure/compiler/closure_js_library.bzl | 2 +- closure/protobuf/closure_proto_library.bzl | 3 +- closure/testing/test/BUILD | 33 +++++++++++++--------- 5 files changed, 24 insertions(+), 26 deletions(-) diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index 42f67340c3..dd13f44d9f 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -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" diff --git a/.travis.yml b/.travis.yml index e15a321e46..c49efab65f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 \ @@ -54,7 +47,7 @@ script: --local_resources=400,2,1.0 \ --strategy=Javac=worker \ --strategy=Closure=worker \ - $targets + ... notifications: email: false diff --git a/closure/compiler/closure_js_library.bzl b/closure/compiler/closure_js_library.bzl index ec16bafa2d..d43c2f8b1a 100644 --- a/closure/compiler/closure_js_library.bzl +++ b/closure/compiler/closure_js_library.bzl @@ -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', diff --git a/closure/protobuf/closure_proto_library.bzl b/closure/protobuf/closure_proto_library.bzl index e7fba1aff2..4e2ff08edd 100644 --- a/closure/protobuf/closure_proto_library.bzl +++ b/closure/protobuf/closure_proto_library.bzl @@ -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 diff --git a/closure/testing/test/BUILD b/closure/testing/test/BUILD index 10299b8949..29242e3786 100644 --- a/closure/testing/test/BUILD +++ b/closure/testing/test/BUILD @@ -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"}, +# )