Skip to content

Commit

Permalink
Merge branch 'master' into FIR-32802-metadata-catalog
Browse files Browse the repository at this point in the history
  • Loading branch information
stepansergeevitch authored Oct 30, 2024
2 parents 1a3a186 + 7c50295 commit 63cd982
Show file tree
Hide file tree
Showing 95 changed files with 3,393 additions and 1,446 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ jobs:
run: |
echo "PROJECT_VERSION=$(./gradlew printVersion |grep 'PROJECT_VERSION=' | cut -d= -f2)" >> $GITHUB_OUTPUT
- name: Upload uber-jar
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: firebolt-jdbc-${{ steps.project-version.outputs.PROJECT_VERSION }}.jar
path: build/libs/firebolt-jdbc-${{ steps.project-version.outputs.PROJECT_VERSION }}.jar
- name: Upload sources-jar
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: firebolt-jdbc-${{ steps.project-version.outputs.PROJECT_VERSION }}-sources.jar
path: build/libs/firebolt-jdbc-${{ steps.project-version.outputs.PROJECT_VERSION }}-sources.jar
13 changes: 11 additions & 2 deletions .github/workflows/integration-test-v1.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
name: Run integration tests v1

on:
workflow_dispatch:
inputs:
database:
description: 'Database override'
required: false
default: ''
engine:
description: 'Engine override'
required: false
workflow_call:
inputs:
database:
description: 'Database - a new one will be created if not provided'
description: 'Database override'
required: false
default: ''
type: string
engine:
description: 'Engine - a new one will be created if not provided'
description: 'Engine override'
required: false
type: string
secrets:
Expand Down
53 changes: 31 additions & 22 deletions .github/workflows/integration-test-v2.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,34 @@
name: Run integration tests v2

on:
workflow_dispatch:
inputs:
database:
description: 'Database override'
required: false
default: ''
engine:
description: 'Engine override'
required: false
account:
description: 'Account override'
required: false
type: string
workflow_call:
inputs:
database:
description: 'Database - a new one will be created if not provided'
description: 'Database override'
required: false
default: ''
type: string
engine:
description: 'Engine - a new one will be created if not provided'
description: 'Engine override'
required: false
type: string
account:
description: 'Account'
required: true
description: 'Account override'
required: false
type: string
run_setup:
description: 'Run setup database and engine using GitHub action'
required: true
type: boolean
default: true
secrets:
FIREBOLT_CLIENT_ID_STG_NEW_IDN:
required: true
Expand All @@ -39,6 +47,17 @@ jobs:
script: |
core.setFailed("Database and Engine parameters should be provided simultaneously")
- name: Resolve account
id: set-account
run: |
if ! [[ -z "${{ inputs.account }}" ]]; then
echo "account=${{ inputs.account }}" >> $GITHUB_OUTPUT
echo "account=${{ inputs.account }}"
else
echo "account=${{ vars.FIREBOLT_ACCOUNT }}" >> $GITHUB_OUTPUT
echo "account=${{ vars.FIREBOLT_ACCOUNT }}"
fi
- name: Check out code
uses: actions/checkout@v3

Expand All @@ -50,14 +69,13 @@ jobs:

- name: Setup database and engine
id: setup
if: ${{ (inputs.database == '') && (inputs.run_setup == true) }}
if: ${{ inputs.database == '' }}
uses: firebolt-db/integration-testing-setup@v2
with:
firebolt-client-id: ${{ secrets.FIREBOLT_CLIENT_ID_STG_NEW_IDN }}
firebolt-client-secret: ${{ secrets.FIREBOLT_CLIENT_SECRET_STG_NEW_IDN }}
account: ${{ inputs.account }}
account: ${{ steps.set-account.outputs.account }}
api-endpoint: "api.staging.firebolt.io"
instance-type: "B2"

- name: Determine database name
id: find-database-name
Expand All @@ -77,14 +95,5 @@ jobs:
echo "engine_name=${{ steps.setup.outputs.engine_name }}" >> $GITHUB_OUTPUT
fi
- name: Setup env by build
id: setup-env
run: |
if [ ${{ inputs.run_setup }} == true ]; then
echo "run_setup=false" >> $GITHUB_OUTPUT
else
echo "run_setup=true" >> $GITHUB_OUTPUT
fi
- name: Run integration tests
run: ./gradlew integrationTest -Ddb=${{ steps.find-database-name.outputs.database_name }} -Denv=staging -Dclient_secret="${{ secrets.FIREBOLT_CLIENT_SECRET_STG_NEW_IDN }}" -Dclient_id="${{ secrets.FIREBOLT_CLIENT_ID_STG_NEW_IDN }}" -Daccount="${{ inputs.account }}" -Dengine="${{ steps.find-engine-name.outputs.engine_name }}" -DexcludeTags=v1 -Drun_setup="${{ steps.setup-env.outputs.run_setup }}"
run: ./gradlew integrationTest -Ddb=${{ steps.find-database-name.outputs.database_name }} -Denv=staging -Dclient_secret="${{ secrets.FIREBOLT_CLIENT_SECRET_STG_NEW_IDN }}" -Dclient_id="${{ secrets.FIREBOLT_CLIENT_ID_STG_NEW_IDN }}" -Daccount="${{ steps.set-account.outputs.account }}" -Dengine="${{ steps.find-engine-name.outputs.engine_name }}" -DexcludeTags=v1
69 changes: 1 addition & 68 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,84 +2,17 @@ name: Run integration tests

on:
workflow_dispatch:
inputs:
database1:
description: 'Database (v1) - a new one will be created if not provided'
required: false
default: ''
database2:
description: 'Database (v2) - a new one will be created if not provided'
required: false
default: ''
database-with-engine-v2:
description: 'Database (v2) for Firebolt v2 - a new one will be created if not provided'
required: false
default: ''
engine1:
description: 'Engine (v1) - a new one will be created if not provided'
required: false
engine2:
description: 'Engine (v2) - a new one will be created if not provided'
required: false
engine_v2_fb_2_0:
description: 'Engine (v2) for Firebolt v2 - a new one will be created if not provided'
required: false
run-v1:
description: 'Run tests against Firebolt DB v1'
required: true
default: true
type: choice
options:
- 'true'
- 'false'
run-v2:
description: 'Run tests against Firebolt DB v2'
required: true
default: true
type: choice
options:
- 'true'
- 'false'
run-database-with-engine-v2:
description: 'Run tests against Firebolt DB v2 and Engine V2'
required: true
default: true
type: choice
options:
- 'true'
- 'false'
workflow_call:

jobs:
run-integration-tests1:
if: ${{ inputs.run-v1 == 'true' }}
uses: ./.github/workflows/integration-test-v1.yml
with:
database: ${{ inputs.database1 }}
engine: ${{ inputs.engine1 }}
secrets:
FIREBOLT_STG_USERNAME: ${{ secrets.FIREBOLT_STG_USERNAME }}
FIREBOLT_STG_PASSWORD: ${{ secrets.FIREBOLT_STG_PASSWORD }}

run-integration-tests2:
if: ${{ inputs.run-v2 == 'true' }}
uses: ./.github/workflows/integration-test-v2.yml
with:
database: ${{ inputs.database2 }}
engine: ${{ inputs.engine2 }}
account: ${{ vars.FIREBOLT_ACCOUNT_V1 }}
run_setup: true
secrets:
FIREBOLT_CLIENT_ID_STG_NEW_IDN: ${{ secrets.FIREBOLT_CLIENT_ID_STG_NEW_IDN }}
FIREBOLT_CLIENT_SECRET_STG_NEW_IDN: ${{ secrets.FIREBOLT_CLIENT_SECRET_STG_NEW_IDN }}

run-integration-tests-engine2:
if: ${{ inputs.run-database-with-engine-v2 == 'true' }}
uses: ./.github/workflows/integration-test-v2.yml
with:
database: ${{ inputs.database-with-engine-v2 }}
engine: ${{ inputs.engine_v2_fb_2_0 }}
account: ${{ vars.FIREBOLT_ACCOUNT_V2 }}
run_setup: false
secrets:
FIREBOLT_CLIENT_ID_STG_NEW_IDN: ${{ secrets.FIREBOLT_CLIENT_ID_STG_NEW_IDN }}
FIREBOLT_CLIENT_SECRET_STG_NEW_IDN: ${{ secrets.FIREBOLT_CLIENT_SECRET_STG_NEW_IDN }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/performance-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
mkdir dependencies
- name: Download uber-jar
id: download-jar
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4.1.7
with:
name: ${{ needs.build.outputs.uber-jar }}
path: dependencies
Expand Down Expand Up @@ -63,12 +63,12 @@ jobs:
outputReportsFolder: reports/
args: -Jdatabase=${{ steps.find-database-name.outputs.database_name }} -Jpassword=${{ secrets.SERVICE_ACCOUNT_SECRET_STAGING }} -Jusername=${{ secrets.SERVICE_ACCOUNT_ID_STAGING }} -Jdriver=${{ needs.build.outputs.uber-jar }} -Jenvironment=staging -Jthreads=${{ inputs.threads }} -Jloops=${{ inputs.loops }}
- name: Upload JMeter report
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: performance_test_report
path: reports
- name: Upload JMeter logs
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: jmeter_log.log
path: jmeter_log.log
Expand Down
15 changes: 11 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ name: Release new version
on:
release:
types: [published]
workflow_dispatch:
inputs:
tag_name:
description: 'Tag name to publish'
required: true

jobs:
build:
Expand All @@ -15,13 +20,13 @@ jobs:
- name: Check out code
uses: actions/checkout@v3
with:
ref: ${{ github.event.release.tag_name }}
ref: ${{ github.event.release.tag_name || github.event.inputs.tag_name}}
- name: Download uber-jar
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4.1.7
with:
name: ${{ needs.build.outputs.uber-jar }}
- name: Download sources-jar
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4.1.7
with:
name: ${{ needs.build.outputs.sources-jar }}
- uses: xresloader/upload-to-github-release@v1
Expand All @@ -31,8 +36,10 @@ jobs:
file: ${{ needs.build.outputs.uber-jar }}
tags: true
draft: false
- name: Deploy to Repsy repository
- name: Deploy to Maven Central repository
run: ./gradlew publish
env:
MAVEN_REPO_USERNAME: ${{ secrets.MAVEN_REPO_USERNAME }}
MAVEN_REPO_PASSWORD: ${{ secrets.MAVEN_REPO_PASSWORD }}
GRADLE_SIGNING_KEY: ${{ secrets.GRADLE_SIGNING_KEY }}
GRADLE_SIGNING_PASSWORD: ${{ secrets.GRADLE_SIGNING_PASSWORD }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
The official JDBC driver for Firebolt.

## Documentation
To download the JDBC driver and learn how to use it, please see the official [Firebolt documentation](https://docs.firebolt.io/developing-with-firebolt/connecting-with-jdbc.html).
To download the JDBC driver and learn how to use it, please see the official [Firebolt documentation](https://docs.firebolt.io/Guides/developing-with-firebolt/connecting-with-jdbc.html).

## Development
The code of this repository is formatted using the Eclipse formatter, which was chosen because it is supported by multiple modern IDEs (such as Intellij).
Expand Down
46 changes: 13 additions & 33 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
import java.util.jar.JarFile
import java.util.stream.Stream

import static java.util.stream.Collectors.toList

plugins {
id 'java'
id 'jacoco'
id "org.sonarqube" version "5.0.0.4638"
id "org.sonarqube" version "5.1.0.4882"
id 'maven-publish'
id 'com.github.johnrengelman.shadow' version '8.0.0'
id 'org.quiltmc.gradle.licenser' version '2.0.2'
id 'signing'
}

Expand Down Expand Up @@ -73,25 +69,25 @@ dependencies {
implementation fileTree(dir: 'libs', includes: ['*.jar'])

compileOnly 'org.slf4j:slf4j-api:2.0.13'
compileOnly 'org.projectlombok:lombok:1.18.32'
annotationProcessor 'org.projectlombok:lombok:1.18.32'
testCompileOnly 'org.projectlombok:lombok:1.18.32'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.32'
compileOnly 'org.projectlombok:lombok:1.18.34'
annotationProcessor 'org.projectlombok:lombok:1.18.34'
testCompileOnly 'org.projectlombok:lombok:1.18.34'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.34'

testImplementation 'ch.qos.logback:logback-classic:1.5.6'
testImplementation 'org.mockito:mockito-junit-jupiter:5.10.0'
testImplementation 'org.mockito:mockito-core:5.10.0'
testImplementation 'org.mockito:mockito-inline:5.2.0'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.2'
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.10.2'
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.10.2'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.11.3'
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.11.3'
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.11.3'
testImplementation 'org.junit-pioneer:junit-pioneer:2.2.0'
testImplementation 'org.hamcrest:hamcrest-library:2.2'
testImplementation 'com.squareup.okhttp3:mockwebserver:4.12.0'
testImplementation 'com.squareup.okhttp3:okhttp-tls:4.12.0'
testImplementation 'io.zonky.test:embedded-postgres:2.0.7'
testCompileOnly 'org.slf4j:slf4j-api:2.0.13'
testCommonImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.2'
testCommonImplementation 'org.junit.jupiter:junit-jupiter-api:5.11.3'
testImplementation sourceSets.testCommon.output
compileTestJava.dependsOn processTestResources
jar.dependsOn processTestResources
Expand All @@ -115,25 +111,6 @@ test {
}

tasks.register('integrationTest', Test) {
doFirst {
if (Boolean.parseBoolean(System.getProperty("run_setup", "false"))) {
URL[] urls = Stream.concat(sourceSets.integrationTest.output.getFiles().stream(), sourceSets.integrationTest.compileClasspath.getFiles().stream())
.map(f -> f.toURI().toURL()).collect(toList()).toArray()
ClassLoader classLoader = new URLClassLoader(urls)
def mgr = classLoader.loadClass("integration.EnvironmentManager").newInstance(new Object[0]);
ext.environmentManager = mgr
Properties props = mgr.create()
props.each {
systemProperty it.key, it.value
}
}
}
doLast {
if (Boolean.parseBoolean(System.getProperty("run_setup", "false"))) {
def mgr = ext.environmentManager
mgr.cleanup()
}
}
description = 'Runs integration tests.'
useJUnitPlatform() {
includeTags(System.getProperty("includeTags", "common").split(","))
Expand Down Expand Up @@ -357,8 +334,11 @@ task generateJavadoc(type: Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}


signing {
def signingKey = System.getenv("GRADLE_SIGNING_KEY")
def signingPassword = System.getenv("GRADLE_SIGNING_PASSWORD")
useInMemoryPgpKeys(signingKey, signingPassword)

sign publishing.publications
}

Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version=3.0.4-SNAPSHOT
jdbcVersion=4.3
version=3.2.1
jdbcVersion=4.3
Loading

0 comments on commit 63cd982

Please sign in to comment.