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
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,4 @@ jobs:
needs: [unit-tests]
uses: ./.github/workflows/security-scan.yml
secrets:
FOSSA_TOKEN: ${{ secrets.FOSSA_TOKEN }}
SONARCLOUD_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }}
6 changes: 3 additions & 3 deletions .github/workflows/code-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ jobs:
uses: actions/checkout@v2
with:
ref: ${{ inputs.branch }}

- name: Set up Python 3.8
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: 3.8

- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,30 @@
name: v0.x Integration tests
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
SERVICE_ID:
FIREBOLT_STG_USERNAME:
required: true
SERVICE_SECRET:
FIREBOLT_STG_PASSWORD:
required: true

jobs:
Expand All @@ -19,11 +33,9 @@ jobs:
steps:
- name: Check out code
uses: actions/checkout@v2
with:
ref: 0.x

- name: Set up Python 3.7
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: 3.7

Expand All @@ -32,13 +44,23 @@ 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: ${{ secrets.FIREBOLT_USERNAME }}
firebolt-password: ${{ secrets.FIREBOLT_PASSWORD }}
api-endpoint: "api.dev.firebolt.io"
firebolt-username: ${{ env.USERNAME }}
firebolt-password: ${{ env.PASSWORD }}
api-endpoint: "api.${{ inputs.environment }}.firebolt.io"
region: "us-east-1"

- name: Restore cached failed tests
Expand All @@ -47,23 +69,23 @@ jobs:
with:
path: |
.pytest_cache/v/cache/lastfailed
key: ${{ runner.os }}-pytest-restore-failed-${{ github.ref }}-${{ github.sha }}
key: ${{ runner.os }}-pytest-restore-failed-${{ github.ref }}-${{ github.sha }}-v1

- name: Run integration tests
env:
USER_NAME: ${{ secrets.FIREBOLT_USERNAME }}
PASSWORD: ${{ secrets.FIREBOLT_PASSWORD }}
SERVICE_ID: ${{ secrets.SERVICE_ID }}
SERVICE_SECRET: ${{ secrets.SERVICE_SECRET }}
# the distinction is on the SDK side so just use CLIENT_* for username password
CLIENT_ID: ${{ env.USERNAME }}
CLIENT_SECRET: ${{ env.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.dev.firebolt.io"
FIREBOLT_BASE_URL: "api.${{ inputs.environment }}.firebolt.io"
ACCOUNT_NAME: "firebolt"
run: |
pytest --last-failed -o log_cli=true -o log_cli_level=INFO tests/integration

- name: Save failed tests
id: cache-tests-save
uses: actions/cache/save@v3
Expand Down
93 changes: 93 additions & 0 deletions .github/workflows/integration-tests-v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
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:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2

- name: Set up Python 3.7
uses: actions/setup-python@v5
with:
python-version: 3.7

- name: Install dependencies
run: |
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"

- name: Restore cached failed tests
id: cache-tests-restore
uses: actions/cache/restore@v3
with:
path: |
.pytest_cache/v/cache/lastfailed
key: ${{ runner.os }}-pytest-restore-failed-${{ github.ref }}-${{ github.sha }}-v2

- name: Run integration tests
env:
CLIENT_ID: ${{ env.CLIENT_ID }}
CLIENT_SECRET: ${{ env.CLIENT_SECRET }}
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"
run: |
pytest --last-failed -o log_cli=true -o log_cli_level=INFO tests/integration

- name: Save failed tests
id: cache-tests-save
uses: actions/cache/save@v3
if: failure()
with:
path: |
.pytest_cache/v/cache/lastfailed
key: ${{ steps.cache-tests-restore.outputs.cache-primary-key }}
Original file line number Diff line number Diff line change
@@ -1,44 +1,37 @@
name: v0.x Nightly code check
name: v1 Nightly code check
on:
workflow_dispatch:
schedule:
- cron: '0 4 * * *' # 4 am UTC every day
jobs:
code-check:
uses: ./.github/workflows/code-check.yml
with:
branch: 0.x
unit-tests:
uses: ./.github/workflows/unit-tests.yml
with:
branch: 0.x
secrets:
GIST_PAT: ${{ secrets.GIST_PAT }}
security-scan:
needs: [unit-tests]
uses: ./.github/workflows/security-scan.yml
with:
branch: 0.x
secrets:
FOSSA_TOKEN: ${{ secrets.FOSSA_TOKEN }}
SONARCLOUD_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }}
tests:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false # finish all jobs even if one fails
max-parallel: 2
matrix:
matrix:
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
python-version: ['3.7', '3.8', '3.9', '3.10']
steps:
- name: Check out code
uses: actions/checkout@v2

- name: Set up Python 3.7
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -52,9 +45,9 @@ jobs:
id: setup
uses: firebolt-db/integration-testing-setup@v1
with:
firebolt-username: ${{ secrets.FIREBOLT_USERNAME }}
firebolt-password: ${{ secrets.FIREBOLT_PASSWORD }}
api-endpoint: "api.dev.firebolt.io"
firebolt-username: ${{ secrets.FIREBOLT_STG_USERNAME }}
firebolt-password: ${{ secrets.FIREBOLT_STG_PASSWORD }}
api-endpoint: "api.staging.firebolt.io"
region: "us-east-1"
db_suffix: ${{ format('{0}_{1}', matrix.os, matrix.python-version) }}

Expand All @@ -64,21 +57,19 @@ jobs:
with:
path: |
.pytest_cache/v/cache/lastfailed
key: ${{ runner.os }}-pytest-restore-failed-${{ github.ref }}-${{ github.sha }}
key: ${{ runner.os }}-pytest-restore-failed-${{ github.ref }}-${{ github.sha }}-v1

- name: Run integration tests
env:
USER_NAME: ${{ secrets.FIREBOLT_USERNAME }}
PASSWORD: ${{ secrets.FIREBOLT_PASSWORD }}
SERVICE_ID: ${{ secrets.SERVICE_ID }}
SERVICE_SECRET: ${{ secrets.SERVICE_SECRET }}
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 }}
ACCOUNT_NAME: "firebolt"
FIREBOLT_BASE_URL: "api.dev.firebolt.io"
FIREBOLT_BASE_URL: "api.staging.firebolt.io"
run: |
pytest --last-failed -o log_cli=true -o log_cli_level=INFO --junit-xml=report/junit.xml tests/integration

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Nightly code check
name: v2 Nightly code check
on:
workflow_dispatch:
schedule:
Expand All @@ -14,25 +14,24 @@ jobs:
needs: [unit-tests]
uses: ./.github/workflows/security-scan.yml
secrets:
FOSSA_TOKEN: ${{ secrets.FOSSA_TOKEN }}
SONARCLOUD_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }}
tests:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false # finish all jobs even if one fails
max-parallel: 2
matrix:
matrix:
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
python-version: ['3.7', '3.8', '3.9', '3.10']
steps:
- name: Check out code
uses: actions/checkout@v2

- name: Set up Python 3.7
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -46,10 +45,10 @@ jobs:
id: setup
uses: firebolt-db/integration-testing-setup@v2
with:
firebolt-client-id: ${{ secrets.FIREBOLT_CLIENT_ID_NEW_IDN }}
firebolt-client-secret: ${{ secrets.FIREBOLT_CLIENT_SECRET_NEW_IDN }}
firebolt-client-id: ${{ secrets.FIREBOLT_CLIENT_ID_STG_NEW_IDN }}
firebolt-client-secret: ${{ secrets.FIREBOLT_CLIENT_SECRET_STG_NEW_IDN }}
account: "developer"
api-endpoint: "api.dev.firebolt.io"
api-endpoint: "api.staging.firebolt.io"
db_suffix: ${{ format('{0}_{1}', matrix.os, matrix.python-version) }}

- name: Restore cached failed tests
Expand All @@ -62,12 +61,12 @@ jobs:

- name: Run integration tests
env:
SERVICE_ID: ${{ secrets.FIREBOLT_CLIENT_ID_NEW_IDN }}
SERVICE_SECRET: ${{ secrets.FIREBOLT_CLIENT_SECRET_NEW_IDN }}
SERVICE_ID: ${{ secrets.FIREBOLT_CLIENT_ID_STG_NEW_IDN }}
SERVICE_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.dev.firebolt.io"
FIREBOLT_BASE_URL: "api.staging.firebolt.io"
ACCOUNT_NAME: "developer"
run: |
pytest --last-failed -o log_cli=true -o log_cli_level=INFO --junit-xml=report/junit.xml tests/integration
Expand Down
Loading