Browse Source

Merge branch 'stable-5.1'

* stable-5.1:
  Bazel: Use hyphen instead of underscore in external repository names
  Bazel: Format all build files with buildifier 0.15.0
  ChangeIdUtilTest: Remove unused notestCommitDashV

Change-Id: Ie9d77a7716591246b87fb59ac85214417fe8309d
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
stable-5.2
David Pursehouse 6 years ago
parent
commit
6196eb6825
  1. 110
      org.eclipse.jgit.test/tests.bzl
  2. 27
      tools/bazlets.bzl

110
org.eclipse.jgit.test/tests.bzl

@ -4,62 +4,62 @@ load(
) )
def tests(tests): def tests(tests):
for src in tests: for src in tests:
name = src[len('tst/'):len(src)-len('.java')].replace('/', '_') name = src[len("tst/"):len(src) - len(".java")].replace("/", "_")
labels = [] labels = []
if name.startswith('org_eclipse_jgit_'): if name.startswith("org_eclipse_jgit_"):
l = name[len('org.eclipse.jgit_'):] l = name[len("org.eclipse.jgit_"):]
if l.startswith('internal_storage_'): if l.startswith("internal_storage_"):
l = l[len('internal.storage_'):] l = l[len("internal.storage_"):]
i = l.find('_') i = l.find("_")
if i > 0: if i > 0:
labels.append(l[:i]) labels.append(l[:i])
else: else:
labels.append(i) labels.append(i)
if 'lib' not in labels: if "lib" not in labels:
labels.append('lib') labels.append("lib")
# TODO(http://eclip.se/534285): Make this test pass reliably # TODO(http://eclip.se/534285): Make this test pass reliably
# and remove the flaky attribute. # and remove the flaky attribute.
flaky = src.endswith("CrissCrossMergeTest.java") flaky = src.endswith("CrissCrossMergeTest.java")
additional_deps = [] additional_deps = []
if src.endswith("RootLocaleTest.java"): if src.endswith("RootLocaleTest.java"):
additional_deps = [ additional_deps = [
'//org.eclipse.jgit.pgm:pgm', "//org.eclipse.jgit.pgm:pgm",
'//org.eclipse.jgit.ui:ui', "//org.eclipse.jgit.ui:ui",
] ]
if src.endswith("WalkEncryptionTest.java"): if src.endswith("WalkEncryptionTest.java"):
additional_deps = [ additional_deps = [
'//org.eclipse.jgit:insecure_cipher_factory', "//org.eclipse.jgit:insecure_cipher_factory",
] ]
if src.endswith("OpenSshConfigTest.java"): if src.endswith("OpenSshConfigTest.java"):
additional_deps = [ additional_deps = [
'//lib:jsch', "//lib:jsch",
] ]
if src.endswith("JschConfigSessionFactoryTest.java"): if src.endswith("JschConfigSessionFactoryTest.java"):
additional_deps = [ additional_deps = [
'//lib:jsch', "//lib:jsch",
] ]
heap_size = "-Xmx256m" heap_size = "-Xmx256m"
if src.endswith("HugeCommitMessageTest.java"): if src.endswith("HugeCommitMessageTest.java"):
heap_size = "-Xmx512m" heap_size = "-Xmx512m"
junit_tests( junit_tests(
name = name, name = name,
tags = labels, tags = labels,
srcs = [src], srcs = [src],
deps = additional_deps + [ deps = additional_deps + [
':helpers', ":helpers",
':tst_rsrc', ":tst_rsrc",
'//lib:javaewah', "//lib:javaewah",
'//lib:junit', "//lib:junit",
'//lib:slf4j-api', "//lib:slf4j-api",
'//org.eclipse.jgit:jgit', "//org.eclipse.jgit:jgit",
'//org.eclipse.jgit.junit:junit', "//org.eclipse.jgit.junit:junit",
'//org.eclipse.jgit.lfs:jgit-lfs', "//org.eclipse.jgit.lfs:jgit-lfs",
], ],
flaky = flaky, flaky = flaky,
jvm_flags = [heap_size, "-Dfile.encoding=UTF-8"], jvm_flags = [heap_size, "-Dfile.encoding=UTF-8"],
) )

27
tools/bazlets.bzl

@ -1,17 +1,16 @@
NAME = "com_googlesource_gerrit_bazlets" NAME = "com_googlesource_gerrit_bazlets"
def load_bazlets( def load_bazlets(
commit, commit,
local_path = None local_path = None):
): if not local_path:
if not local_path: native.git_repository(
native.git_repository( name = NAME,
name = NAME, remote = "https://gerrit.googlesource.com/bazlets",
remote = "https://gerrit.googlesource.com/bazlets", commit = commit,
commit = commit, )
) else:
else: native.local_repository(
native.local_repository( name = NAME,
name = NAME, path = local_path,
path = local_path, )
)

Loading…
Cancel
Save