Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@ name: Code Quality Check

on:
pull_request:
types: [opened, synchronize, reopened]
branches: [ main, master ]
branches:
- main
push:
branches: [ main, master ]
branches:
- main

permissions:
contents: read
pull-requests: write
checks: write
actions: read
# permissions:
# contents: read
# pull-requests: write
# checks: write
# actions: read

jobs:
checkstyle:
Expand Down Expand Up @@ -47,7 +48,7 @@ jobs:
if: always()
with:
name: checkstyle-results
path: |
path: |
**/target/checkstyle-result.xml
**/target/site/checkstyle.html
retention-days: 7
Expand Down
35 changes: 27 additions & 8 deletions .github/workflows/test_compatibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,44 @@ on:
- main

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Build with Maven
run: mvn clean install -DskipTests
- name: Upload JAR artifacts
uses: actions/upload-artifact@v4
with:
name: databend-jdbc-jars
path: |
databend-jdbc/target/*.jar
retention-days: 1

test:
runs-on: ubuntu-latest
needs: build
strategy:
fail-fast: false
matrix:
server:
- "nightly"
- "v1.2.790-nightly"
driver:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keep this to ensure the change of tests works with old drivers,
otherwise, test in databend may fail.

- "0.4.0"
- "0.3.9"
steps:
- uses: actions/checkout@v4

- name: Download JAR artifacts
uses: actions/download-artifact@v4
with:
name: databend-jdbc-jars
path: databend-jdbc/target/

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
Expand All @@ -38,10 +62,6 @@ jobs:
env:
DATABEND_QUERY_VERSION: ${{ matrix.server }}

- name: Test with conn to nginx
run: mvn clean package -DskipTests
env:
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}

- name: Test with conn to nginx
working-directory: tests/compatibility
Expand All @@ -50,5 +70,4 @@ jobs:
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
DATABEND_TEST_CONN_PORT: 8000
DATABEND_QUERY_VERSION: ${{ matrix.server }}
DATABEND_JDBC_VERSION: ${{ matrix.driver }}
TEST_SIDE: "driver"
15 changes: 3 additions & 12 deletions tests/compatibility/test_compatibility.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,9 @@ JDBC_VER=${DATABEND_JDBC_VERSION:-$CURRENT_VERSION}
JDBC_JAR="databend-jdbc-${JDBC_VER}.jar"
JDBC_TEST_JAR="databend-jdbc-${TEST_VER}-tests.jar"

if [ "$TEST_SIDE" = "server" ]; then
curl -sSLfO "https://github.com/databendlabs/databend-jdbc/releases/download/v${TEST_VER}/${JDBC_TEST_JAR}"
else
cp "../../databend-jdbc/target/${JDBC_TEST_JAR}" .
fi

if [ -z "DATABEND_JDBC_VERSION" ]; then
# test main branch
cp "../../databend-jdbc/target/${JDBC_JAR}" .
else
curl -sSLfO "https://github.com/databendlabs/databend-jdbc/releases/download/v${JDBC_VER}/${JDBC_JAR}"
fi
# Always use local artifacts (built in CI or local dev)
cp ../../databend-jdbc/target/databend-jdbc-${TEST_VER}-tests.jar databend-jdbc-tests.jar
cp "../../databend-jdbc/target/${JDBC_JAR}" .

export DATABEND_JDBC_VERSION=$JDBC_VER
java -Dlogback.logger.root=INFO -cp "testng.jar:slf4j-api.jar:${JDBC_JAR}:${JDBC_TEST_JAR}:jcommander.jar:semver4j.jar" org.testng.TestNG testng.xml
Loading