You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

tests.bzl 2.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. load(
  2. "@com_googlesource_gerrit_bazlets//tools:junit.bzl",
  3. "junit_tests",
  4. )
  5. def tests(tests):
  6. for src in tests:
  7. name = src[len("tst/"):len(src) - len(".java")].replace("/", "_")
  8. labels = []
  9. if name.startswith("org_eclipse_jgit_"):
  10. l = name[len("org.eclipse.jgit_"):]
  11. if l.startswith("internal_storage_"):
  12. l = l[len("internal.storage_"):]
  13. i = l.find("_")
  14. if i > 0:
  15. labels.append(l[:i])
  16. else:
  17. labels.append(i)
  18. if "lib" not in labels:
  19. labels.append("lib")
  20. # TODO(http://eclip.se/534285): Make this test pass reliably
  21. # and remove the flaky attribute.
  22. flaky = src.endswith("CrissCrossMergeTest.java")
  23. additional_deps = []
  24. if src.endswith("RootLocaleTest.java"):
  25. additional_deps = [
  26. "//org.eclipse.jgit.pgm:pgm",
  27. "//org.eclipse.jgit.ui:ui",
  28. ]
  29. if src.endswith("WalkEncryptionTest.java"):
  30. additional_deps = [
  31. "//org.eclipse.jgit:insecure_cipher_factory",
  32. ]
  33. if src.endswith("OpenSshConfigTest.java"):
  34. additional_deps = [
  35. "//lib:jsch",
  36. ]
  37. if src.endswith("JschConfigSessionFactoryTest.java"):
  38. additional_deps = [
  39. "//lib:jsch",
  40. ]
  41. if src.endswith("JSchSshTest.java"):
  42. additional_deps = [
  43. "//lib:jsch",
  44. "//lib:jzlib",
  45. "//lib:sshd-core",
  46. "//lib:sshd-sftp",
  47. ":sshd-helpers",
  48. ]
  49. heap_size = "-Xmx256m"
  50. if src.endswith("HugeCommitMessageTest.java"):
  51. heap_size = "-Xmx512m"
  52. junit_tests(
  53. name = name,
  54. tags = labels,
  55. srcs = [src],
  56. deps = additional_deps + [
  57. ":helpers",
  58. ":tst_rsrc",
  59. "//lib:javaewah",
  60. "//lib:junit",
  61. "//lib:slf4j-api",
  62. "//org.eclipse.jgit:jgit",
  63. "//org.eclipse.jgit.junit:junit",
  64. "//org.eclipse.jgit.lfs:jgit-lfs",
  65. ],
  66. flaky = flaky,
  67. jvm_flags = [heap_size, "-Dfile.encoding=UTF-8"],
  68. )