Skip to content

Commit a63d993

Browse files
authored
refactor: Split sync and async execution (#251)
1 parent 510ccbc commit a63d993

File tree

25 files changed

+1369
-690
lines changed

25 files changed

+1369
-690
lines changed

.github/workflows/integration-tests.yml

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,21 @@
11
name: Integration tests
22
on:
33
workflow_dispatch:
4+
inputs:
5+
environment:
6+
description: 'Environment to run the tests against'
7+
type: choice
8+
required: true
9+
default: 'dev'
10+
options:
11+
- dev
12+
- staging
413
workflow_call:
514
inputs:
15+
environment:
16+
default: 'staging'
17+
required: false
18+
type: string
619
branch:
720
required: false
821
type: string
@@ -35,13 +48,27 @@ jobs:
3548
python -m pip install --upgrade pip
3649
pip install ".[dev]"
3750
51+
- name: Determine env variables
52+
run: |
53+
if [ "${{ inputs.environment }}" == 'staging' ]; then
54+
echo "USERNAME=${{ secrets.FIREBOLT_USERNAME_STAGING }}" >> "$GITHUB_ENV"
55+
echo "PASSWORD=${{ secrets.FIREBOLT_PASSWORD_STAGING }}" >> "$GITHUB_ENV"
56+
echo "CLIENT_ID=${{ secrets.FIREBOLT_CLIENT_ID_STAGING }}" >> "$GITHUB_ENV"
57+
echo "CLIENT_SECRET=${{ secrets.FIREBOLT_CLIENT_SECRET_STAGING }}" >> "$GITHUB_ENV"
58+
else
59+
echo "USERNAME=${{ secrets.FIREBOLT_USERNAME_DEV }}" >> "$GITHUB_ENV"
60+
echo "PASSWORD=${{ secrets.FIREBOLT_PASSWORD_DEV }}" >> "$GITHUB_ENV"
61+
echo "CLIENT_ID=${{ secrets.FIREBOLT_CLIENT_ID_DEV }}" >> "$GITHUB_ENV"
62+
echo "CLIENT_SECRET=${{ secrets.FIREBOLT_CLIENT_SECRET_DEV }}" >> "$GITHUB_ENV"
63+
fi
64+
3865
- name: Setup database and engine
3966
id: setup
4067
uses: firebolt-db/integration-testing-setup@master
4168
with:
4269
firebolt-username: ${{ secrets.FIREBOLT_USERNAME }}
4370
firebolt-password: ${{ secrets.FIREBOLT_PASSWORD }}
44-
api-endpoint: "api.dev.firebolt.io"
71+
api-endpoint: "api.${{ inputs.environment }}.firebolt.io"
4572
region: "us-east-1"
4673

4774
- name: Run integration tests
@@ -55,7 +82,7 @@ jobs:
5582
ENGINE_URL: ${{ steps.setup.outputs.engine_url }}
5683
STOPPED_ENGINE_NAME: ${{ steps.setup.outputs.stopped_engine_name }}
5784
STOPPED_ENGINE_URL: ${{ steps.setup.outputs.stopped_engine_url }}
58-
API_ENDPOINT: "api.dev.firebolt.io"
85+
API_ENDPOINT: "api.${{ inputs.environment }}.firebolt.io"
5986
ACCOUNT_NAME: "firebolt"
6087
run: |
6188
pytest -n 6 --dist loadgroup --timeout_method "signal" -o log_cli=true -o log_cli_level=INFO tests/integration --alluredir=allure-results

src/firebolt/async_db/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
from firebolt.async_db._types import (
1+
from firebolt.async_db.connection import Connection, connect
2+
from firebolt.async_db.cursor import Cursor
3+
from firebolt.common._types import (
24
ARRAY,
35
BINARY,
46
DATETIME,
@@ -14,8 +16,6 @@
1416
Timestamp,
1517
TimestampFromTicks,
1618
)
17-
from firebolt.async_db.connection import Connection, connect
18-
from firebolt.async_db.cursor import Cursor
1919
from firebolt.utils.exception import (
2020
DatabaseError,
2121
DataError,

0 commit comments

Comments
 (0)