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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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("ArchiveCommandTest.java"):
  42. additional_deps = [
  43. "//lib:commons-compress",
  44. "//lib:xz",
  45. "//org.eclipse.jgit.archive:jgit-archive",
  46. ]
  47. heap_size = "-Xmx256m"
  48. if src.endswith("HugeCommitMessageTest.java"):
  49. heap_size = "-Xmx512m"
  50. junit_tests(
  51. name = name,
  52. tags = labels,
  53. srcs = [src],
  54. deps = additional_deps + [
  55. ":helpers",
  56. ":tst_rsrc",
  57. "//lib:javaewah",
  58. "//lib:junit",
  59. "//lib:slf4j-api",
  60. "//org.eclipse.jgit:jgit",
  61. "//org.eclipse.jgit.junit:junit",
  62. "//org.eclipse.jgit.lfs:jgit-lfs",
  63. ],
  64. flaky = flaky,
  65. jvm_flags = [heap_size, "-Dfile.encoding=UTF-8"],
  66. )