Skip to content

Commit

Permalink
fix: Keepalive timeout + Fir 29419 release action (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
stepansergeevitch committed Jan 26, 2024
1 parent c5192a5 commit c037809
Show file tree
Hide file tree
Showing 14 changed files with 439 additions and 363 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# This workflow will install Python dependencies, run pre-commit checks, and run tests with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Build

on:
Expand Down
115 changes: 115 additions & 0 deletions .github/workflows/integration-tests-v1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
name: Integration tests 1.0
on:
workflow_dispatch:
inputs:
environment:
description: 'Environment to run the tests against'
type: choice
required: true
default: 'dev'
options:
- dev
- staging
database:
description: 'Database - a new one will be created if not provided'
required: false
default: ''
engine:
description: 'Engine - a new one will be created if not provided'
required: false

workflow_call:
inputs:
environment:
default: 'staging'
required: false
type: string
secrets:
FIREBOLT_USERNAME:
required: true
FIREBOLT_PASSWORD:
required: true
FIREBOLT_STG_USERNAME:
required: true
FIREBOLT_STG_PASSWORD:
required: true

jobs:
tests:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
with:
ref: ${{ inputs.branch }}

- name: Set up .NET 6.0
id: dotnet-setup
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0

- name: use .NET 6.0
run: |
dotnet new globaljson --sdk-version '${{ steps.dotnet-setup.outputs.dotnet-version }}'
- name: Install dependencies
run: |
dotnet restore
- name: Determine env variables
run: |
if [ "${{ github.event.inputs.environment }}" == 'staging' ]; then
echo "USERNAME=${{ secrets.FIREBOLT_STG_USERNAME }}" >> "$GITHUB_ENV"
echo "PASSWORD=${{ secrets.FIREBOLT_STG_PASSWORD }}" >> "$GITHUB_ENV"
echo "EXCLUDE_ENV=dev" >> "$GITHUB_ENV"
else
echo "USERNAME=${{ secrets.FIREBOLT_USERNAME }}" >> "$GITHUB_ENV"
echo "PASSWORD=${{ secrets.FIREBOLT_PASSWORD }}" >> "$GITHUB_ENV"
echo "EXCLUDE_ENV=staging" >> "$GITHUB_ENV"
fi
- name: Keep environment name in the summary
run: echo '### Ran integration tests against ${{ inputs.environment }} ' >> $GITHUB_STEP_SUMMARY

- name: Setup database and engine
if: ${{ github.event.inputs.database == '' }}
id: setup
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
- name: Determine engine name
id: find-engine-name
run: |
if ! [[ -z "${{ github.event.inputs.engine }}" ]]; then
echo "engine_name=${{ github.event.inputs.engine }}" >> $GITHUB_OUTPUT
else
echo "engine_name=${{ steps.setup.outputs.engine_name }}" >> $GITHUB_OUTPUT
fi
- name: Run integration tests
env:
FIREBOLT_ENV: ${{ inputs.environment }}
FIREBOLT_DATABASE: ${{ steps.setup.outputs.database_name }}
FIREBOLT_ENGINE_NAME: ${{ steps.setup.outputs.engine_name }}
FIREBOLT_ENDPOINT: "api.${{ github.event.inputs.environment }}.firebolt.io"
FIREBOLT_USERNAME: ${{ env.USERNAME }}
FIREBOLT_PASSWORD: ${{ env.PASSWORD }}
EXCLUDE_ENV: ${{ env.EXCLUDE_ENV }}
run: |
dotnet test --filter '(Category=Integration|Category=v1)&Category!=v2&Category!=${{ env.EXCLUDE_ENV }}' -l "console;verbosity=normal"
113 changes: 113 additions & 0 deletions .github/workflows/integration-tests-v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
name: Integration tests 2.0
on:
workflow_dispatch:
inputs:
environment:
description: 'Environment to run the tests against'
type: choice
required: true
default: 'dev'
options:
- dev
- staging
database:
description: 'Database - a new one will be created if not provided'
required: false
default: ''
engine:
description: 'Engine - a new one will be created if not provided'
required: false
workflow_call:
inputs:
environment:
default: 'staging'
required: false
type: string
secrets:
FIREBOLT_CLIENT_ID_STG_NEW_IDN:
required: true
FIREBOLT_CLIENT_SECRET_STG_NEW_IDN:
required: true
FIREBOLT_CLIENT_ID_DEV_NEW_IDN:
required: true
FIREBOLT_CLIENT_SECRET_DEV_NEW_IDN:
required: true

jobs:
tests:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
with:
ref: ${{ inputs.branch }}

- name: Set up .NET 6.0
id: dotnet-setup
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0

- name: use .NET 6.0
run: |
dotnet new globaljson --sdk-version '${{ steps.dotnet-setup.outputs.dotnet-version }}'
- name: Install dependencies
run: |
dotnet restore
- name: Determine env variables
run: |
if [ "${{ inputs.environment }}" == 'staging' ]; then
echo "CLIENT_ID=${{ secrets.FIREBOLT_CLIENT_ID_STG_NEW_IDN }}" >> "$GITHUB_ENV"
echo "CLIENT_SECRET=${{ secrets.FIREBOLT_CLIENT_SECRET_STG_NEW_IDN }}" >> "$GITHUB_ENV"
echo "EXCLUDE_ENV=dev" >> "$GITHUB_ENV"
else
echo "CLIENT_ID=${{ secrets.FIREBOLT_CLIENT_ID_DEV_NEW_IDN }}" >> "$GITHUB_ENV"
echo "CLIENT_SECRET=${{ secrets.FIREBOLT_CLIENT_SECRET_DEV_NEW_IDN }}" >> "$GITHUB_ENV"
echo "EXCLUDE_ENV=staging" >> "$GITHUB_ENV"
fi
- name: Keep environment name in the summary
run: echo '### Ran integration tests against ${{ inputs.environment }} ' >> $GITHUB_STEP_SUMMARY

- name: Setup database and engine
if: ${{ github.event.inputs.database == '' }}
id: setup
uses: firebolt-db/integration-testing-setup@v2
with:
firebolt-client-id: ${{ env.CLIENT_ID }}
firebolt-client-secret: ${{ env.CLIENT_SECRET }}
account: ${{ vars.FIREBOLT_ACCOUNT }}
api-endpoint: "api.${{ github.event.inputs.environment }}.firebolt.io"
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
- name: Determine engine name
id: find-engine-name
run: |
if ! [[ -z "${{ github.event.inputs.engine }}" ]]; then
echo "engine_name=${{ github.event.inputs.engine }}" >> $GITHUB_OUTPUT
else
echo "engine_name=${{ steps.setup.outputs.engine_name }}" >> $GITHUB_OUTPUT
fi
- name: Run integration tests
env:
FIREBOLT_ENV: ${{ inputs.environment }}
FIREBOLT_ACCOUNT: ${{ vars.FIREBOLT_ACCOUNT }}
FIREBOLT_DATABASE: ${{ steps.setup.outputs.database_name }}
FIREBOLT_ENGINE_NAME: ${{ steps.setup.outputs.engine_name }}
FIREBOLT_CLIENT_ID: ${{ env.CLIENT_ID }}
FIREBOLT_CLIENT_SECRET: ${{ env.CLIENT_SECRET }}
EXCLUDE_ENV: ${{ env.EXCLUDE_ENV }}
run: |
dotnet test --filter '(Category=Integration|Category=v2)&Category!=v1&Category!=${{ env.EXCLUDE_ENV }}' -l "console;verbosity=normal"

0 comments on commit c037809

Please sign in to comment.