Skip to content

Commit 235ee3b

Browse files
authored
feat: Can use old and new Firebolt (#90)
1 parent d7847de commit 235ee3b

File tree

13 files changed

+198
-140
lines changed

13 files changed

+198
-140
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,4 @@ jobs:
2828
needs: [unit-tests]
2929
uses: ./.github/workflows/security-scan.yml
3030
secrets:
31-
FOSSA_TOKEN: ${{ secrets.FOSSA_TOKEN }}
3231
SONARCLOUD_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }}

.github/workflows/code-check.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ jobs:
1818
uses: actions/checkout@v2
1919
with:
2020
ref: ${{ inputs.branch }}
21-
21+
2222
- name: Set up Python 3.8
23-
uses: actions/setup-python@v2
23+
uses: actions/setup-python@v5
2424
with:
2525
python-version: 3.8
26-
26+
2727
- name: Install dependencies
2828
run: |
2929
python -m pip install --upgrade pip

.github/workflows/python-integration-tests-v0.yml renamed to .github/workflows/integration-tests-v1.yml

Lines changed: 39 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,30 @@
1-
name: v0.x Integration tests
1+
name: v1 Integration tests
22

33
on:
44
workflow_dispatch:
5+
inputs:
6+
environment:
7+
description: 'Environment to run the tests against'
8+
type: choice
9+
required: true
10+
default: 'dev'
11+
options:
12+
- dev
13+
- staging
514
workflow_call:
15+
inputs:
16+
environment:
17+
default: 'staging'
18+
required: false
19+
type: string
620
secrets:
721
FIREBOLT_USERNAME:
822
required: true
923
FIREBOLT_PASSWORD:
1024
required: true
11-
SERVICE_ID:
25+
FIREBOLT_STG_USERNAME:
1226
required: true
13-
SERVICE_SECRET:
27+
FIREBOLT_STG_PASSWORD:
1428
required: true
1529

1630
jobs:
@@ -19,11 +33,9 @@ jobs:
1933
steps:
2034
- name: Check out code
2135
uses: actions/checkout@v2
22-
with:
23-
ref: 0.x
2436

2537
- name: Set up Python 3.7
26-
uses: actions/setup-python@v2
38+
uses: actions/setup-python@v5
2739
with:
2840
python-version: 3.7
2941

@@ -32,13 +44,23 @@ jobs:
3244
python -m pip install --upgrade pip
3345
pip install ".[dev]"
3446
47+
- name: Determine env variables
48+
run: |
49+
if [ "${{ inputs.environment }}" == 'staging' ]; then
50+
echo "USERNAME=${{ secrets.FIREBOLT_STG_USERNAME }}" >> "$GITHUB_ENV"
51+
echo "PASSWORD=${{ secrets.FIREBOLT_STG_PASSWORD }}" >> "$GITHUB_ENV"
52+
else
53+
echo "USERNAME=${{ secrets.FIREBOLT_USERNAME }}" >> "$GITHUB_ENV"
54+
echo "PASSWORD=${{ secrets.FIREBOLT_PASSWORD }}" >> "$GITHUB_ENV"
55+
fi
56+
3557
- name: Setup database and engine
3658
id: setup
3759
uses: firebolt-db/integration-testing-setup@v1
3860
with:
39-
firebolt-username: ${{ secrets.FIREBOLT_USERNAME }}
40-
firebolt-password: ${{ secrets.FIREBOLT_PASSWORD }}
41-
api-endpoint: "api.dev.firebolt.io"
61+
firebolt-username: ${{ env.USERNAME }}
62+
firebolt-password: ${{ env.PASSWORD }}
63+
api-endpoint: "api.${{ inputs.environment }}.firebolt.io"
4264
region: "us-east-1"
4365

4466
- name: Restore cached failed tests
@@ -47,23 +69,23 @@ jobs:
4769
with:
4870
path: |
4971
.pytest_cache/v/cache/lastfailed
50-
key: ${{ runner.os }}-pytest-restore-failed-${{ github.ref }}-${{ github.sha }}
51-
72+
key: ${{ runner.os }}-pytest-restore-failed-${{ github.ref }}-${{ github.sha }}-v1
73+
5274
- name: Run integration tests
5375
env:
54-
USER_NAME: ${{ secrets.FIREBOLT_USERNAME }}
55-
PASSWORD: ${{ secrets.FIREBOLT_PASSWORD }}
56-
SERVICE_ID: ${{ secrets.SERVICE_ID }}
57-
SERVICE_SECRET: ${{ secrets.SERVICE_SECRET }}
76+
# the distinction is on the SDK side so just use CLIENT_* for username password
77+
CLIENT_ID: ${{ env.USERNAME }}
78+
CLIENT_SECRET: ${{ env.PASSWORD }}
5879
DATABASE_NAME: ${{ steps.setup.outputs.database_name }}
5980
ENGINE_NAME: ${{ steps.setup.outputs.engine_name }}
6081
ENGINE_URL: ${{ steps.setup.outputs.engine_url }}
6182
STOPPED_ENGINE_NAME: ${{ steps.setup.outputs.stopped_engine_name }}
6283
STOPPED_ENGINE_URL: ${{ steps.setup.outputs.stopped_engine_url }}
63-
FIREBOLT_BASE_URL: "api.dev.firebolt.io"
84+
FIREBOLT_BASE_URL: "api.${{ inputs.environment }}.firebolt.io"
85+
ACCOUNT_NAME: "firebolt"
6486
run: |
6587
pytest --last-failed -o log_cli=true -o log_cli_level=INFO tests/integration
66-
88+
6789
- name: Save failed tests
6890
id: cache-tests-save
6991
uses: actions/cache/save@v3
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
name: v2 Integration tests
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
environment:
7+
description: 'Environment to run the tests against'
8+
type: choice
9+
required: true
10+
default: 'dev'
11+
options:
12+
- dev
13+
- staging
14+
workflow_call:
15+
inputs:
16+
environment:
17+
default: 'staging'
18+
required: false
19+
type: string
20+
secrets:
21+
FIREBOLT_CLIENT_ID_STG_NEW_IDN:
22+
required: true
23+
FIREBOLT_CLIENT_SECRET_STG_NEW_IDN:
24+
required: true
25+
FIREBOLT_CLIENT_ID_NEW_IDN:
26+
required: true
27+
FIREBOLT_CLIENT_SECRET_NEW_IDN:
28+
required: true
29+
30+
jobs:
31+
integration-tests:
32+
runs-on: ubuntu-latest
33+
steps:
34+
- name: Check out code
35+
uses: actions/checkout@v2
36+
37+
- name: Set up Python 3.7
38+
uses: actions/setup-python@v5
39+
with:
40+
python-version: 3.7
41+
42+
- name: Install dependencies
43+
run: |
44+
python -m pip install --upgrade pip
45+
pip install ".[dev]"
46+
47+
- name: Determine env variables
48+
run: |
49+
if [ "${{ inputs.environment }}" == 'staging' ]; then
50+
echo "CLIENT_ID=${{ secrets.FIREBOLT_CLIENT_ID_STG_NEW_IDN }}" >> "$GITHUB_ENV"
51+
echo "CLIENT_SECRET=${{ secrets.FIREBOLT_CLIENT_SECRET_STG_NEW_IDN }}" >> "$GITHUB_ENV"
52+
else
53+
echo "CLIENT_ID=${{ secrets.FIREBOLT_CLIENT_ID_NEW_IDN }}" >> "$GITHUB_ENV"
54+
echo "CLIENT_SECRET=${{ secrets.FIREBOLT_CLIENT_SECRET_NEW_IDN }}" >> "$GITHUB_ENV"
55+
fi
56+
57+
- name: Setup database and engine
58+
id: setup
59+
uses: firebolt-db/integration-testing-setup@v2
60+
with:
61+
firebolt-client-id: ${{ env.CLIENT_ID }}
62+
firebolt-client-secret: ${{ env.CLIENT_SECRET }}
63+
account: "developer"
64+
api-endpoint: "api.${{ inputs.environment }}.firebolt.io"
65+
66+
- name: Restore cached failed tests
67+
id: cache-tests-restore
68+
uses: actions/cache/restore@v3
69+
with:
70+
path: |
71+
.pytest_cache/v/cache/lastfailed
72+
key: ${{ runner.os }}-pytest-restore-failed-${{ github.ref }}-${{ github.sha }}-v2
73+
74+
- name: Run integration tests
75+
env:
76+
CLIENT_ID: ${{ env.CLIENT_ID }}
77+
CLIENT_SECRET: ${{ env.CLIENT_SECRET }}
78+
DATABASE_NAME: ${{ steps.setup.outputs.database_name }}
79+
ENGINE_NAME: ${{ steps.setup.outputs.engine_name }}
80+
STOPPED_ENGINE_NAME: ${{ steps.setup.outputs.stopped_engine_name }}
81+
FIREBOLT_BASE_URL: "api.${{ inputs.environment }}.firebolt.io"
82+
ACCOUNT_NAME: "developer"
83+
run: |
84+
pytest --last-failed -o log_cli=true -o log_cli_level=INFO tests/integration
85+
86+
- name: Save failed tests
87+
id: cache-tests-save
88+
uses: actions/cache/save@v3
89+
if: failure()
90+
with:
91+
path: |
92+
.pytest_cache/v/cache/lastfailed
93+
key: ${{ steps.cache-tests-restore.outputs.cache-primary-key }}

.github/workflows/nightly-v0.yml renamed to .github/workflows/nightly-v1.yml

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,37 @@
1-
name: v0.x Nightly code check
1+
name: v1 Nightly code check
22
on:
33
workflow_dispatch:
44
schedule:
55
- cron: '0 4 * * *' # 4 am UTC every day
66
jobs:
77
code-check:
88
uses: ./.github/workflows/code-check.yml
9-
with:
10-
branch: 0.x
119
unit-tests:
1210
uses: ./.github/workflows/unit-tests.yml
13-
with:
14-
branch: 0.x
1511
secrets:
1612
GIST_PAT: ${{ secrets.GIST_PAT }}
1713
security-scan:
1814
needs: [unit-tests]
1915
uses: ./.github/workflows/security-scan.yml
20-
with:
21-
branch: 0.x
2216
secrets:
23-
FOSSA_TOKEN: ${{ secrets.FOSSA_TOKEN }}
2417
SONARCLOUD_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }}
2518
tests:
2619
runs-on: ${{ matrix.os }}
2720
strategy:
2821
fail-fast: false # finish all jobs even if one fails
2922
max-parallel: 2
30-
matrix:
23+
matrix:
3124
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
3225
python-version: ['3.7', '3.8', '3.9', '3.10']
3326
steps:
3427
- name: Check out code
3528
uses: actions/checkout@v2
36-
29+
3730
- name: Set up Python 3.7
38-
uses: actions/setup-python@v2
31+
uses: actions/setup-python@v5
3932
with:
4033
python-version: ${{ matrix.python-version }}
41-
34+
4235
- name: Install dependencies
4336
run: |
4437
python -m pip install --upgrade pip
@@ -52,9 +45,9 @@ jobs:
5245
id: setup
5346
uses: firebolt-db/integration-testing-setup@v1
5447
with:
55-
firebolt-username: ${{ secrets.FIREBOLT_USERNAME }}
56-
firebolt-password: ${{ secrets.FIREBOLT_PASSWORD }}
57-
api-endpoint: "api.dev.firebolt.io"
48+
firebolt-username: ${{ secrets.FIREBOLT_STG_USERNAME }}
49+
firebolt-password: ${{ secrets.FIREBOLT_STG_PASSWORD }}
50+
api-endpoint: "api.staging.firebolt.io"
5851
region: "us-east-1"
5952
db_suffix: ${{ format('{0}_{1}', matrix.os, matrix.python-version) }}
6053

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

6962
- name: Run integration tests
7063
env:
71-
USER_NAME: ${{ secrets.FIREBOLT_USERNAME }}
72-
PASSWORD: ${{ secrets.FIREBOLT_PASSWORD }}
73-
SERVICE_ID: ${{ secrets.SERVICE_ID }}
74-
SERVICE_SECRET: ${{ secrets.SERVICE_SECRET }}
64+
CLIENT_ID: ${{ secrets.FIREBOLT_STG_USERNAME }}
65+
CLIENT_SECRET: ${{ secrets.FIREBOLT_STG_PASSWORD }}
7566
DATABASE_NAME: ${{ steps.setup.outputs.database_name }}
7667
ENGINE_NAME: ${{ steps.setup.outputs.engine_name }}
7768
ENGINE_URL: ${{ steps.setup.outputs.engine_url }}
7869
STOPPED_ENGINE_NAME: ${{ steps.setup.outputs.stopped_engine_name }}
7970
STOPPED_ENGINE_URL: ${{ steps.setup.outputs.stopped_engine_url }}
8071
ACCOUNT_NAME: "firebolt"
81-
FIREBOLT_BASE_URL: "api.dev.firebolt.io"
72+
FIREBOLT_BASE_URL: "api.staging.firebolt.io"
8273
run: |
8374
pytest --last-failed -o log_cli=true -o log_cli_level=INFO --junit-xml=report/junit.xml tests/integration
8475

.github/workflows/nightly.yml renamed to .github/workflows/nightly-v2.yml

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Nightly code check
1+
name: v2 Nightly code check
22
on:
33
workflow_dispatch:
44
schedule:
@@ -14,25 +14,24 @@ jobs:
1414
needs: [unit-tests]
1515
uses: ./.github/workflows/security-scan.yml
1616
secrets:
17-
FOSSA_TOKEN: ${{ secrets.FOSSA_TOKEN }}
1817
SONARCLOUD_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }}
1918
tests:
2019
runs-on: ${{ matrix.os }}
2120
strategy:
2221
fail-fast: false # finish all jobs even if one fails
2322
max-parallel: 2
24-
matrix:
23+
matrix:
2524
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
2625
python-version: ['3.7', '3.8', '3.9', '3.10']
2726
steps:
2827
- name: Check out code
2928
uses: actions/checkout@v2
30-
29+
3130
- name: Set up Python 3.7
32-
uses: actions/setup-python@v2
31+
uses: actions/setup-python@v5
3332
with:
3433
python-version: ${{ matrix.python-version }}
35-
34+
3635
- name: Install dependencies
3736
run: |
3837
python -m pip install --upgrade pip
@@ -46,10 +45,10 @@ jobs:
4645
id: setup
4746
uses: firebolt-db/integration-testing-setup@v2
4847
with:
49-
firebolt-client-id: ${{ secrets.FIREBOLT_CLIENT_ID_NEW_IDN }}
50-
firebolt-client-secret: ${{ secrets.FIREBOLT_CLIENT_SECRET_NEW_IDN }}
48+
firebolt-client-id: ${{ secrets.FIREBOLT_CLIENT_ID_STG_NEW_IDN }}
49+
firebolt-client-secret: ${{ secrets.FIREBOLT_CLIENT_SECRET_STG_NEW_IDN }}
5150
account: "developer"
52-
api-endpoint: "api.dev.firebolt.io"
51+
api-endpoint: "api.staging.firebolt.io"
5352
db_suffix: ${{ format('{0}_{1}', matrix.os, matrix.python-version) }}
5453

5554
- name: Restore cached failed tests
@@ -62,12 +61,12 @@ jobs:
6261

6362
- name: Run integration tests
6463
env:
65-
SERVICE_ID: ${{ secrets.FIREBOLT_CLIENT_ID_NEW_IDN }}
66-
SERVICE_SECRET: ${{ secrets.FIREBOLT_CLIENT_SECRET_NEW_IDN }}
64+
SERVICE_ID: ${{ secrets.FIREBOLT_CLIENT_ID_STG_NEW_IDN }}
65+
SERVICE_SECRET: ${{ secrets.FIREBOLT_CLIENT_SECRET_STG_NEW_IDN }}
6766
DATABASE_NAME: ${{ steps.setup.outputs.database_name }}
6867
ENGINE_NAME: ${{ steps.setup.outputs.engine_name }}
6968
STOPPED_ENGINE_NAME: ${{ steps.setup.outputs.stopped_engine_name }}
70-
FIREBOLT_BASE_URL: "api.dev.firebolt.io"
69+
FIREBOLT_BASE_URL: "api.staging.firebolt.io"
7170
ACCOUNT_NAME: "developer"
7271
run: |
7372
pytest --last-failed -o log_cli=true -o log_cli_level=INFO --junit-xml=report/junit.xml tests/integration

0 commit comments

Comments
 (0)