Skip to content
Merged
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
42 changes: 7 additions & 35 deletions .github/workflows/integration-tests-v1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,8 @@ name: v1 Integration tests

on:
workflow_dispatch:
inputs:
environment:
description: 'Environment to run the tests against'
type: choice
required: true
default: 'dev'
options:
- dev
- staging
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:
Expand All @@ -44,23 +26,13 @@ jobs:
python -m pip install --upgrade pip
pip install ".[dev]"

- name: Determine env variables
run: |
if [ "${{ inputs.environment }}" == 'staging' ]; then
echo "USERNAME=${{ secrets.FIREBOLT_STG_USERNAME }}" >> "$GITHUB_ENV"
echo "PASSWORD=${{ secrets.FIREBOLT_STG_PASSWORD }}" >> "$GITHUB_ENV"
else
echo "USERNAME=${{ secrets.FIREBOLT_USERNAME }}" >> "$GITHUB_ENV"
echo "PASSWORD=${{ secrets.FIREBOLT_PASSWORD }}" >> "$GITHUB_ENV"
fi

- name: Setup database and engine
id: setup
uses: firebolt-db/integration-testing-setup@v1
with:
firebolt-username: ${{ env.USERNAME }}
firebolt-password: ${{ env.PASSWORD }}
api-endpoint: "api.${{ inputs.environment }}.firebolt.io"
firebolt-username: ${{ secrets.FIREBOLT_STG_USERNAME }}
firebolt-password: ${{ secrets.FIREBOLT_STG_PASSWORD }}
api-endpoint: "api.staging.firebolt.io"
region: "us-east-1"

- name: Restore cached failed tests
Expand All @@ -74,14 +46,14 @@ jobs:
- name: Run integration tests
env:
# the distinction is on the SDK side so just use CLIENT_* for username password
CLIENT_ID: ${{ env.USERNAME }}
CLIENT_SECRET: ${{ env.PASSWORD }}
CLIENT_ID: ${{ secrets.FIREBOLT_STG_USERNAME }}
CLIENT_SECRET: ${{ secrets.FIREBOLT_STG_PASSWORD }}
DATABASE_NAME: ${{ steps.setup.outputs.database_name }}
ENGINE_NAME: ${{ steps.setup.outputs.engine_name }}
ENGINE_URL: ${{ steps.setup.outputs.engine_url }}
STOPPED_ENGINE_NAME: ${{ steps.setup.outputs.stopped_engine_name }}
STOPPED_ENGINE_URL: ${{ steps.setup.outputs.stopped_engine_url }}
FIREBOLT_BASE_URL: "api.${{ inputs.environment }}.firebolt.io"
FIREBOLT_BASE_URL: "api.staging.firebolt.io"
ACCOUNT_NAME: "firebolt"
run: |
pytest --last-failed -o log_cli=true -o log_cli_level=INFO tests/integration
Expand All @@ -93,4 +65,4 @@ jobs:
with:
path: |
.pytest_cache/v/cache/lastfailed
key: ${{ steps.cache-tests-restore.outputs.cache-primary-key }}
key: ${{ steps.cache-tests-restore.outputs.cache-primary-key }}
44 changes: 8 additions & 36 deletions .github/workflows/integration-tests-v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,12 @@ name: v2 Integration tests

on:
workflow_dispatch:
inputs:
environment:
description: 'Environment to run the tests against'
type: choice
required: true
default: 'dev'
options:
- dev
- staging
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_NEW_IDN:
required: true
FIREBOLT_CLIENT_SECRET_NEW_IDN:
required: true

jobs:
integration-tests:
Expand All @@ -44,24 +26,14 @@ jobs:
python -m pip install --upgrade pip
pip install ".[dev]"

- 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"
else
echo "CLIENT_ID=${{ secrets.FIREBOLT_CLIENT_ID_NEW_IDN }}" >> "$GITHUB_ENV"
echo "CLIENT_SECRET=${{ secrets.FIREBOLT_CLIENT_SECRET_NEW_IDN }}" >> "$GITHUB_ENV"
fi

- name: Setup database and engine
id: setup
uses: firebolt-db/integration-testing-setup@v2
with:
firebolt-client-id: ${{ env.CLIENT_ID }}
firebolt-client-secret: ${{ env.CLIENT_SECRET }}
account: "developer"
api-endpoint: "api.${{ inputs.environment }}.firebolt.io"
firebolt-client-id: ${{ secrets.FIREBOLT_CLIENT_ID_STG_NEW_IDN }}
firebolt-client-secret: ${{ secrets.FIREBOLT_CLIENT_SECRET_STG_NEW_IDN }}
account: ${{ vars.FIREBOLT_ACCOUNT }}
api-endpoint: "api.staging.firebolt.io"

- name: Restore cached failed tests
id: cache-tests-restore
Expand All @@ -73,13 +45,13 @@ jobs:

- name: Run integration tests
env:
CLIENT_ID: ${{ env.CLIENT_ID }}
CLIENT_SECRET: ${{ env.CLIENT_SECRET }}
CLIENT_ID: ${{ secrets.FIREBOLT_CLIENT_ID_STG_NEW_IDN }}
CLIENT_SECRET: ${{ secrets.FIREBOLT_CLIENT_SECRET_STG_NEW_IDN }}
DATABASE_NAME: ${{ steps.setup.outputs.database_name }}
ENGINE_NAME: ${{ steps.setup.outputs.engine_name }}
STOPPED_ENGINE_NAME: ${{ steps.setup.outputs.stopped_engine_name }}
FIREBOLT_BASE_URL: "api.${{ inputs.environment }}.firebolt.io"
ACCOUNT_NAME: "developer"
FIREBOLT_BASE_URL: "api.staging.firebolt.io"
ACCOUNT_NAME: ${{ vars.FIREBOLT_ACCOUNT }}
run: |
pytest --last-failed -o log_cli=true -o log_cli_level=INFO tests/integration

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/nightly-v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
with:
firebolt-client-id: ${{ secrets.FIREBOLT_CLIENT_ID_STG_NEW_IDN }}
firebolt-client-secret: ${{ secrets.FIREBOLT_CLIENT_SECRET_STG_NEW_IDN }}
account: "developer"
account: ${{ vars.FIREBOLT_ACCOUNT }}
api-endpoint: "api.staging.firebolt.io"
db_suffix: ${{ format('{0}_{1}', matrix.os, matrix.python-version) }}

Expand All @@ -67,7 +67,7 @@ jobs:
ENGINE_NAME: ${{ steps.setup.outputs.engine_name }}
STOPPED_ENGINE_NAME: ${{ steps.setup.outputs.stopped_engine_name }}
FIREBOLT_BASE_URL: "api.staging.firebolt.io"
ACCOUNT_NAME: "developer"
ACCOUNT_NAME: ${{ vars.FIREBOLT_ACCOUNT }}
run: |
pytest --last-failed -o log_cli=true -o log_cli_level=INFO --junit-xml=report/junit.xml tests/integration

Expand Down
26 changes: 0 additions & 26 deletions .github/workflows/python-integration-tests.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,8 @@
name: Integration tests
on:
workflow_dispatch:
inputs:
environment:
description: 'Environment to run the tests against'
type: choice
required: true
default: 'dev'
options:
- dev
- staging
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:
Expand All @@ -30,18 +12,10 @@ on:
required: true
FIREBOLT_CLIENT_SECRET_STG_NEW_IDN:
required: true
FIREBOLT_CLIENT_ID_NEW_IDN:
required: true
FIREBOLT_CLIENT_SECRET_NEW_IDN:
required: true
jobs:
integration-test-v1:
uses: ./.github/workflows/integration-tests-v1.yml
with:
environment: ${{ inputs.environment }}
secrets: inherit
integration-test-v2:
uses: ./.github/workflows/integration-tests-v2.yml
with:
environment: ${{ inputs.environment }}
secrets: inherit
15 changes: 0 additions & 15 deletions tests/integration/test_sqlalchemy_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,21 +74,6 @@ def test_agg_index(self, connection: Connection, fact_table_name: str):
)
connection.execute(text(f"DROP AGGREGATING INDEX {agg_index}"))

def test_join_index(self, connection: Connection, dimension_table_name: str):
# Test if sql parsing allows it
join_index = "idx_join"
connection.execute(
text(
f"""
CREATE JOIN INDEX {join_index} ON {dimension_table_name} (
idx,
dummy
);
"""
)
)
connection.execute(text(f"DROP JOIN INDEX {join_index}"))

def test_get_schema_names(self, engine: Engine, database_name: str):
results = engine.dialect.get_schema_names(engine)
assert "public" in results
Expand Down