|
| 1 | +name: Solr Core Tests |
| 2 | + |
| 3 | +# solr/core is most of the whole test suite, so it is split into four slices by |
| 4 | +# Java package that run in parallel. The slices are balanced from measured CI |
| 5 | +# timings: the cloud package alone is the largest unit in solr/core and sets |
| 6 | +# the critical path, so its api and overseer sub-packages run in the search |
| 7 | +# slice instead. The "other" slice is exclusion-based so that a new package |
| 8 | +# can never silently fall outside every slice. |
| 9 | + |
| 10 | +on: |
| 11 | + pull_request: |
| 12 | + branches: |
| 13 | + - '*' |
| 14 | + paths: |
| 15 | + - '.github/workflows/tests-core.yml' |
| 16 | + - 'gradle/libs.versions.toml' |
| 17 | + - 'solr/core/**' |
| 18 | + - 'solr/solrj-zookeeper/**' |
| 19 | + # core tests are built on these; a change here can break them |
| 20 | + - 'solr/test-framework/**' |
| 21 | + - 'solr/api/**' |
| 22 | + - 'solr/solrj/**' |
| 23 | + - 'solr/solrj-jetty/**' |
| 24 | + - 'solr/solrj-streaming/**' |
| 25 | + |
| 26 | +concurrency: |
| 27 | + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} |
| 28 | + cancel-in-progress: true |
| 29 | + |
| 30 | +jobs: |
| 31 | + test: |
| 32 | + name: Run Solr Core Tests (${{ matrix.slice }}) |
| 33 | + |
| 34 | + runs-on: ubuntu-latest |
| 35 | + timeout-minutes: 25 |
| 36 | + |
| 37 | + strategy: |
| 38 | + fail-fast: false |
| 39 | + matrix: |
| 40 | + slice: [cloud, search, handler, other] |
| 41 | + |
| 42 | + env: |
| 43 | + # Top-level packages under org.apache.solr for each named slice. |
| 44 | + # The "other" slice runs everything not listed here. |
| 45 | + SLICE_CLOUD: cloud |
| 46 | + SLICE_SEARCH: search uninverting spelling highlight analysis legacy index parser request cloud.api cloud.overseer |
| 47 | + SLICE_HANDLER: handler response servlet jersey rest security api |
| 48 | + |
| 49 | + steps: |
| 50 | + - name: Checkout code |
| 51 | + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 52 | + |
| 53 | + - uses: ./.github/actions/prepare-for-build |
| 54 | + |
| 55 | + - name: Test solr/core slice "${{ matrix.slice }}" |
| 56 | + run: | |
| 57 | + tasks=(:solr:core:test) |
| 58 | + args=() |
| 59 | + case "${{ matrix.slice }}" in |
| 60 | + cloud) |
| 61 | + pkgs="$SLICE_CLOUD" |
| 62 | + args+=("-Ptests.exclude=org.apache.solr.cloud.api.*,org.apache.solr.cloud.overseer.*") |
| 63 | + ;; |
| 64 | + search) pkgs="$SLICE_SEARCH" ;; |
| 65 | + handler) pkgs="$SLICE_HANDLER" ;; |
| 66 | + other) |
| 67 | + # This slice has the most headroom, so it also runs solrj-zookeeper. |
| 68 | + # It passes no --tests, so one invocation can drive both test tasks, |
| 69 | + # and the excluded packages do not overlap solrj-zookeeper's tests. |
| 70 | + pkgs="" |
| 71 | + tasks+=(:solr:solrj-zookeeper:test) |
| 72 | + excl="" |
| 73 | + for p in $SLICE_CLOUD $SLICE_SEARCH $SLICE_HANDLER; do |
| 74 | + excl="${excl:+$excl,}org.apache.solr.$p.*" |
| 75 | + done |
| 76 | + args+=("-Ptests.exclude=$excl") |
| 77 | + ;; |
| 78 | + esac |
| 79 | + for p in $pkgs; do |
| 80 | + args+=(--tests "org.apache.solr.$p.*") |
| 81 | + done |
| 82 | + ./gradlew "${tasks[@]}" -Ptests.jvms=2 "${args[@]}" |
| 83 | +
|
| 84 | + - name: Archive test output |
| 85 | + if: ${{ failure() }} |
| 86 | + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 |
| 87 | + with: |
| 88 | + name: test-output-core-${{ matrix.slice }} |
| 89 | + path: | |
| 90 | + solr/core/build/test-results/** |
| 91 | + solr/solrj-zookeeper/build/test-results/** |
0 commit comments