Skip to content

Commit 41360b7

Browse files
authored
Split test suite with separate docker-compose. (#472)
* Split test suite with separate docker-compose. Signed-off-by: dblock <[email protected]>
1 parent cfe357b commit 41360b7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+152
-96
lines changed

.github/workflows/test-spec.yml

+10-5
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,18 @@ jobs:
2828
- version: 2.0.0
2929
admin_password: admin
3030
- version: 2.15.0
31+
- version: 2.15.0
32+
tests: plugins/index_state_management
33+
- version: 2.15.0
34+
tests: snapshot
3135
- version: 2.16.0
3236
hub: opensearchstaging
3337
ref: '@sha256:bcd7f5d5d30231f24f266064248cc8d3306574948190f7bf93016dff29acf17e'
3438
- version: 3.0.0
3539
hub: opensearchstaging
3640
ref: '@sha256:db1918b2b8f7ef6c22dd6ff54a0640877c3d395a392a53864745024933981e3b'
3741

38-
name: test-opensearch-spec (version=${{ matrix.entry.version }}, hub=${{ matrix.entry.hub || 'opensearchproject' }})
42+
name: test-opensearch-spec (version=${{ matrix.entry.version }}, hub=${{ matrix.entry.hub || 'opensearchproject' }}, tests=${{ matrix.entry.tests || 'default' }})
3943
runs-on: ubuntu-latest
4044

4145
env:
@@ -58,7 +62,7 @@ jobs:
5862
run: npm ci
5963

6064
- name: Run OpenSearch Cluster
61-
working-directory: .github/opensearch-cluster
65+
working-directory: tests/${{ matrix.entry.tests || 'default' }}
6266
run: docker compose up -d
6367

6468
- name: Get Container ID
@@ -71,7 +75,8 @@ jobs:
7175
npm run test:spec -- \
7276
--opensearch-insecure \
7377
--opensearch-version=${{ matrix.entry.version }} \
74-
--coverage coverage/test-spec-coverage-${{ matrix.entry.version }}.json
78+
--coverage coverage/test-spec-coverage-${{ matrix.entry.version }}-${{ matrix.entry.tests || 'default' }}.json \
79+
--tests=tests/${{ matrix.entry.tests || 'default' }}
7580
7681
- name: Get Container Logs
7782
if: failure() && steps.container.outputs.CONTAINER_ID
@@ -82,8 +87,8 @@ jobs:
8287
- name: Upload Test Coverage Results
8388
uses: actions/upload-artifact@v4
8489
with:
85-
name: coverage-${{ matrix.entry.version }}
86-
path: coverage/test-spec-coverage-${{ matrix.entry.version }}.json
90+
name: coverage-${{ matrix.entry.version }}-${{ hashFiles(format('tests/{0}', matrix.entry.tests || 'default')) }}
91+
path: coverage/test-spec-coverage-${{ matrix.entry.version }}-${{ matrix.entry.tests || 'default' }}.json
8792

8893
merge-coverage:
8994
runs-on: ubuntu-latest

.github/workflows/test-tools-integ.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
uses: actions/checkout@v4
3333

3434
- name: Run OpenSearch Cluster
35-
working-directory: .github/opensearch-cluster
35+
working-directory: tests/default
3636
run: |
3737
docker compose up -d
3838
sleep 15

CHANGELOG.md

+1

TESTING_GUIDE.md

+9-7

tests/_core/bulk.yaml tests/default/_core/bulk.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$schema: ../../json_schemas/test_story.schema.yaml
1+
$schema: ../../../json_schemas/test_story.schema.yaml
22

33
description: Test bulk endpoint.
44
epilogues:

tests/_core/info.yaml tests/default/_core/info.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
$schema: ../../json_schemas/test_story.schema.yaml
2+
$schema: ../../../json_schemas/test_story.schema.yaml
33

44
description: Test root endpoint.
55
chapters:

tests/_core/mapping.yaml tests/default/_core/mapping.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$schema: ../../json_schemas/test_story.schema.yaml
1+
$schema: ../../../json_schemas/test_story.schema.yaml
22

33
description: Test mappings endpoints.
44
prologues:

tests/_core/reindex.yaml tests/default/_core/reindex.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$schema: ../../json_schemas/test_story.schema.yaml
1+
$schema: ../../../json_schemas/test_story.schema.yaml
22

33
description: Test reindex.
44
epilogues:

tests/_core/reindex/pipeline.yaml tests/default/_core/reindex/pipeline.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$schema: ../../../json_schemas/test_story.schema.yaml
1+
$schema: ../../../../json_schemas/test_story.schema.yaml
22

33
description: Test reindex with a Search pipeline.
44
epilogues:

tests/_core/search/_source.yaml tests/default/_core/search/_source.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$schema: ../../../json_schemas/test_story.schema.yaml
1+
$schema: ../../../../json_schemas/test_story.schema.yaml
22

33
description: Test search endpoint (_source).
44
prologues:

tests/_core/search/cancel_after_time_interval.yaml tests/default/_core/search/cancel_after_time_interval.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$schema: ../../../json_schemas/test_story.schema.yaml
1+
$schema: ../../../../json_schemas/test_story.schema.yaml
22

33
description: Test search endpoint with cancel_after_time_interval.
44
prologues:

tests/_core/search/geo_distance.yaml tests/default/_core/search/geo_distance.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$schema: ../../../json_schemas/test_story.schema.yaml
1+
$schema: ../../../../json_schemas/test_story.schema.yaml
22

33
description: Test search endpoint with geo_distance query.
44
prologues:

tests/_core/search/match.yaml tests/default/_core/search/match.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$schema: ../../../json_schemas/test_story.schema.yaml
1+
$schema: ../../../../json_schemas/test_story.schema.yaml
22

33
description: Test search endpoint with match query.
44
prologues:

tests/_core/search/multi_match.yaml tests/default/_core/search/multi_match.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$schema: ../../../json_schemas/test_story.schema.yaml
1+
$schema: ../../../../json_schemas/test_story.schema.yaml
22

33
description: Test search endpoint with multi_match query.
44
prologues:

tests/_core/search/phase_took.yaml tests/default/_core/search/phase_took.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$schema: ../../../json_schemas/test_story.schema.yaml
1+
$schema: ../../../../json_schemas/test_story.schema.yaml
22

33
description: Test search endpoint with phase_took.
44
prologues:

tests/_core/search/rest_total_hits_as_int.yaml tests/default/_core/search/rest_total_hits_as_int.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$schema: ../../../json_schemas/test_story.schema.yaml
1+
$schema: ../../../../json_schemas/test_story.schema.yaml
22

33
description: Test search endpoint with rest_total_hits_as_int.
44
prologues:

tests/_core/search/seq_no_primary_term.yaml tests/default/_core/search/seq_no_primary_term.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$schema: ../../../json_schemas/test_story.schema.yaml
1+
$schema: ../../../../json_schemas/test_story.schema.yaml
22

33
description: Test search endpoint with seq_no_primary_term.
44
prologues:

tests/_core/search/size.yaml tests/default/_core/search/size.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$schema: ../../../json_schemas/test_story.schema.yaml
1+
$schema: ../../../../json_schemas/test_story.schema.yaml
22

33
description: Test search endpoint with size.
44
prologues:

tests/cat/aliases.yaml tests/default/cat/aliases.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$schema: ../../json_schemas/test_story.schema.yaml
1+
$schema: ../../../json_schemas/test_story.schema.yaml
22

33
description: Test cat/aliases endpoints.
44
epilogues:

tests/cat/allocation.yaml tests/default/cat/allocation.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$schema: ../../json_schemas/test_story.schema.yaml
1+
$schema: ../../../json_schemas/test_story.schema.yaml
22

33
description: Test cat/allocation endpoints.
44
chapters:

tests/cat/cluster_manager.yaml tests/default/cat/cluster_manager.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$schema: ../../json_schemas/test_story.schema.yaml
1+
$schema: ../../../json_schemas/test_story.schema.yaml
22

33
description: Test cat/cluster_manager endpoints.
44
chapters:

tests/cat/count.yaml tests/default/cat/count.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$schema: ../../json_schemas/test_story.schema.yaml
1+
$schema: ../../../json_schemas/test_story.schema.yaml
22

33
description: Test cat/count endpoints.
44
chapters:

tests/cat/fielddata.yaml tests/default/cat/fielddata.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$schema: ../../json_schemas/test_story.schema.yaml
1+
$schema: ../../../json_schemas/test_story.schema.yaml
22

33
description: Test cat/fielddata endpoints.
44
chapters:

tests/cat/health.yaml tests/default/cat/health.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$schema: ../../json_schemas/test_story.schema.yaml
1+
$schema: ../../../json_schemas/test_story.schema.yaml
22

33
description: Test cat/health endpoints.
44
chapters:

tests/cat/index.yaml tests/default/cat/index.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$schema: ../../json_schemas/test_story.schema.yaml
1+
$schema: ../../../json_schemas/test_story.schema.yaml
22

33
description: Test cat endpoints.
44
chapters:

tests/cat/indices.yaml tests/default/cat/indices.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$schema: ../../json_schemas/test_story.schema.yaml
1+
$schema: ../../../json_schemas/test_story.schema.yaml
22

33
description: Test cat/indices endpoints.
44
prologues:

tests/cat/master.yaml tests/default/cat/master.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$schema: ../../json_schemas/test_story.schema.yaml
1+
$schema: ../../../json_schemas/test_story.schema.yaml
22

33
description: Test cat/master endpoints.
44
chapters:

tests/cat/nodeattrs.yaml tests/default/cat/nodeattrs.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$schema: ../../json_schemas/test_story.schema.yaml
1+
$schema: ../../../json_schemas/test_story.schema.yaml
22

33
description: Test cat/nodeattrs endpoints.
44
chapters:

tests/cat/nodes.yaml tests/default/cat/nodes.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$schema: ../../json_schemas/test_story.schema.yaml
1+
$schema: ../../../json_schemas/test_story.schema.yaml
22

33
description: Test cat/nodes endpoints.
44
chapters:

tests/cat/pending_tasks.yaml tests/default/cat/pending_tasks.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$schema: ../../json_schemas/test_story.schema.yaml
1+
$schema: ../../../json_schemas/test_story.schema.yaml
22

33
description: Test cat/pending_tasks endpoints.
44
chapters:

tests/cat/pit_segments/all.yaml tests/default/cat/pit_segments/all.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$schema: ../../../json_schemas/test_story.schema.yaml
1+
$schema: ../../../../json_schemas/test_story.schema.yaml
22

33
description: Test cat/pit_segments/_all endpoints.
44
version: '>= 2.4'

tests/cat/pit_segments/pit_segments.yaml tests/default/cat/pit_segments/pit_segments.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$schema: ../../../json_schemas/test_story.schema.yaml
1+
$schema: ../../../../json_schemas/test_story.schema.yaml
22

33
description: Test cat/pit_segments endpoints.
44
version: '>= 2.4'

tests/cat/plugins.yaml tests/default/cat/plugins.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$schema: ../../json_schemas/test_story.schema.yaml
1+
$schema: ../../../json_schemas/test_story.schema.yaml
22

33
description: Test cat/plugins endpoints.
44
chapters:

tests/cat/recovery.yaml tests/default/cat/recovery.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$schema: ../../json_schemas/test_story.schema.yaml
1+
$schema: ../../../json_schemas/test_story.schema.yaml
22

33
description: Test cat/recovery endpoints.
44
chapters:

tests/cat/segment_replication.yaml tests/default/cat/segment_replication.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$schema: ../../json_schemas/test_story.schema.yaml
1+
$schema: ../../../json_schemas/test_story.schema.yaml
22

33
description: Test cat/segment_replication endpoints.
44
version: '>= 2.7'

tests/cat/segments.yaml tests/default/cat/segments.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$schema: ../../json_schemas/test_story.schema.yaml
1+
$schema: ../../../json_schemas/test_story.schema.yaml
22

33
description: Test cat/segments endpoints.
44
chapters:

tests/cat/shards.yaml tests/default/cat/shards.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$schema: ../../json_schemas/test_story.schema.yaml
1+
$schema: ../../../json_schemas/test_story.schema.yaml
22

33
description: Test cat/shards endpoints.
44
epilogues:

tests/cat/tasks.yaml tests/default/cat/tasks.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$schema: ../../json_schemas/test_story.schema.yaml
1+
$schema: ../../../json_schemas/test_story.schema.yaml
22

33
description: Test cat/tasks endpoints.
44
chapters:

tests/cat/templates.yaml tests/default/cat/templates.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$schema: ../../json_schemas/test_story.schema.yaml
1+
$schema: ../../../json_schemas/test_story.schema.yaml
22

33
description: Test cat/templates endpoints.
44
epilogues:

tests/cat/thread_pool.yaml tests/default/cat/thread_pool.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$schema: ../../json_schemas/test_story.schema.yaml
1+
$schema: ../../../json_schemas/test_story.schema.yaml
22

33
description: Test cat/thread_pool endpoints.
44
chapters:

tests/cluster/component_template.yaml tests/default/cluster/component_template.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$schema: ../../json_schemas/test_story.schema.yaml
1+
$schema: ../../../json_schemas/test_story.schema.yaml
22

33
description: Test component templates.
44
epilogues:

tests/default/docker-compose.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: '3'
2+
3+
services:
4+
opensearch-cluster:
5+
image: ${OPENSEARCH_DOCKER_HUB_PROJECT:-opensearchproject}/opensearch:${OPENSEARCH_VERSION:-latest}${OPENSEARCH_DOCKER_REF}
6+
ports:
7+
- 9200:9200
8+
- 9600:9600
9+
environment:
10+
- OPENSEARCH_INITIAL_ADMIN_PASSWORD=${OPENSEARCH_PASSWORD:-myStrongPassword123!}
11+
- OPENSEARCH_JAVA_OPTS=${OPENSEARCH_JAVA_OPTS}
12+
- discovery.type=single-node

tests/indices/alias/alias.yaml tests/default/indices/alias/alias.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$schema: ../../../json_schemas/test_story.schema.yaml
1+
$schema: ../../../../json_schemas/test_story.schema.yaml
22

33
description: Test alias endpoints.
44
epilogues:

tests/indices/aliases/aliases.yaml tests/default/indices/aliases/aliases.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$schema: ../../../json_schemas/test_story.schema.yaml
1+
$schema: ../../../../json_schemas/test_story.schema.yaml
22

33
description: Test aliases endpoints.
44
epilogues:

tests/indices/aliases/put_alias.yaml tests/default/indices/aliases/put_alias.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$schema: ../../../json_schemas/test_story.schema.yaml
1+
$schema: ../../../../json_schemas/test_story.schema.yaml
22

33
description: Test put_alias variants.
44
epilogues:

tests/indices/cache.yaml tests/default/indices/cache.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$schema: ../../json_schemas/test_story.schema.yaml
1+
$schema: ../../../json_schemas/test_story.schema.yaml
22

33
description: Test index clear cache.
44
prologues:

tests/indices/clone.yaml tests/default/indices/clone.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$schema: ../../json_schemas/test_story.schema.yaml
1+
$schema: ../../../json_schemas/test_story.schema.yaml
22

33
description: Test cloning an index.
44
prologues:

tests/indices/close.yaml tests/default/indices/close.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$schema: ../../json_schemas/test_story.schema.yaml
1+
$schema: ../../../json_schemas/test_story.schema.yaml
22

33
description: Test closing an index.
44
prologues:

0 commit comments

Comments
 (0)