Skip to content

Commit ad81444

Browse files
authored
Replace Crave with parallel test workflows (#5354)
1 parent 4890215 commit ad81444

12 files changed

Lines changed: 341 additions & 106 deletions

‎.github/workflows/gradle-extraction-check.yml‎

Lines changed: 0 additions & 29 deletions
This file was deleted.

‎.github/workflows/solrj-test.yml‎

Lines changed: 0 additions & 29 deletions
This file was deleted.

‎.github/workflows/tests-core.yml‎

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
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/**
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Extraction Module Tests
2+
3+
# The extraction module tests need Docker for the TikaServer tests of SolrCell,
4+
# so they get a workflow of their own.
5+
6+
on:
7+
pull_request:
8+
branches:
9+
- '*'
10+
paths:
11+
- '.github/workflows/tests-extraction.yml'
12+
- 'gradle/libs.versions.toml'
13+
- 'solr/modules/extraction/**'
14+
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
17+
cancel-in-progress: true
18+
19+
jobs:
20+
test:
21+
name: Run Extraction Module Tests
22+
23+
runs-on: ubuntu-latest
24+
timeout-minutes: 15
25+
26+
steps:
27+
- name: Checkout code
28+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
29+
30+
- uses: ./.github/actions/prepare-for-build
31+
32+
- name: Run extraction module tests
33+
run: ./gradlew --no-daemon :solr:modules:extraction:check
34+
35+
- name: Archive test output
36+
if: ${{ failure() }}
37+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
38+
with:
39+
name: test-output-extraction
40+
path: |
41+
solr/modules/extraction/build/test-results/**

‎.github/workflows/tests-misc.yml‎

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Misc Tests
2+
3+
# Small test suites that do not belong to any other tests-* workflow.
4+
5+
on:
6+
pull_request:
7+
branches:
8+
- '*'
9+
paths:
10+
- '.github/workflows/tests-misc.yml'
11+
- 'gradle/libs.versions.toml'
12+
- 'solr/benchmark/**'
13+
- 'solr/test-framework/**'
14+
- 'solr/solr-ref-guide/modules/*/examples/**'
15+
16+
concurrency:
17+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
18+
cancel-in-progress: true
19+
20+
jobs:
21+
test:
22+
name: Run Misc Tests
23+
24+
runs-on: ubuntu-latest
25+
timeout-minutes: 15
26+
27+
steps:
28+
- name: Checkout code
29+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
30+
31+
- uses: ./.github/actions/prepare-for-build
32+
33+
- name: Test the test-framework, benchmark and ref-guide example code
34+
run: ./gradlew :solr:test-framework:test :solr:benchmark:test :solr:solr-ref-guide:test
35+
36+
- name: Archive test output
37+
if: ${{ failure() }}
38+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
39+
with:
40+
name: test-output-misc
41+
path: |
42+
solr/test-framework/build/test-results/**
43+
solr/benchmark/build/test-results/**
44+
solr/solr-ref-guide/build/test-results/**
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Ops Modules Tests
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- '*'
7+
paths:
8+
- '.github/workflows/tests-modules-ops.yml'
9+
- 'gradle/libs.versions.toml'
10+
- 'solr/cross-dc-manager/**'
11+
- 'solr/modules/cross-dc/**'
12+
- 'solr/modules/gcs-repository/**'
13+
- 'solr/modules/jwt-auth/**'
14+
- 'solr/modules/opentelemetry/**'
15+
- 'solr/modules/s3-repository/**'
16+
17+
concurrency:
18+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
19+
cancel-in-progress: true
20+
21+
jobs:
22+
test:
23+
name: Run Ops Modules Tests
24+
25+
runs-on: ubuntu-latest
26+
timeout-minutes: 20
27+
28+
steps:
29+
- name: Checkout code
30+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
31+
32+
- uses: ./.github/actions/prepare-for-build
33+
34+
- name: Test the ops and infrastructure modules
35+
run: >
36+
./gradlew
37+
:solr:cross-dc-manager:test
38+
:solr:modules:cross-dc:test
39+
:solr:modules:gcs-repository:test
40+
:solr:modules:jwt-auth:test
41+
:solr:modules:opentelemetry:test
42+
:solr:modules:s3-repository:test
43+
44+
- name: Archive test output
45+
if: ${{ failure() }}
46+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
47+
with:
48+
name: test-output-modules-ops
49+
path: |
50+
solr/cross-dc-manager/build/test-results/**
51+
solr/modules/*/build/test-results/**
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Search Modules Tests
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- '*'
7+
paths:
8+
- '.github/workflows/tests-modules-search.yml'
9+
- 'gradle/libs.versions.toml'
10+
- 'solr/modules/analysis-extras/**'
11+
- 'solr/modules/clustering/**'
12+
- 'solr/modules/cuvs/**'
13+
- 'solr/modules/langid/**'
14+
- 'solr/modules/language-models/**'
15+
- 'solr/modules/ltr/**'
16+
- 'solr/modules/scripting/**'
17+
- 'solr/modules/sql/**'
18+
19+
concurrency:
20+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
21+
cancel-in-progress: true
22+
23+
jobs:
24+
test:
25+
name: Run Search Modules Tests
26+
27+
runs-on: ubuntu-latest
28+
timeout-minutes: 20
29+
30+
steps:
31+
- name: Checkout code
32+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
33+
34+
- uses: ./.github/actions/prepare-for-build
35+
36+
- name: Test the search-related modules
37+
run: >
38+
./gradlew
39+
:solr:modules:analysis-extras:test
40+
:solr:modules:clustering:test
41+
:solr:modules:cuvs:test
42+
:solr:modules:langid:test
43+
:solr:modules:language-models:test
44+
:solr:modules:ltr:test
45+
:solr:modules:scripting:test
46+
:solr:modules:sql:test
47+
48+
- name: Archive test output
49+
if: ${{ failure() }}
50+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
51+
with:
52+
name: test-output-modules-search
53+
path: |
54+
solr/modules/*/build/test-results/**

‎.github/workflows/tests-solrj.yml‎

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: SolrJ Tests
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- '*'
7+
paths:
8+
- '.github/workflows/tests-solrj.yml'
9+
- 'gradle/libs.versions.toml'
10+
- 'solr/api/**'
11+
- 'solr/solrj/**'
12+
- 'solr/solrj-jetty/**'
13+
- 'solr/solrj-streaming/**'
14+
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
17+
cancel-in-progress: true
18+
19+
jobs:
20+
test:
21+
name: Run SolrJ Tests
22+
23+
runs-on: ubuntu-latest
24+
timeout-minutes: 20
25+
26+
steps:
27+
- name: Checkout code
28+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
29+
30+
- uses: ./.github/actions/prepare-for-build
31+
32+
- name: Test the SolrJ modules and the API module
33+
run: ./gradlew :solr:api:test :solr:solrj:test :solr:solrj-jetty:test :solr:solrj-streaming:test -Ptests.jvms=3
34+
35+
- name: Archive test output
36+
if: ${{ failure() }}
37+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
38+
with:
39+
name: test-output-solrj
40+
path: |
41+
solr/api/build/test-results/**
42+
solr/solrj/build/test-results/**
43+
solr/solrj-jetty/build/test-results/**
44+
solr/solrj-streaming/build/test-results/**

0 commit comments

Comments
 (0)