Skip to content

Commit 6f25147

Browse files
authored
Merge branch 'main' into eventstats-earliest
Signed-off-by: Tomoyuki MORITA <moritato@amazon.com>
2 parents e91210b + f244bd6 commit 6f25147

File tree

76 files changed

+5884
-2708
lines changed

Some content is hidden

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

76 files changed

+5884
-2708
lines changed

.github/workflows/sql-test-and-build-workflow.yml

Lines changed: 133 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -26,137 +26,157 @@ jobs:
2626
build-linux:
2727
needs: Get-CI-Image-Tag
2828
strategy:
29-
# Run all jobs
3029
fail-fast: false
3130
matrix:
3231
java: [21, 24]
32+
test-type: ['unit', 'integration', 'doc']
3333
runs-on: ubuntu-latest
3434
container:
35-
# using the same image which is used by opensearch-build team to build the OpenSearch Distribution
36-
# this image tag is subject to change as more dependencies and updates will arrive over time
3735
image: ${{ needs.Get-CI-Image-Tag.outputs.ci-image-version-linux }}
3836
options: ${{ needs.Get-CI-Image-Tag.outputs.ci-image-start-options }}
3937

4038
steps:
41-
- name: Run start commands
42-
run: ${{ needs.Get-CI-Image-Tag.outputs.ci-image-start-command }}
43-
44-
- uses: actions/checkout@v4
45-
46-
- name: Set up JDK ${{ matrix.java }}
47-
uses: actions/setup-java@v4
48-
with:
49-
distribution: 'temurin'
50-
java-version: ${{ matrix.java }}
51-
52-
- name: Build with Gradle
53-
run: |
54-
chown -R 1000:1000 `pwd`
55-
su `id -un 1000` -c "./gradlew --continue build"
56-
57-
- name: Create Artifact Path
58-
run: |
59-
mkdir -p opensearch-sql-builds
60-
cp -r ./plugin/build/distributions/*.zip opensearch-sql-builds/
61-
62-
# This step uses the codecov-action Github action: https://github.com/codecov/codecov-action
63-
- name: Upload SQL Coverage Report
64-
if: ${{ always() }}
65-
uses: codecov/codecov-action@v4
66-
continue-on-error: true
67-
with:
68-
flags: sql-engine
69-
token: ${{ secrets.CODECOV_TOKEN }}
70-
71-
- name: Upload Artifacts
72-
uses: actions/upload-artifact@v4
73-
continue-on-error: true
74-
with:
75-
name: opensearch-sql-ubuntu-latest-${{ matrix.java }}
76-
path: opensearch-sql-builds
77-
78-
- name: Upload test reports
79-
if: ${{ always() }}
80-
uses: actions/upload-artifact@v4
81-
continue-on-error: true
82-
with:
83-
name: test-reports-ubuntu-latest-${{ matrix.java }}
84-
path: |
85-
sql/build/reports/**
86-
ppl/build/reports/**
87-
core/build/reports/**
88-
common/build/reports/**
89-
opensearch/build/reports/**
90-
integ-test/build/reports/**
91-
protocol/build/reports/**
92-
legacy/build/reports/**
93-
plugin/build/reports/**
94-
doctest/build/testclusters/docTestCluster-0/logs/*
95-
integ-test/build/testclusters/*/logs/*
39+
- name: Run start commands
40+
run: ${{ needs.Get-CI-Image-Tag.outputs.ci-image-start-command }}
41+
42+
- uses: actions/checkout@v4
43+
44+
- name: Set up JDK ${{ matrix.java }}
45+
uses: actions/setup-java@v4
46+
with:
47+
distribution: 'temurin'
48+
java-version: ${{ matrix.java }}
49+
50+
- name: Build and Test
51+
run: |
52+
chown -R 1000:1000 `pwd`
53+
if [ "${{ matrix.test-type }}" = "unit" ]; then
54+
su `id -un 1000` -c "./gradlew --continue build -x integTest -x doctest"
55+
elif [ "${{ matrix.test-type }}" = "integration" ]; then
56+
su `id -un 1000` -c "./gradlew --continue integTest"
57+
else
58+
su `id -un 1000` -c "./gradlew --continue doctest"
59+
fi
60+
61+
- name: Create Artifact Path
62+
if: ${{ matrix.test-type == 'unit' }}
63+
run: |
64+
mkdir -p opensearch-sql-builds
65+
cp -r ./plugin/build/distributions/*.zip opensearch-sql-builds/
66+
67+
- name: Upload SQL Coverage Report
68+
if: ${{ always() }}
69+
uses: codecov/codecov-action@v4
70+
continue-on-error: true
71+
with:
72+
flags: sql-engine
73+
token: ${{ secrets.CODECOV_TOKEN }}
74+
75+
- name: Upload Artifacts
76+
if: ${{ matrix.test-type == 'unit' }}
77+
uses: actions/upload-artifact@v4
78+
continue-on-error: true
79+
with:
80+
name: opensearch-sql-ubuntu-latest-${{ matrix.java }}
81+
path: opensearch-sql-builds
82+
83+
- name: Upload test reports
84+
if: ${{ always() }}
85+
uses: actions/upload-artifact@v4
86+
continue-on-error: true
87+
with:
88+
name: test-reports-ubuntu-latest-${{ matrix.java }}-${{ matrix.test-type }}
89+
path: |
90+
sql/build/reports/**
91+
ppl/build/reports/**
92+
core/build/reports/**
93+
common/build/reports/**
94+
opensearch/build/reports/**
95+
integ-test/build/reports/**
96+
protocol/build/reports/**
97+
legacy/build/reports/**
98+
plugin/build/reports/**
99+
doctest/build/testclusters/docTestCluster-0/logs/*
100+
integ-test/build/testclusters/*/logs/*
96101
97102
build-windows-macos:
98103
strategy:
99-
# Run all jobs
100104
fail-fast: false
101105
matrix:
102106
entry:
103-
- { os: windows-latest, java: 21, os_build_args: -x doctest -PbuildPlatform=windows }
104-
- { os: windows-latest, java: 24, os_build_args: -x doctest -PbuildPlatform=windows }
105-
- { os: macos-13, java: 21 }
106-
- { os: macos-13, java: 24 }
107+
- { os: windows-latest, java: 21, os_build_args: -PbuildPlatform=windows }
108+
- { os: windows-latest, java: 24, os_build_args: -PbuildPlatform=windows }
109+
- { os: macos-13, java: 21, os_build_args: '' }
110+
- { os: macos-13, java: 24, os_build_args: '' }
111+
test-type: ['unit', 'integration', 'doc']
112+
exclude:
113+
# Exclude doctest for Windows
114+
- test-type: doc
115+
entry: { os: windows-latest, java: 21, os_build_args: -PbuildPlatform=windows }
116+
- test-type: doc
117+
entry: { os: windows-latest, java: 24, os_build_args: -PbuildPlatform=windows }
107118
runs-on: ${{ matrix.entry.os }}
108119

109120
steps:
110-
- uses: actions/checkout@v4
111-
112-
- name: Set up JDK ${{ matrix.java }}
113-
uses: actions/setup-java@v4
114-
with:
115-
distribution: 'temurin'
116-
java-version: ${{ matrix.entry.java }}
117-
118-
- name: Build with Gradle
119-
run: ./gradlew --continue build ${{ matrix.entry.os_build_args }}
120-
121-
- name: Create Artifact Path
122-
run: |
123-
mkdir -p opensearch-sql-builds
124-
cp -r ./plugin/build/distributions/*.zip opensearch-sql-builds/
125-
126-
# This step uses the codecov-action Github action: https://github.com/codecov/codecov-action
127-
- name: Upload SQL Coverage Report
128-
if: ${{ always() && matrix.entry.os == 'ubuntu-latest' }}
129-
uses: codecov/codecov-action@v4
130-
continue-on-error: true
131-
with:
132-
flags: sql-engine
133-
token: ${{ secrets.CODECOV_TOKEN }}
134-
135-
- name: Upload Artifacts
136-
uses: actions/upload-artifact@v4
137-
continue-on-error: true
138-
with:
139-
name: opensearch-sql-${{ matrix.entry.os }}-${{ matrix.entry.java }}
140-
path: opensearch-sql-builds
141-
142-
- name: Upload test reports
143-
if: ${{ always() && matrix.entry.os == 'ubuntu-latest' }}
144-
uses: actions/upload-artifact@v4
145-
continue-on-error: true
146-
with:
147-
name: test-reports-${{ matrix.entry.os }}-${{ matrix.entry.java }}
148-
path: |
149-
sql/build/reports/**
150-
ppl/build/reports/**
151-
core/build/reports/**
152-
common/build/reports/**
153-
opensearch/build/reports/**
154-
integ-test/build/reports/**
155-
protocol/build/reports/**
156-
legacy/build/reports/**
157-
plugin/build/reports/**
158-
doctest/build/testclusters/docTestCluster-0/logs/*
159-
integ-test/build/testclusters/*/logs/*
121+
- uses: actions/checkout@v4
122+
123+
- name: Set up JDK ${{ matrix.entry.java }}
124+
uses: actions/setup-java@v4
125+
with:
126+
distribution: 'temurin'
127+
java-version: ${{ matrix.entry.java }}
128+
129+
- name: Build and Test
130+
run: |
131+
if [ "${{ matrix.test-type }}" = "unit" ]; then
132+
./gradlew --continue build -x integTest -x doctest ${{ matrix.entry.os_build_args }}
133+
elif [ "${{ matrix.test-type }}" = "integration" ]; then
134+
./gradlew --continue integTest ${{ matrix.entry.os_build_args }}
135+
else
136+
./gradlew --continue doctest ${{ matrix.entry.os_build_args }}
137+
fi
138+
shell: bash
139+
140+
- name: Create Artifact Path
141+
if: ${{ matrix.test-type == 'unit' }}
142+
run: |
143+
mkdir -p opensearch-sql-builds
144+
cp -r ./plugin/build/distributions/*.zip opensearch-sql-builds/
145+
146+
- name: Upload SQL Coverage Report
147+
if: ${{ always() && matrix.entry.os == 'ubuntu-latest' }}
148+
uses: codecov/codecov-action@v4
149+
continue-on-error: true
150+
with:
151+
flags: sql-engine
152+
token: ${{ secrets.CODECOV_TOKEN }}
153+
154+
- name: Upload Artifacts
155+
if: ${{ matrix.test-type == 'unit' }}
156+
uses: actions/upload-artifact@v4
157+
continue-on-error: true
158+
with:
159+
name: opensearch-sql-${{ matrix.entry.os }}-${{ matrix.entry.java }}
160+
path: opensearch-sql-builds
161+
162+
- name: Upload test reports
163+
if: ${{ always() }}
164+
uses: actions/upload-artifact@v4
165+
continue-on-error: true
166+
with:
167+
name: test-reports-${{ matrix.entry.os }}-${{ matrix.entry.java }}-${{ matrix.test-type }}
168+
path: |
169+
sql/build/reports/**
170+
ppl/build/reports/**
171+
core/build/reports/**
172+
common/build/reports/**
173+
opensearch/build/reports/**
174+
integ-test/build/reports/**
175+
protocol/build/reports/**
176+
legacy/build/reports/**
177+
plugin/build/reports/**
178+
doctest/build/testclusters/docTestCluster-0/logs/*
179+
integ-test/build/testclusters/*/logs/*
160180
161181
bwc-tests:
162182
needs: Get-CI-Image-Tag

DEVELOPER_GUIDE.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ Gradle Build
227227

228228
Most of the time you just need to run ``./gradlew build`` which will make sure you pass all checks and testing. While you're developing, you may want to run specific Gradle task only. In this case, you can run ./gradlew with task name which only triggers the task along with those it depends on. Here is a list for common tasks:
229229

230-
For faster local iterations, the build can skip integration and doctests. ``./gradlew build --parallel -x integTest -x doctest``.
230+
For faster local iterations, skip integration tests. ``./gradlew build -x integTest``.
231231

232232
.. list-table::
233233
:widths: 30 50

async-query/src/test/java/org/opensearch/sql/spark/asyncquery/AsyncQueryExecutorServiceSpec.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -513,20 +513,20 @@ public String loadResultIndexMappings() {
513513
@RequiredArgsConstructor
514514
public class FlintDatasetMock {
515515

516-
final String query;
517-
final String refreshQuery;
516+
public final String query;
517+
public final String refreshQuery;
518518
final FlintIndexType indexType;
519-
final String indexName;
519+
public final String indexName;
520520
boolean isLegacy = false;
521521
boolean isSpecialCharacter = false;
522-
String latestId;
522+
public String latestId;
523523

524524
public FlintDatasetMock isLegacy(boolean isLegacy) {
525525
this.isLegacy = isLegacy;
526526
return this;
527527
}
528528

529-
FlintDatasetMock isSpecialCharacter(boolean isSpecialCharacter) {
529+
public FlintDatasetMock isSpecialCharacter(boolean isSpecialCharacter) {
530530
this.isSpecialCharacter = isSpecialCharacter;
531531
return this;
532532
}

0 commit comments

Comments
 (0)