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.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. timeout = "moderate"
  10. if name.startswith("org_eclipse_jgit_"):
  11. package = name[len("org.eclipse.jgit_"):]
  12. if package.startswith("internal_storage_"):
  13. package = package[len("internal.storage_"):]
  14. index = package.find("_")
  15. if index > 0:
  16. labels.append(package[:index])
  17. else:
  18. labels.append(index)
  19. if "lib" not in labels:
  20. labels.append("lib")
  21. # TODO(http://eclip.se/534285): Make this test pass reliably
  22. # and remove the flaky attribute.
  23. flaky = src.endswith("CrissCrossMergeTest.java")
  24. additional_deps = []
  25. if src.endswith("RootLocaleTest.java"):
  26. additional_deps = [
  27. "//org.eclipse.jgit.pgm:pgm",
  28. "//org.eclipse.jgit.ui:ui",
  29. ]
  30. if src.endswith("WalkEncryptionTest.java"):
  31. additional_deps = [
  32. "//org.eclipse.jgit:insecure_cipher_factory",
  33. ]
  34. if src.endswith("SecurityManagerMissingPermissionsTest.java"):
  35. additional_deps = [
  36. "//lib:log4j",
  37. ]
  38. if src.endswith("JDKHttpConnectionTest.java"):
  39. additional_deps = [
  40. "//lib:mockito",
  41. ]
  42. if src.endswith("TransportHttpTest.java"):
  43. additional_deps = [
  44. "//lib:mockito",
  45. ]
  46. if src.endswith("ArchiveCommandTest.java"):
  47. additional_deps = [
  48. "//lib:commons-compress",
  49. "//lib:xz",
  50. "//org.eclipse.jgit.archive:jgit-archive",
  51. ]
  52. heap_size = "-Xmx256m"
  53. if src.endswith("HugeCommitMessageTest.java"):
  54. heap_size = "-Xmx512m"
  55. if src.endswith("EolRepositoryTest.java") or src.endswith("GcCommitSelectionTest.java"):
  56. timeout = "long"
  57. junit_tests(
  58. name = name,
  59. tags = labels,
  60. srcs = [src],
  61. deps = additional_deps + [
  62. ":helpers",
  63. ":tst_rsrc",
  64. "//lib:javaewah",
  65. "//lib:junit",
  66. "//lib:slf4j-api",
  67. "//org.eclipse.jgit:jgit",
  68. "//org.eclipse.jgit.junit:junit",
  69. "//org.eclipse.jgit.lfs:jgit-lfs",
  70. ],
  71. flaky = flaky,
  72. jvm_flags = [heap_size, "-Dfile.encoding=UTF-8"],
  73. timeout = timeout,
  74. )