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 = [] 10487571e6SDavid Pursehouse if name.startswith("org_eclipse_jgit_"): 11487571e6SDavid Pursehouse l = name[len("org.eclipse.jgit_"):] 12487571e6SDavid Pursehouse if l.startswith("internal_storage_"): 13487571e6SDavid Pursehouse l = l[len("internal.storage_"):] 14487571e6SDavid Pursehouse i = l.find("_") 150f6ddb37SDavid Ostrovsky if i > 0: 160f6ddb37SDavid Ostrovsky labels.append(l[:i]) 170f6ddb37SDavid Ostrovsky else: 180f6ddb37SDavid Ostrovsky labels.append(i) 19487571e6SDavid Pursehouse if "lib" not in labels: 20487571e6SDavid Pursehouse labels.append("lib") 210f6ddb37SDavid Ostrovsky 226efedb41SJonathan Nieder # TODO(http://eclip.se/534285): Make this test pass reliably 236efedb41SJonathan Nieder # and remove the flaky attribute. 246efedb41SJonathan Nieder flaky = src.endswith("CrissCrossMergeTest.java") 256efedb41SJonathan Nieder 260f6ddb37SDavid Ostrovsky additional_deps = [] 270f6ddb37SDavid Ostrovsky if src.endswith("RootLocaleTest.java"): 280f6ddb37SDavid Ostrovsky additional_deps = [ 29487571e6SDavid Pursehouse "//org.eclipse.jgit.pgm:pgm", 30487571e6SDavid Pursehouse "//org.eclipse.jgit.ui:ui", 310f6ddb37SDavid Ostrovsky ] 320f6ddb37SDavid Ostrovsky if src.endswith("WalkEncryptionTest.java"): 330f6ddb37SDavid Ostrovsky additional_deps = [ 34487571e6SDavid Pursehouse "//org.eclipse.jgit:insecure_cipher_factory", 350f6ddb37SDavid Ostrovsky ] 36c506f8d2SThomas Wolf if src.endswith("OpenSshConfigTest.java"): 37c506f8d2SThomas Wolf additional_deps = [ 38a074203fSDavid Pursehouse "//lib:jsch", 39c506f8d2SThomas Wolf ] 4089110360SThomas Wolf if src.endswith("JschConfigSessionFactoryTest.java"): 4189110360SThomas Wolf additional_deps = [ 42a074203fSDavid Pursehouse "//lib:jsch", 4389110360SThomas Wolf ] 4408b0a863SThomas Wolf if src.endswith("JSchSshTest.java"): 4508b0a863SThomas Wolf additional_deps = [ 4608b0a863SThomas Wolf "//lib:jsch", 4708b0a863SThomas Wolf "//lib:jzlib", 4886cee68eSThomas Wolf "//lib:sshd-osgi", 4908b0a863SThomas Wolf "//lib:sshd-sftp", 50488d9557SThomas Wolf ":sshd-helpers", 5108b0a863SThomas Wolf ] 522532fa74SMatthias Sohn if src.endswith("JDKHttpConnectionTest.java"): 532532fa74SMatthias Sohn additional_deps = [ 542532fa74SMatthias Sohn "//lib:mockito", 552532fa74SMatthias Sohn ] 56*9f696567SDavid Pursehouse if src.endswith("TransportHttpTest.java"): 57*9f696567SDavid Pursehouse additional_deps = [ 58*9f696567SDavid Pursehouse "//lib:mockito", 59*9f696567SDavid Pursehouse ] 60621880bcSThomas Wolf heap_size = "-Xmx256m" 61621880bcSThomas Wolf if src.endswith("HugeCommitMessageTest.java"): 62621880bcSThomas Wolf heap_size = "-Xmx512m" 63621880bcSThomas Wolf 640f6ddb37SDavid Ostrovsky junit_tests( 650f6ddb37SDavid Ostrovsky name = name, 660f6ddb37SDavid Ostrovsky tags = labels, 670f6ddb37SDavid Ostrovsky srcs = [src], 680f6ddb37SDavid Ostrovsky deps = additional_deps + [ 69487571e6SDavid Pursehouse ":helpers", 70487571e6SDavid Pursehouse ":tst_rsrc", 71487571e6SDavid Pursehouse "//lib:javaewah", 72487571e6SDavid Pursehouse "//lib:junit", 73487571e6SDavid Pursehouse "//lib:slf4j-api", 74487571e6SDavid Pursehouse "//org.eclipse.jgit:jgit", 75487571e6SDavid Pursehouse "//org.eclipse.jgit.junit:junit", 76487571e6SDavid Pursehouse "//org.eclipse.jgit.lfs:jgit-lfs", 770f6ddb37SDavid Ostrovsky ], 786efedb41SJonathan Nieder flaky = flaky, 79621880bcSThomas Wolf jvm_flags = [heap_size, "-Dfile.encoding=UTF-8"], 800f6ddb37SDavid Ostrovsky ) 81