Skip to content

Commit

Permalink
Use no-sandbox tag instead of local attribute or tag
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamie Snape committed Apr 17, 2018
1 parent 87ed4b3 commit 810a9e6
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 43 deletions.
1 change: 0 additions & 1 deletion automotive/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,6 @@ drake_cc_googletest(
data = ["//automotive/models:prod_models"],
# Flaky because LCM self-test can fail (PR #7311)
flaky = 1,
local = 1,
deps = [
"//automotive:automotive_simulator",
"//automotive:create_trajectory_params",
Expand Down
2 changes: 0 additions & 2 deletions lcm/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ drake_cc_googletest(
name = "drake_lcm_test",
# Flaky because LCM self-test can fail (PR #7311)
flaky = 1,
local = 1,
deps = [
":lcm",
":lcmt_drake_signal_utils",
Expand All @@ -104,7 +103,6 @@ drake_cc_googletest(

drake_cc_googletest(
name = "drake_lcm_log_test",
local = 1,
deps = [
":lcm_log",
":lcmt_drake_signal_utils",
Expand Down
1 change: 0 additions & 1 deletion manipulation/models/iiwa_description/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ drake_cc_googletest(
name = "dual_iiwa14_polytope_collision_test",
srcs = ["urdf/test/dual_iiwa14_polytope_collision_test.cc"],
data = [":models"],
local = 1,
deps = [
"//common:find_resource",
"//multibody/parsers",
Expand Down
1 change: 0 additions & 1 deletion manipulation/models/wsg_50_description/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ drake_cc_googletest(
name = "wsg_50_mesh_collision_test",
srcs = ["urdf/test/wsg50_mesh_collision_test.cc"],
data = [":models"],
local = 1,
deps = [
"//common:find_resource",
"//multibody/parsers",
Expand Down
41 changes: 21 additions & 20 deletions systems/sensors/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -422,14 +422,14 @@ drake_cc_googletest(
data = [
":test_models",
],
# Mitigates driver-related issues when running under `bazel test`. For more
# information, see #7004.
local = 1,
# Disable under LeakSanitizer and Valgrind Memcheck due to driver-related
# leaks. For more information, see #7520.
tags = [
# Disable under LeakSanitizer and Valgrind Memcheck due to
# driver-related leaks. For more information, see #7520.
"no_lsan",
"no_memcheck",
# Mitigates driver-related issues when running under `bazel test`. For
# more information, see #7004.
"no-sandbox",
],
deps = [
":rgbd_camera",
Expand All @@ -452,14 +452,14 @@ drake_cc_googletest(
data = [
":test_models",
],
# Mitigates driver-related issues when running under `bazel test`. For more
# information, see #7004.
local = 1,
# Disable under LeakSanitizer and Valgrind Memcheck due to driver-related
# leaks. For more information, see #7520.
tags = [
# Disable under LeakSanitizer and Valgrind Memcheck due to
# driver-related leaks. For more information, see #7520.
"no_lsan",
"no_memcheck",
# Mitigates driver-related issues when running under `bazel test`. For
# more information, see #7004.
"no-sandbox",
],
deps = [
":rgbd_renderer",
Expand All @@ -480,18 +480,19 @@ sh_test(
data = [
":test_models",
],
# Mitigates driver-related issues when running under `bazel test`. For more
# information, see #7004.
local = 1,
# TODO(mitiguy) Issue #8368: Test rgbd_camera_publish_lcm_test in the
# BUILD.bazel file in directory drake/systems/sensors cannot be run anymore
# due to the new RotationMatrix class which insists on being a proper
# orthogonal rotation matrix. This test produces a quaternion with NANs
# which causes the RotationMatrix class to throw an exception in debug
# builds. This test is labeled with tags = "manual" so CI does not run it.
# This test is defective and should never have passed earlier code review.
tags = [
# TODO(mitiguy) Issue #8368: Test rgbd_camera_publish_lcm_test in the
# BUILD.bazel file in directory drake/systems/sensors cannot be run
# anymore due to the new RotationMatrix class which insists on being a
# proper orthogonal rotation matrix. This test produces a quaternion
# with NANs which causes the RotationMatrix class to throw an exception
# in debug builds. This test is labeled with tags = "manual" so CI does
# not run it. This test is defective and should never have passed
# earlier code review.
"manual",
# Mitigates driver-related issues when running under `bazel test`. For
# more information, see #7004.
"no-sandbox",
],
)

Expand Down
8 changes: 6 additions & 2 deletions tools/lint/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,13 @@ drake_py_unittest(
drake_py_unittest(
name = "util_test",
tags = [
# This test looks outside the sandbox.
# This test's pass/fail result depends on the presence of files in the
# source tree beyond what is declared in its `deps`; thus, we need to
# re-run the test anytime the source tree might have changed, for which
# "external" is the closest semantic match.
"external",
"local",
# This test looks outside the sandbox.
"no-sandbox",
],
deps = [":util"],
)
Expand Down
29 changes: 13 additions & 16 deletions tools/skylark/test_tags.bzl
Original file line number Diff line number Diff line change
@@ -1,45 +1,42 @@
# -*- mode: python -*-

# These macros are intended to be used when declaring tests that either may-use
# or must-use either Gurobi or Mosek commercial solvers. These labels both
# account for any license-server specific needs (such as network access or rate
# control), as well as provide a marker so that //tools/bazel.rc can
# selectively enable tests based on the developer's chosen configuration.
# or must-use either Gurobi or MOSEK commercial solvers. These labels both
# account for any license-related needs and provide a marker so that
# //tools/bazel.rc can selectively enable tests based on the developer's chosen
# configuration.

def gurobi_test_tags(gurobi_required = True):
"""Returns the test tags necessary for properly running Gurobi tests.
By default, sets gurobi_required=True, which will require that the supplied
tag filters include "gurobi".
Gurobi checks a license file, and may need to contact a license server to
check out a license. Therefore, tests that use Gurobi must have the tag
"local", because they are non-hermetic. For the moment, we also require
the tag "exclusive", to rate-limit license servers with a small number of
licenses.
Gurobi checks a license file outside the workspace so tests that use Gurobi
must have the tag "no-sandbox". For the moment, we also require the tag
"exclusive" to rate-limit license servers with a small number of licenses.
"""
# TODO(david-german-tri): Find a better fix for the license server problem.
nominal_tags = [
"exclusive",
"local",
"exclusive", # implies "local"
"no-sandbox",
]
if gurobi_required:
return nominal_tags + ["gurobi"]
else:
return nominal_tags

def mosek_test_tags(mosek_required = True):
"""Returns the test tags necessary for properly running mosek tests.
"""Returns the test tags necessary for properly running MOSEK tests.
By default, sets mosek_required=True, which will require that the supplied
tag filters include "mosek".
MOSEK checks a license file, and may need to contact a license server to
check out a license. Therefore, tests that use MOSEK must have the tag
"local", because they are non-hermetic.
MOSEK checks a license file outside the workspace, so tests that use MOSEK
must have the tag "no-sandbox".
"""
nominal_tags = [
"local",
"no-sandbox",
]
if mosek_required:
return nominal_tags + ["mosek"]
Expand Down

0 comments on commit 810a9e6

Please sign in to comment.