forked from opensearch-project/data-prepper
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopensearch-sink-opensearch-integration-tests.yml
More file actions
99 lines (88 loc) · 3.07 KB
/
opensearch-sink-opensearch-integration-tests.yml
File metadata and controls
99 lines (88 loc) · 3.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#
# Copyright OpenSearch Contributors
# SPDX-License-Identifier: Apache-2.0
#
# The OpenSearch Contributors require contributions made to
# this file be licensed under the Apache-2.0 license or a
# compatible open source license.
#
name: Integration Tests - OpenSearch sink against OpenSearch
on:
push:
paths:
- 'data-prepper-plugins/opensearch/**'
- '*gradle*'
pull_request:
paths:
- 'data-prepper-plugins/opensearch/**'
- '*gradle*'
workflow_dispatch:
jobs:
integration-tests:
strategy:
matrix:
java: [11]
opensearch:
- 1.0.1
- 1.1.0
- 1.2.4
- 1.3.20
- 2.0.1
- 2.1.0
- 2.3.0
- 2.5.0
- 2.7.0
- 2.9.0
- 2.11.1
- 2.15.0
- 2.19.5
- 3.0.0
- 3.5.0
fail-fast: false
runs-on: ubuntu-latest
steps:
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
- name: Checkout Data Prepper
uses: actions/checkout@v6
- name: Set password for OpenSearch version
run: |
if [[ "${{ matrix.opensearch }}" =~ ^(2\.(1[2-9]|[2-9][0-9])|[3-9]\.) ]]; then
echo "PASSWORD=yourStrongPassword123!" >> $GITHUB_ENV
else
echo "PASSWORD=admin" >> $GITHUB_ENV
fi
- name: Run OpenSearch docker
run: |
docker pull opensearchproject/opensearch:${{ matrix.opensearch }}
docker run -p 9200:9200 -p 9600:9600 -e "discovery.type=single-node" -e 'OPENSEARCH_INITIAL_ADMIN_PASSWORD=yourStrongPassword123!' -d opensearchproject/opensearch:${{ matrix.opensearch }}
sleep 1
- name: Wait for OpenSearch to be available
run: |
./gradlew :data-prepper-plugins:opensearch:integrationTest --tests "org.opensearch.dataprepper.plugins.sink.opensearch.OpenSearchIT" -Dtests.opensearch.host=localhost:9200 -Dtests.opensearch.user=admin -Dtests.opensearch.password="$PASSWORD"
- name: Run OpenSearch tests
run: |
./gradlew :data-prepper-plugins:opensearch:integrationTest -Dtests.opensearch.host=localhost:9200 -Dtests.opensearch.user=admin -Dtests.opensearch.password="$PASSWORD" -Dtests.opensearch.bundle=true -Dtests.opensearch.version=opensearch:${{ matrix.opensearch }}
- name: Upload Unit Test Results
if: always()
uses: actions/upload-artifact@v4
with:
name: data-prepper-opensearch-integration-tests-opensearch-${{ matrix.opensearch }}-java-${{ matrix.java }}
path: '**/test-results/**/*.xml'
publish-test-results:
name: "Publish Unit Tests Results"
needs: integration-tests
runs-on: ubuntu-latest
if: always()
steps:
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
path: test-results
- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v1
with:
files: "test-results/**/*.xml"