clt_tests.yml 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. name: CLT tests
  2. on:
  3. workflow_call:
  4. inputs:
  5. docker_image:
  6. required: true
  7. type: string
  8. description: "Docker image to use for tests"
  9. artifact_name:
  10. required: false
  11. type: string
  12. description: "Name of the docker image artifact"
  13. repository:
  14. required: false
  15. type: string
  16. description: "Repository to checkout"
  17. ref:
  18. required: false
  19. type: string
  20. description: "Ref to checkout"
  21. continue_on_error:
  22. required: false
  23. type: boolean
  24. description: "Continue on error"
  25. default: false
  26. secrets:
  27. OPENAI_API_KEY:
  28. required: true
  29. description: "OpenAI API key for CLT tests"
  30. VOYAGE_API_KEY:
  31. required: true
  32. description: "Voyage API key for CLT tests"
  33. JINA_API_KEY:
  34. required: true
  35. description: "Jina API key for CLT tests"
  36. jobs:
  37. discover:
  38. name: Discover CLT tests
  39. runs-on: ubuntu-22.04
  40. outputs:
  41. matrix: ${{ steps.build.outputs.matrix }}
  42. steps:
  43. - uses: actions/checkout@v4
  44. with:
  45. repository: ${{ inputs.repository }}
  46. ref: ${{ inputs.ref }}
  47. - id: build
  48. name: Build matrix
  49. shell: bash
  50. run: |
  51. set -euo pipefail
  52. python3 - <<'PY'
  53. import json
  54. import os
  55. import pathlib
  56. roots = [
  57. "test/clt-tests/buddy",
  58. "test/clt-tests/buddy-plugins",
  59. "test/clt-tests/bugs",
  60. "test/clt-tests/core",
  61. "test/clt-tests/data-manipulation",
  62. "test/clt-tests/expected-errors",
  63. "test/clt-tests/fulltext-search",
  64. "test/clt-tests/mcl",
  65. "test/clt-tests/http-interface",
  66. "test/clt-tests/indexer",
  67. "test/clt-tests/join",
  68. "test/clt-tests/kibana",
  69. "test/clt-tests/mysqldump/mysql",
  70. "test/clt-tests/mysqldump/maria",
  71. "test/clt-tests/performance",
  72. "test/clt-tests/replication",
  73. "test/clt-tests/sharding/cluster",
  74. "test/clt-tests/sharding/functional",
  75. "test/clt-tests/sharding/replication",
  76. "test/clt-tests/sharding/syntax",
  77. "test/clt-tests/test-configuration",
  78. "test/clt-tests/vector-knn",
  79. ]
  80. tests = []
  81. for root in roots:
  82. root_path = pathlib.Path(root)
  83. if not root_path.exists():
  84. continue
  85. for path in sorted(root_path.glob("*.rec")):
  86. # clt appends "*.rec" to the prefix; strip the suffix to avoid ".rec*.rec"
  87. tests.append(str(path.with_suffix("")))
  88. total_jobs = 20
  89. if not tests:
  90. matrix = {"chunk": []}
  91. else:
  92. size = (len(tests) + total_jobs - 1) // total_jobs
  93. chunks = []
  94. for i in range(0, len(tests), size):
  95. group = tests[i : i + size]
  96. chunks.append(
  97. {
  98. "id": len(chunks),
  99. "tests": group,
  100. "test_prefix": "\n".join(group),
  101. }
  102. )
  103. matrix = {"chunk": chunks}
  104. print(f"Found {len(tests)} .rec tests across {len(matrix['chunk'])} jobs")
  105. output_path = os.environ["GITHUB_OUTPUT"]
  106. with open(output_path, "a", encoding="utf-8") as fh:
  107. fh.write(f"matrix={json.dumps(matrix)}\n")
  108. PY
  109. clt:
  110. name: CLT
  111. needs: [discover]
  112. runs-on: ubuntu-22.04
  113. timeout-minutes: 30
  114. continue-on-error: ${{ inputs.continue_on_error }}
  115. env:
  116. OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
  117. VOYAGE_API_KEY: ${{ secrets.VOYAGE_API_KEY }}
  118. JINA_API_KEY: ${{ secrets.JINA_API_KEY }}
  119. strategy:
  120. fail-fast: false
  121. matrix: ${{ fromJson(needs.discover.outputs.matrix) }}
  122. steps:
  123. - uses: manticoresoftware/[email protected]
  124. with:
  125. artifact: ${{ inputs.artifact_name }}
  126. image: ${{ inputs.docker_image }}
  127. repository: ${{ inputs.repository }}
  128. ref: ${{ inputs.ref }}
  129. test_prefix: ${{ matrix.chunk.test_prefix }}
  130. comment_mode: failures
  131. run_args: "-e OPENAI_API_KEY -e VOYAGE_API_KEY -e JINA_API_KEY"
  132. ui_host: "https://clt.manticoresearch.com"