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 3.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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("OpenSshConfigTest.java"):
  35. additional_deps = [
  36. "//lib:jsch",
  37. ]
  38. if src.endswith("JschConfigSessionFactoryTest.java"):
  39. additional_deps = [
  40. "//lib:jsch",
  41. ]
  42. if src.endswith("SecurityManagerMissingPermissionsTest.java"):
  43. additional_deps = [
  44. "//lib:log4j",
  45. ]
  46. if src.endswith("JSchSshTest.java"):
  47. additional_deps = [
  48. "//lib:jsch",
  49. "//lib:jzlib",
  50. "//lib:sshd-osgi",
  51. "//lib:sshd-sftp",
  52. ":sshd-helpers",
  53. ]
  54. if src.endswith("JDKHttpConnectionTest.java"):
  55. additional_deps = [
  56. "//lib:mockito",
  57. ]
  58. if src.endswith("TransportHttpTest.java"):
  59. additional_deps = [
  60. "//lib:mockito",
  61. ]
  62. if src.endswith("ArchiveCommandTest.java"):
  63. additional_deps = [
  64. "//lib:commons-compress",
  65. "//lib:xz",
  66. "//org.eclipse.jgit.archive:jgit-archive",
  67. ]
  68. heap_size = "-Xmx256m"
  69. if src.endswith("HugeCommitMessageTest.java"):
  70. heap_size = "-Xmx512m"
  71. if src.endswith("EolRepositoryTest.java") or src.endswith("GcCommitSelectionTest.java"):
  72. timeout = "long"
  73. junit_tests(
  74. name = name,
  75. tags = labels,
  76. srcs = [src],
  77. deps = additional_deps + [
  78. ":helpers",
  79. ":tst_rsrc",
  80. "//lib:javaewah",
  81. "//lib:junit",
  82. "//lib:slf4j-api",
  83. "//org.eclipse.jgit:jgit",
  84. "//org.eclipse.jgit.junit:junit",
  85. "//org.eclipse.jgit.lfs:jgit-lfs",
  86. ],
  87. flaky = flaky,
  88. jvm_flags = [heap_size, "-Dfile.encoding=UTF-8"],
  89. timeout = timeout,
  90. )