Skip to content

Commit

Permalink
Merge branch 'master' into ci_fix_publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
stepansergeevitch authored Jul 3, 2024
2 parents 6650b0e + 59750f7 commit 767bce4
Show file tree
Hide file tree
Showing 186 changed files with 13,047 additions and 5,713 deletions.
72 changes: 72 additions & 0 deletions .github/workflows/integration-test-v1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Run integration tests v1

on:
workflow_call:
inputs:
database:
description: 'Database - a new one will be created if not provided'
required: false
default: ''
type: string
engine:
description: 'Engine - a new one will be created if not provided'
required: false
type: string
secrets:
FIREBOLT_STG_USERNAME:
required: true
FIREBOLT_STG_PASSWORD:
required: true

jobs:
run-integration-tests:
runs-on: ubuntu-latest

steps:
- name: Validate database and engine
if: ${{ (inputs.database == '') != (inputs.engine == '') }}
uses: actions/github-script@v3
with:
script: |
core.setFailed("Database and Engine parameters should be provided simultaneously")
- name: Check out code
uses: actions/checkout@v3

- name: Prepare java
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'

- name: Setup database and engine
id: setup
if: ${{ inputs.database == '' }}
uses: firebolt-db/integration-testing-setup@v1
with:
firebolt-username: ${{ secrets.FIREBOLT_STG_USERNAME }}
firebolt-password: ${{ secrets.FIREBOLT_STG_PASSWORD }}
api-endpoint: "api.staging.firebolt.io"
region: "us-east-1"
instance-type: "B2"

- name: Determine database name
id: find-database-name
run: |
if ! [[ -z "${{ inputs.database }}" ]]; then
echo "database_name=${{ inputs.database }}" >> $GITHUB_OUTPUT
else
echo "database_name=${{ steps.setup.outputs.database_name }}" >> $GITHUB_OUTPUT
fi
- name: Determine engine name
id: find-engine-name
run: |
if ! [[ -z "${{ inputs.engine }}" ]]; then
echo "engine_name=${{ inputs.engine }}" >> $GITHUB_OUTPUT
else
echo "engine_name=${{ steps.setup.outputs.engine_name }}" >> $GITHUB_OUTPUT
fi
- name: Run integration tests
run: ./gradlew integrationTest -Ddb=${{ steps.find-database-name.outputs.database_name }} -Dapi=api.staging.firebolt.io -Dpassword="${{ secrets.FIREBOLT_STG_PASSWORD }}" -Duser="${{ secrets.FIREBOLT_STG_USERNAME }}" -Dengine="${{ steps.find-engine-name.outputs.engine_name }}" -DexcludeTags=v2
75 changes: 75 additions & 0 deletions .github/workflows/integration-test-v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Run integration tests v2

on:
workflow_call:
inputs:
database:
description: 'Database - a new one will be created if not provided'
required: false
default: ''
type: string
engine:
description: 'Engine - a new one will be created if not provided'
required: false
type: string
account:
description: 'Account'
required: true
type: string
secrets:
FIREBOLT_CLIENT_ID_STG_NEW_IDN:
required: true
FIREBOLT_CLIENT_SECRET_STG_NEW_IDN:
required: true

jobs:
run-integration-tests:
runs-on: ubuntu-latest

steps:
- name: Validate database and engine
if: ${{ (inputs.database == '') != (inputs.engine == '') }}
uses: actions/github-script@v3
with:
script: |
core.setFailed("Database and Engine parameters should be provided simultaneously")
- name: Check out code
uses: actions/checkout@v3

- name: Prepare java
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'

- name: Setup database and engine
id: setup
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 }}
api-endpoint: "api.staging.firebolt.io"

- name: Determine database name
id: find-database-name
run: |
if ! [[ -z "${{ inputs.database }}" ]]; then
echo "database_name=${{ inputs.database }}" >> $GITHUB_OUTPUT
else
echo "database_name=${{ steps.setup.outputs.database_name }}" >> $GITHUB_OUTPUT
fi
- name: Determine engine name
id: find-engine-name
run: |
if ! [[ -z "${{ inputs.engine }}" ]]; then
echo "engine_name=${{ inputs.engine }}" >> $GITHUB_OUTPUT
else
echo "engine_name=${{ steps.setup.outputs.engine_name }}" >> $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
110 changes: 44 additions & 66 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,78 +3,56 @@ name: Run integration tests
on:
workflow_dispatch:
inputs:
database:
description: 'Database - a new one will be created if not provided'
database1:
description: 'Database (v1) - a new one will be created if not provided'
required: false
default: ''
environment:
description: 'Environment to run the tests against'
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
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-database-with-engine-v2:
description: 'Run tests against Firebolt DB v2 and Engine V2'
required: true
default: 'staging'
default: true
type: choice
options:
- dev
- staging
- 'true'
- 'false'

jobs:
run-integration-tests:
runs-on: ubuntu-latest

steps:
- name: "Foresight: Collect Workflow Telemetry"
uses: runforesight/foresight-workflow-kit-action@v1
if: ${{ always() }}
- name: Check out code
uses: actions/checkout@v3

- name: Prepare java
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'
- name: Determine env variables
run: |
if [ "${{ github.event.inputs.environment }}" == 'staging' ]; then
echo "USERNAME=${{ secrets.FIREBOLT_USERNAME_STAGING }}" >> "$GITHUB_ENV"
echo "PASSWORD=${{ secrets.FIREBOLT_PASSWORD_STAGING }}" >> "$GITHUB_ENV"
echo "SERVICE_ACCOUNT_ID=${{ secrets.SERVICE_ACCOUNT_ID_STAGING }}" >> "$GITHUB_ENV"
echo "SERVICE_ACCOUNT_SECRET=${{ secrets.SERVICE_ACCOUNT_SECRET_STAGING }}" >> "$GITHUB_ENV"
else
echo "USERNAME=${{ secrets.FIREBOLT_USERNAME_DEV }}" >> "$GITHUB_ENV"
echo "PASSWORD=${{ secrets.FIREBOLT_PASSWORD_DEV }}" >> "$GITHUB_ENV"
echo "SERVICE_ACCOUNT_ID=${{ secrets.SERVICE_ACCOUNT_ID_DEV }}" >> "$GITHUB_ENV"
echo "SERVICE_ACCOUNT_SECRET=${{ secrets.SERVICE_ACCOUNT_SECRET_DEV }}" >> "$GITHUB_ENV"
fi
- name: Setup database and engine
id: setup
if: ${{ github.event.inputs.database == '' }}
uses: firebolt-db/integration-testing-setup@v1
with:
firebolt-username: ${{ env.USERNAME }}
firebolt-password: ${{ env.PASSWORD }}
api-endpoint: "api.${{ github.event.inputs.environment }}.firebolt.io"
region: "us-east-1"
instance-type: "B2"

- name: Determine database name
id: find-database-name
run: |
if ! [[ -z "${{ github.event.inputs.database }}" ]]; then
echo "database_name=${{ github.event.inputs.database }}" >> $GITHUB_OUTPUT
else
echo "database_name=${{ steps.setup.outputs.database_name }}" >> $GITHUB_OUTPUT
fi
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 }}

- name: Run integration tests
run: ./gradlew integrationTest -Ddb=${{ steps.find-database-name.outputs.database_name }} -Dapi=api.${{ github.event.inputs.environment }}.firebolt.io -Dpassword="${{ env.SERVICE_ACCOUNT_SECRET }}" -Duser="${{ env.SERVICE_ACCOUNT_ID }}"
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 }}
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 }}

- name: "Foresight: Analyze Test Results"
uses: runforesight/foresight-test-kit-action@v1
if: success() || failure()
with:
test_format: JUNIT
test_framework: JUNIT
test_path: ./build/test-results/
tags: |
type:"integration"
language:"Java"
14 changes: 7 additions & 7 deletions .github/workflows/performance-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ jobs:
path: dependencies
- name: Setup database and engine
id: setup
if: ${{ github.event.inputs.database == '' }}
if: ${{ inputs.database == '' }}
uses: firebolt-db/integration-testing-setup@v1
with:
firebolt-username: ${{ secrets.FIREBOLT_USERNAME_STAGING }}
firebolt-password: ${{ secrets.FIREBOLT_PASSWORD_STAGING }}
firebolt-username: ${{ secrets.FIREBOLT_STG_USERNAME }}
firebolt-password: ${{ secrets.FIREBOLT_STG_PASSWORD }}
api-endpoint: "api.staging.firebolt.io"
region: "us-east-1"
instance-type: "C2"
Expand All @@ -49,8 +49,8 @@ jobs:
- name: Determine database name
id: find-database-name
run: |
if ! [[ -z "${{ github.event.inputs.database }}" ]]; then
echo "database_name=${{ github.event.inputs.database }}" >> $GITHUB_OUTPUT
if ! [[ -z "${{ inputs.database }}" ]]; then
echo "database_name=${{ inputs.database }}" >> $GITHUB_OUTPUT
else
echo "database_name=${{ steps.setup.outputs.database_name }}" >> $GITHUB_OUTPUT
fi
Expand All @@ -61,7 +61,7 @@ jobs:
testFilePath: JDBC.jmx
dependencyFolder: dependencies
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=${{ github.event.inputs.threads }} -Jloops=${{ github.event.inputs.loops }}
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
with:
Expand All @@ -78,7 +78,7 @@ jobs:
- name: Extract test summary
id: summary
run: |
result="$(date +"%d-%m-%y %T %Z"),${{ github.event.inputs.threads }},$(jq -r '.Total.sampleCount, .Total.errorCount, .Total.errorPct, .Total.meanResTime, .Total.medianResTime, .Total.minResTime, .Total.maxResTime, .Total.pct1ResTime, .Total.pct2ResTime, .Total.pct3ResTime, .Total.throughput | round' reports/statistics.json| tr '\n' '|' | sed 's/|$/\n/'),${{ steps.short-sha.outputs.short_sha }},$GITHUB_REF"
result="$(date +"%d-%m-%y %T %Z"),${{ inputs.threads }},$(jq -r '.Total.sampleCount, .Total.errorCount, .Total.errorPct, .Total.meanResTime, .Total.medianResTime, .Total.minResTime, .Total.maxResTime, .Total.pct1ResTime, .Total.pct2ResTime, .Total.pct3ResTime, .Total.throughput | round' reports/statistics.json| tr '\n' '|' | sed 's/|$/\n/'),${{ steps.short-sha.outputs.short_sha }},$GITHUB_REF"
echo "SUMMARY=$(echo "$result" | tr '|' ',')" >> $GITHUB_OUTPUT
sudo rm -rf "/home/runner/work/jdbc/jdbc/reports"
- name: Checkout history branch
Expand Down
Loading

0 comments on commit 767bce4

Please sign in to comment.