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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. if src.endswith("JDKHttpConnectionTest.java"):
  50. additional_deps = [
  51. "//lib:mockito",
  52. ]
  53. heap_size = "-Xmx256m"
  54. if src.endswith("HugeCommitMessageTest.java"):
  55. heap_size = "-Xmx512m"
  56. junit_tests(
  57. name = name,
  58. tags = labels,
  59. srcs = [src],
  60. deps = additional_deps + [
  61. ":helpers",
  62. ":tst_rsrc",
  63. "//lib:javaewah",
  64. "//lib:junit",
  65. "//lib:slf4j-api",
  66. "//org.eclipse.jgit:jgit",
  67. "//org.eclipse.jgit.junit:junit",
  68. "//org.eclipse.jgit.lfs:jgit-lfs",
  69. ],
  70. flaky = flaky,
  71. jvm_flags = [heap_size, "-Dfile.encoding=UTF-8"],
  72. )