Bazel: Fix testonly values in BUILD and .bzl files

According to the documentation [1], the expected values for testonly
are True and False. Replace all the current usages of "1" with "True".

[1] https://docs.bazel.build/versions/master/be/common-definitions.html

Change-Id: I89417f6f9d56e126a6b05edeaaa946934799ab23
This commit is contained in:
David Pursehouse 2018-12-20 16:50:14 +09:00
parent 64a76378e3
commit f86cc5eb4f
33 changed files with 39 additions and 39 deletions

2
BUILD
View File

@ -110,7 +110,7 @@ API_DEPS = [
genrule2(
name = "api",
testonly = 1,
testonly = True,
srcs = API_DEPS,
outs = ["api.zip"],
cmd = " && ".join([

View File

@ -2,7 +2,7 @@ load("//tools/bzl:java.bzl", "java_library2")
java_library(
name = "lib",
testonly = 1,
testonly = True,
resource_strip_prefix = "resources",
resources = ["//resources/com/google/gerrit/acceptance"],
visibility = ["//visibility:public"],
@ -55,7 +55,7 @@ java_library(
java_binary(
name = "framework",
testonly = 1,
testonly = True,
main_class = "Dummy",
visibility = ["//visibility:public"],
runtime_deps = [":framework-lib"],
@ -63,7 +63,7 @@ java_binary(
java_library2(
name = "framework-lib",
testonly = 1,
testonly = True,
srcs = glob(["**/*.java"]),
exported_deps = [
"//java/com/google/gerrit/gpg",
@ -129,7 +129,7 @@ load("//tools/bzl:javadoc.bzl", "java_doc")
java_doc(
name = "framework-javadoc",
testonly = 1,
testonly = True,
libs = [":framework-lib"],
pkgs = ["com.google.gerrit.acceptance"],
title = "Gerrit Acceptance Test Framework Documentation",

View File

@ -1,6 +1,6 @@
java_library(
name = "common-data-test-util",
testonly = 1,
testonly = True,
srcs = glob(["**/*.java"]),
visibility = ["//visibility:public"],
deps = [

View File

@ -1,6 +1,6 @@
java_library(
name = "common-test-util",
testonly = 1,
testonly = True,
srcs = glob(["**/*.java"]),
visibility = ["//visibility:public"],
deps = [

View File

@ -1,6 +1,6 @@
java_library(
name = "restapi-test-util",
testonly = 1,
testonly = True,
srcs = glob(["**/*.java"]),
visibility = ["//visibility:public"],
deps = [

View File

@ -1,4 +1,4 @@
package(default_testonly = 1)
package(default_testonly = True)
java_library(
name = "testing",

View File

@ -1,6 +1,6 @@
java_library(
name = "gpg-test-util",
testonly = 1,
testonly = True,
srcs = glob(["**/*.java"]),
visibility = ["//visibility:public"],
deps = [

View File

@ -1,4 +1,4 @@
package(default_testonly = 1)
package(default_testonly = True)
java_library(
name = "testing",

View File

@ -2,7 +2,7 @@ package(default_visibility = ["//visibility:public"])
java_library(
name = "testing",
testonly = 1,
testonly = True,
srcs = glob(["*.java"]),
deps = [
"//java/com/google/gerrit/common:server",

View File

@ -2,7 +2,7 @@ package(default_visibility = ["//visibility:public"])
java_library(
name = "testing",
testonly = 1,
testonly = True,
srcs = glob(["*.java"]),
deps = [
"//java/com/google/gerrit/common:server",

View File

@ -1,6 +1,6 @@
java_library(
name = "project-test-util",
testonly = 1,
testonly = True,
srcs = glob(["*.java"]),
visibility = ["//visibility:public"],
deps = [

View File

@ -1,6 +1,6 @@
java_library(
name = "gerrit-test-util",
testonly = 1,
testonly = True,
srcs = glob(["**/*.java"]),
visibility = ["//visibility:public"],
exports = [

View File

@ -1,6 +1,6 @@
java_library(
name = "truth",
testonly = 1,
testonly = True,
srcs = glob(["**/*.java"]),
visibility = ["//visibility:public"],
deps = [

View File

@ -12,7 +12,7 @@ acceptance_tests(
java_library(
name = "push_for_review",
testonly = 1,
testonly = True,
srcs = ["AbstractPushForReview.java"],
deps = [
"//java/com/google/gerrit/acceptance:lib",
@ -22,7 +22,7 @@ java_library(
java_library(
name = "submodule_util",
testonly = 1,
testonly = True,
srcs = ["AbstractSubmoduleSubscription.java"],
deps = ["//java/com/google/gerrit/acceptance:lib"],
)

View File

@ -41,7 +41,7 @@ acceptance_tests(
java_library(
name = "util",
testonly = 1,
testonly = True,
srcs = [
"AbstractReindexTests.java",
"IndexUpgradeController.java",

View File

@ -12,7 +12,7 @@ acceptance_tests(
java_library(
name = "util",
testonly = 1,
testonly = True,
srcs = [
"AbstractRestApiBindingsTest.java",
],

View File

@ -9,7 +9,7 @@ acceptance_tests(
java_library(
name = "util",
testonly = 1,
testonly = True,
srcs = [
"AccountAssert.java",
"CapabilityInfo.java",

View File

@ -30,7 +30,7 @@ acceptance_tests(
java_library(
name = "submit_util",
testonly = 1,
testonly = True,
srcs = SUBMIT_UTIL_SRCS,
deps = [
"//java/com/google/gerrit/acceptance:lib",

View File

@ -40,7 +40,7 @@ java_library(
java_library(
name = "push_tag_util",
testonly = 1,
testonly = True,
srcs = [
"AbstractPushTag.java",
],

View File

@ -21,7 +21,7 @@ acceptance_tests(
java_library(
name = "util",
testonly = 1,
testonly = True,
srcs = ["AbstractMailIT.java"],
deps = DEPS + ["//java/com/google/gerrit/acceptance:lib"],
)

View File

@ -2,7 +2,7 @@ load("//javatests/com/google/gerrit/acceptance:tests.bzl", "acceptance_tests")
java_library(
name = "util",
testonly = 1,
testonly = True,
srcs = ["AbstractIndexTests.java"],
deps = ["//java/com/google/gerrit/acceptance:lib"],
)

View File

@ -2,7 +2,7 @@ load("//tools/bzl:junit.bzl", "junit_tests")
java_library(
name = "elasticsearch_test_utils",
testonly = 1,
testonly = True,
srcs = [
"ElasticContainer.java",
"ElasticTestUtils.java",

View File

@ -6,7 +6,7 @@ CUSTOM_TRUTH_SUBJECTS = glob([
java_library(
name = "custom-truth-subjects",
testonly = 1,
testonly = True,
srcs = CUSTOM_TRUTH_SUBJECTS,
deps = [
"//java/com/google/gerrit/extensions:api",

View File

@ -4,7 +4,7 @@ ABSTRACT_QUERY_TEST = ["AbstractQueryAccountsTest.java"]
java_library(
name = "abstract_query_tests",
testonly = 1,
testonly = True,
srcs = ABSTRACT_QUERY_TEST,
visibility = ["//visibility:public"],
deps = [

View File

@ -4,7 +4,7 @@ ABSTRACT_QUERY_TEST = ["AbstractQueryChangesTest.java"]
java_library(
name = "abstract_query_tests",
testonly = 1,
testonly = True,
srcs = ABSTRACT_QUERY_TEST,
visibility = ["//visibility:public"],
runtime_deps = ["//prolog:gerrit-prolog-common"],

View File

@ -4,7 +4,7 @@ ABSTRACT_QUERY_TEST = ["AbstractQueryGroupsTest.java"]
java_library(
name = "abstract_query_tests",
testonly = 1,
testonly = True,
srcs = ABSTRACT_QUERY_TEST,
visibility = ["//visibility:public"],
deps = [

View File

@ -4,7 +4,7 @@ ABSTRACT_QUERY_TEST = ["AbstractQueryProjectsTest.java"]
java_library(
name = "abstract_query_tests",
testonly = 1,
testonly = True,
srcs = ABSTRACT_QUERY_TEST,
visibility = ["//visibility:public"],
deps = [

View File

@ -1,6 +1,6 @@
java_library(
name = "testutil",
testonly = 1,
testonly = True,
srcs = glob(["**/*.java"]),
visibility = ["//visibility:public"],
deps = [

View File

@ -2,7 +2,7 @@ load("//lib/jgit:jgit.bzl", "jgit_dep")
java_library(
name = "junit",
testonly = 1,
testonly = True,
data = ["//lib:LICENSE-DO_NOT_DISTRIBUTE"],
visibility = ["//visibility:public"],
exports = [jgit_dep("@jgit-junit//jar")],

View File

@ -38,7 +38,7 @@ java_library(
java_library(
name = "testcontainers-elasticsearch",
testonly = 1,
testonly = True,
data = ["//lib:LICENSE-testcontainers"],
visibility = ["//visibility:public"],
exports = ["@testcontainers-elasticsearch//jar"],

View File

@ -23,7 +23,7 @@ polygerrit_bundle(
bower_component_bundle(
name = "test_components",
testonly = 1,
testonly = True,
deps = [
"//lib/js:iron-test-helpers",
"//lib/js:test-fixture",

View File

@ -37,13 +37,13 @@ DEPS = [
java_library(
name = "classpath",
testonly = 1,
testonly = True,
runtime_deps = LIBS + PGMLIBS + DEPS,
)
classpath_collector(
name = "main_classpath_collect",
testonly = 1,
testonly = True,
deps = LIBS + PGMLIBS + DEPS + TEST_DEPS +
["//plugins/%s:%s__plugin" % (n, n) for n in CORE_PLUGINS + CUSTOM_PLUGINS] +
["//plugins/%s:%s__plugin_test_deps" % (n, n) for n in CUSTOM_PLUGINS_TEST_DEPS],

View File

@ -50,7 +50,7 @@ def maven_package(
srcs = api_targets,
outs = ["api_install.sh"],
executable = True,
testonly = 1,
testonly = True,
)
if repository and url:
@ -70,7 +70,7 @@ def maven_package(
srcs = api_targets,
outs = ["api_deploy.sh"],
executable = True,
testonly = 1,
testonly = True,
)
war_cmd = mvn_cmd[:]