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( genrule2(
name = "api", name = "api",
testonly = 1, testonly = True,
srcs = API_DEPS, srcs = API_DEPS,
outs = ["api.zip"], outs = ["api.zip"],
cmd = " && ".join([ cmd = " && ".join([

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -37,13 +37,13 @@ DEPS = [
java_library( java_library(
name = "classpath", name = "classpath",
testonly = 1, testonly = True,
runtime_deps = LIBS + PGMLIBS + DEPS, runtime_deps = LIBS + PGMLIBS + DEPS,
) )
classpath_collector( classpath_collector(
name = "main_classpath_collect", name = "main_classpath_collect",
testonly = 1, testonly = True,
deps = LIBS + PGMLIBS + DEPS + TEST_DEPS + deps = LIBS + PGMLIBS + DEPS + TEST_DEPS +
["//plugins/%s:%s__plugin" % (n, n) for n in CORE_PLUGINS + CUSTOM_PLUGINS] + ["//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], ["//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, srcs = api_targets,
outs = ["api_install.sh"], outs = ["api_install.sh"],
executable = True, executable = True,
testonly = 1, testonly = True,
) )
if repository and url: if repository and url:
@ -70,7 +70,7 @@ def maven_package(
srcs = api_targets, srcs = api_targets,
outs = ["api_deploy.sh"], outs = ["api_deploy.sh"],
executable = True, executable = True,
testonly = 1, testonly = True,
) )
war_cmd = mvn_cmd[:] war_cmd = mvn_cmd[:]