10f6ddb37SDavid Ostrovskyload( 20f6ddb37SDavid Ostrovsky "@com_googlesource_gerrit_bazlets//tools:junit.bzl", 30f6ddb37SDavid Ostrovsky "junit_tests", 40f6ddb37SDavid Ostrovsky) 50f6ddb37SDavid Ostrovsky 60f6ddb37SDavid Ostrovskydef tests(tests): 70f6ddb37SDavid Ostrovsky for src in tests: 8487571e6SDavid Pursehouse name = src[len("tst/"):len(src) - len(".java")].replace("/", "_") 90f6ddb37SDavid Ostrovsky labels = [] 10*d8429d27SMatthias Sohn timeout = "moderate" 11487571e6SDavid Pursehouse if name.startswith("org_eclipse_jgit_"): 12487571e6SDavid Pursehouse l = name[len("org.eclipse.jgit_"):] 13487571e6SDavid Pursehouse if l.startswith("internal_storage_"): 14487571e6SDavid Pursehouse l = l[len("internal.storage_"):] 15487571e6SDavid Pursehouse i = l.find("_") 160f6ddb37SDavid Ostrovsky if i > 0: 170f6ddb37SDavid Ostrovsky labels.append(l[:i]) 180f6ddb37SDavid Ostrovsky else: 190f6ddb37SDavid Ostrovsky labels.append(i) 20487571e6SDavid Pursehouse if "lib" not in labels: 21487571e6SDavid Pursehouse labels.append("lib") 220f6ddb37SDavid Ostrovsky 236efedb41SJonathan Nieder # TODO(http://eclip.se/534285): Make this test pass reliably 246efedb41SJonathan Nieder # and remove the flaky attribute. 256efedb41SJonathan Nieder flaky = src.endswith("CrissCrossMergeTest.java") 266efedb41SJonathan Nieder 270f6ddb37SDavid Ostrovsky additional_deps = [] 280f6ddb37SDavid Ostrovsky if src.endswith("RootLocaleTest.java"): 290f6ddb37SDavid Ostrovsky additional_deps = [ 30487571e6SDavid Pursehouse "//org.eclipse.jgit.pgm:pgm", 31487571e6SDavid Pursehouse "//org.eclipse.jgit.ui:ui", 320f6ddb37SDavid Ostrovsky ] 330f6ddb37SDavid Ostrovsky if src.endswith("WalkEncryptionTest.java"): 340f6ddb37SDavid Ostrovsky additional_deps = [ 35487571e6SDavid Pursehouse "//org.eclipse.jgit:insecure_cipher_factory", 360f6ddb37SDavid Ostrovsky ] 37c506f8d2SThomas Wolf if src.endswith("OpenSshConfigTest.java"): 38c506f8d2SThomas Wolf additional_deps = [ 39a074203fSDavid Pursehouse "//lib:jsch", 40c506f8d2SThomas Wolf ] 4189110360SThomas Wolf if src.endswith("JschConfigSessionFactoryTest.java"): 4289110360SThomas Wolf additional_deps = [ 43a074203fSDavid Pursehouse "//lib:jsch", 4489110360SThomas Wolf ] 4508b0a863SThomas Wolf if src.endswith("JSchSshTest.java"): 4608b0a863SThomas Wolf additional_deps = [ 4708b0a863SThomas Wolf "//lib:jsch", 4808b0a863SThomas Wolf "//lib:jzlib", 4986cee68eSThomas Wolf "//lib:sshd-osgi", 5008b0a863SThomas Wolf "//lib:sshd-sftp", 51488d9557SThomas Wolf ":sshd-helpers", 5208b0a863SThomas Wolf ] 532532fa74SMatthias Sohn if src.endswith("JDKHttpConnectionTest.java"): 542532fa74SMatthias Sohn additional_deps = [ 552532fa74SMatthias Sohn "//lib:mockito", 562532fa74SMatthias Sohn ] 579f696567SDavid Pursehouse if src.endswith("TransportHttpTest.java"): 589f696567SDavid Pursehouse additional_deps = [ 599f696567SDavid Pursehouse "//lib:mockito", 609f696567SDavid Pursehouse ] 61621880bcSThomas Wolf heap_size = "-Xmx256m" 62621880bcSThomas Wolf if src.endswith("HugeCommitMessageTest.java"): 63621880bcSThomas Wolf heap_size = "-Xmx512m" 64*d8429d27SMatthias Sohn if src.endswith("EolRepositoryTest.java") or src.endswith("GcCommitSelectionTest.java"): 65*d8429d27SMatthias Sohn timeout = "long" 66621880bcSThomas Wolf 670f6ddb37SDavid Ostrovsky junit_tests( 680f6ddb37SDavid Ostrovsky name = name, 690f6ddb37SDavid Ostrovsky tags = labels, 700f6ddb37SDavid Ostrovsky srcs = [src], 710f6ddb37SDavid Ostrovsky deps = additional_deps + [ 72487571e6SDavid Pursehouse ":helpers", 73487571e6SDavid Pursehouse ":tst_rsrc", 74487571e6SDavid Pursehouse "//lib:javaewah", 75487571e6SDavid Pursehouse "//lib:junit", 76487571e6SDavid Pursehouse "//lib:slf4j-api", 77487571e6SDavid Pursehouse "//org.eclipse.jgit:jgit", 78487571e6SDavid Pursehouse "//org.eclipse.jgit.junit:junit", 79487571e6SDavid Pursehouse "//org.eclipse.jgit.lfs:jgit-lfs", 800f6ddb37SDavid Ostrovsky ], 816efedb41SJonathan Nieder flaky = flaky, 82621880bcSThomas Wolf jvm_flags = [heap_size, "-Dfile.encoding=UTF-8"], 83*d8429d27SMatthias Sohn timeout = timeout, 840f6ddb37SDavid Ostrovsky ) 85