Skip to content

Commit

Permalink
Backport opensearch-project#3187 to 1.3
Browse files Browse the repository at this point in the history
Signed-off-by: Simeon Widdis <[email protected]>
  • Loading branch information
Swiddis committed Dec 6, 2024
1 parent 0b5fa2b commit 5d1ad71
Show file tree
Hide file tree
Showing 11 changed files with 140 additions and 25 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/bi-connectors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ jobs:
working-directory: bi-connectors/PowerBIConnector
- name: Upload Tableau JDBC connector
if: steps.pack-tableau-jdbc.outcome == 'success'
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: TableauConnectors
path: bi-connectors/TableauConnector/opensearch_sql_jdbc/opensearch_sql_jdbc.taco
- name: Upload Power BI ODBC connectors
if: steps.pack-powerbi-odbc-os-proj.outcome == 'success' || (steps.prep-powerbi-odbc-amz-os-svc.outcome == 'success' && steps.pack-powerbi-odbc-amz-os-svc.outcome == 'success')
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: PBIConnectors
path: 'bi-connectors/PowerBIConnector/*.mez'
2 changes: 1 addition & 1 deletion .github/workflows/sql-cli-test-and-build-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
cp -r ./dist/*.tar.gz ./dist/*.whl opensearchsql-builds/
- name: Upload Artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: opensearchsql
path: sql-cli/opensearchsql-builds
2 changes: 1 addition & 1 deletion .github/workflows/sql-jdbc-test-and-build-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
cp ./build/libs/*.jar sql-jdbc-builds
- name: Upload Artifacts
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v4
with:
name: sql-jdbc
path: sql-jdbc/sql-jdbc-builds
22 changes: 11 additions & 11 deletions .github/workflows/sql-odbc-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
sh run_cppcheck.sh
- name: upload-cppcheck-results
if: failure()
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v4
with:
name: cppcheck-results
path: sql-odbc/cppcheck-results.log
Expand Down Expand Up @@ -61,19 +61,19 @@ jobs:
# cp ./bin64/*.log test-output
- name: upload-build
if: success()
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v4
with:
name: mac64-build
path: sql-odbc/build-output
- name: upload-installer
if: success()
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v4
with:
name: mac64-installer
path: sql-odbc/installer
#- name: upload-test-results
# if: success()
# uses: actions/upload-artifact@v1
# if: always()
# uses: actions/upload-artifact@v4
# with:
# name: mac-test-results
# path: test-output
Expand Down Expand Up @@ -106,19 +106,19 @@ jobs:
.\scripts\prepare_ci_output.ps1 $Env:ODBC_BIN_PATH $Env:ODBC_LIB_PATH $Env:ODBC_BUILD_PATH
- name: upload-build
if: always()
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v4
with:
name: windows32-build
path: sql-odbc/ci-output/build
- name: upload-installer
if: always()
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v4
with:
name: windows32-installer
path: sql-odbc/ci-output/installer
#- name: upload-test-results
# if: always()
# uses: actions/upload-artifact@v1
# uses: actions/upload-artifact@v4
# with:
# name: windows-test-results
# path: $CI_OUTPUT_PATH/test
Expand Down Expand Up @@ -151,19 +151,19 @@ jobs:
.\scripts\prepare_ci_output.ps1 $Env:ODBC_BIN_PATH $Env:ODBC_LIB_PATH $Env:ODBC_BUILD_PATH
- name: upload-build
if: always()
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v4
with:
name: windows64-build
path: sql-odbc/ci-output/build
- name: upload-installer
if: always()
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v4
with:
name: windows64-installer
path: sql-odbc/ci-output/installer
#- name: upload-test-results
# if: always()
# uses: actions/upload-artifact@v1
# uses: actions/upload-artifact@v4
# with:
# name: windows-test-results
# path: sql-odbc/ci-output/test-output
21 changes: 20 additions & 1 deletion .github/workflows/sql-test-and-build-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,26 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }}

- name: Upload Artifacts
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v4
with:
name: opensearch-sql
path: opensearch-sql-builds
<<<<<<< HEAD
=======

- name: Upload test reports
if: ${{ always() && matrix.entry.os == 'ubuntu-latest' }}
uses: actions/upload-artifact@v4
with:
name: test-reports
path: |
sql/build/reports/**
ppl/build/reports/**
core/build/reports/**
common/build/reports/**
opensearch/build/reports/**
integ-test/build/reports/**
protocol/build/reports/**
legacy/build/reports/**
plugin/build/reports/**
>>>>>>> 77aa93eb6 (chore: Update Spring to 5.3.39 (#3187))
95 changes: 95 additions & 0 deletions .github/workflows/sql-test-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: SQL Plugin Tests

on:
workflow_dispatch:
inputs:
name:
required: false
type: string

run-name:
${{ inputs.name == '' && format('{0} @ {1}', github.ref_name, github.sha) || inputs.name }}

jobs:
build:
strategy:
matrix:
java:
- 11
- 17
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}

- name: Run tests
id: tests
run: |
# checkstyle
./gradlew :opensearch:checkstyleMain || echo "* Checkstyle failed for opensearch/src" > report.log
./gradlew :opensearch:checkstyleTest || echo "* Checkstyle failed for opensearch/test" >> report.log
./gradlew :sql:checkstyleMain || echo "* Checkstyle failed for sql/src" >> report.log
./gradlew :sql:checkstyleTest || echo "* Checkstyle failed for sql/test" >> report.log
./gradlew :ppl:checkstyleMain || echo "* Checkstyle failed for ppl/src" >> report.log
./gradlew :ppl:checkstyleTest || echo "* Checkstyle failed for ppl/test" >> report.log
./gradlew :core:checkstyleMain || echo "* Checkstyle failed for core/src" >> report.log
./gradlew :core:checkstyleTest || echo "* Checkstyle failed for core/test" >> report.log
./gradlew :common:checkstyleMain || echo "* Checkstyle failed for common/src" >> report.log
./gradlew :common:checkstyleTest || echo "* Checkstyle failed for common/test" >> report.log
./gradlew :legacy:checkstyleMain || echo "* Checkstyle failed for legacy/src" >> report.log
./gradlew :legacy:checkstyleTest || echo "* Checkstyle failed for legacy/test" >> report.log
./gradlew :protocol:checkstyleMain || echo "* Checkstyle failed for protocol/src" >> report.log
./gradlew :protocol:checkstyleTest || echo "* Checkstyle failed for protocol/test" >> report.log
./gradlew :opensearch-sql-plugin:checkstyleMain || echo "* Checkstyle failed for plugin/src" >> report.log
./gradlew :opensearch-sql-plugin:checkstyleTest || echo "* Checkstyle failed for plugin/test" >> report.log
# Add checkstyle for `integ-test` when fixed
# Unit tests
./gradlew :opensearch:test || echo "* Unit tests failed for opensearch" >> report.log
./gradlew :ppl:test || echo "* Unit tests failed for sql" >> report.log
./gradlew :sql:test || echo "* Unit tests failed for ppl" >> report.log
./gradlew :core:test || echo "* Unit tests failed for core" >> report.log
./gradlew :protocol:test || echo "* Unit tests failed for protocol" >> report.log
./gradlew :opensearch-sql-plugin:test || echo "* Unit tests failed for plugin" >> report.log
./gradlew :legacy:test || echo "* Unit tests failed for legacy" >> report.log
# jacoco
./gradlew :opensearch:jacocoTestCoverageVerification || echo "* Jacoco failed for opensearch" >> report.log
./gradlew :ppl:jacocoTestCoverageVerification || echo "* Jacoco failed for sql" >> report.log
./gradlew :sql:jacocoTestCoverageVerification || echo "* Jacoco failed for ppl" >> report.log
./gradlew :core:jacocoTestCoverageVerification || echo "* Jacoco failed for core" >> report.log
./gradlew :protocol:jacocoTestCoverageVerification || echo "* Jacoco failed for protocol" >> report.log
./gradlew :opensearch-sql-plugin:jacocoTestCoverageVerification || echo "* Jacoco failed for plugin" >> report.log
# Misc tests
./gradlew :integ-test:integTest || echo "* Integration test failed" >> report.log
./gradlew :doctest:doctest || echo "* Doctest failed" >> report.log
./scripts/bwctest.sh || echo "* Backward compatibility test failed" >> report.log
- name: Verify test results
run: |
if [[ -e report.log ]]
then
echo "## FAILED TESTS :facepalm::warning::bangbang:" >> $GITHUB_STEP_SUMMARY
cat report.log >> $GITHUB_STEP_SUMMARY
exit 1
fi
- name: Upload test reports
if: always()
uses: actions/upload-artifact@v4
with:
name: test-reports
path: |
sql/build/reports/**
ppl/build/reports/**
core/build/reports/**
common/build/reports/**
opensearch/build/reports/**
integ-test/build/reports/**
protocol/build/reports/**
legacy/build/reports/**
plugin/build/reports/**
3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

buildscript {
ext {
opensearch_version = System.getProperty("opensearch.version", "1.3.3-SNAPSHOT")
opensearch_version = System.getProperty("opensearch.version", "1.3.4-SNAPSHOT")
spring_version = "5.3.39"
}

repositories {
Expand Down
6 changes: 3 additions & 3 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,16 @@ repositories {

dependencies {
compile group: 'com.google.guava', name: 'guava', version: '31.0.1-jre'
compile group: 'org.springframework', name: 'spring-context', version: '5.2.20.RELEASE'
compile group: 'org.springframework', name: 'spring-beans', version: '5.2.20.RELEASE'
compile group: 'org.springframework', name: 'spring-context', version: "${spring_version}"
compile group: 'org.springframework', name: 'spring-beans', version: "${spring_version}"
compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.10'
compile group: 'com.facebook.presto', name: 'presto-matching', version: '0.240'
compile group: 'org.apache.commons', name: 'commons-math3', version: '3.6.1'
compile project(':common')

testImplementation('org.junit.jupiter:junit-jupiter:5.6.2')
testCompile group: 'org.hamcrest', name: 'hamcrest-library', version: '2.1'
testCompile group: 'org.springframework', name: 'spring-test', version: '5.2.20.RELEASE'
testCompile group: 'org.springframework', name: 'spring-test', version: "${spring_version}"
testCompile group: 'org.mockito', name: 'mockito-core', version: '3.3.3'
testCompile group: 'org.mockito', name: 'mockito-junit-jupiter', version: '3.3.3'
}
Expand Down
2 changes: 1 addition & 1 deletion plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ configurations.all {
}

dependencies {
compile group: 'org.springframework', name: 'spring-beans', version: '5.2.20.RELEASE'
compile group: 'org.springframework', name: 'spring-beans', version: "${spring_version}"
compile project(":ppl")
compile project(':legacy')
compile project(':opensearch')
Expand Down
4 changes: 2 additions & 2 deletions ppl/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ dependencies {
compile group: 'com.google.guava', name: 'guava', version: '31.0.1-jre'
compile group: 'org.opensearch', name: 'opensearch-x-content', version: "${opensearch_version}"
compile group: 'org.json', name: 'json', version: '20180813'
compile group: 'org.springframework', name: 'spring-context', version: '5.2.20.RELEASE'
compile group: 'org.springframework', name: 'spring-beans', version: '5.2.20.RELEASE'
compile group: 'org.springframework', name: 'spring-context', version: "${spring_version}"
compile group: 'org.springframework', name: 'spring-beans', version: "${spring_version}"
compile group: 'org.apache.logging.log4j', name: 'log4j-core', version:'2.17.1'
compile project(':common')
compile project(':core')
Expand Down
4 changes: 2 additions & 2 deletions sql/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ dependencies {
compile "org.antlr:antlr4-runtime:4.7.1"
implementation group: 'com.google.guava', name: 'guava', version: '31.0.1-jre'
compile group: 'org.json', name: 'json', version:'20180813'
compile group: 'org.springframework', name: 'spring-context', version: '5.2.20.RELEASE'
compile group: 'org.springframework', name: 'spring-beans', version: '5.2.20.RELEASE'
compile group: 'org.springframework', name: 'spring-context', version: "${spring_version}"
compile group: 'org.springframework', name: 'spring-beans', version: "${spring_version}"
compile project(':common')
compile project(':core')
compile project(':protocol')
Expand Down

0 comments on commit 5d1ad71

Please sign in to comment.