Skip to content

Commit 4e943e4

Browse files
authored
feat: Identity compatibility (#85)
1 parent 224f12b commit 4e943e4

16 files changed

+406
-123
lines changed

.github/workflows/code-check.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,22 @@ name: Code quality checks
22

33
on:
44
workflow_call:
5+
inputs:
6+
branch:
7+
required: false
8+
type: string
9+
description: 'Branch to run on'
510
push:
6-
branches: [ main ]
11+
branches: [ main, 0.x ]
712

813
jobs:
914
check-code:
1015
runs-on: ubuntu-latest
1116
steps:
1217
- name: Check out code
1318
uses: actions/checkout@v2
19+
with:
20+
ref: ${{ inputs.branch }}
1421

1522
- name: Set up Python 3.8
1623
uses: actions/setup-python@v2

.github/workflows/nightly-v0.yml

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: v0.x Nightly code check
2+
on:
3+
workflow_dispatch:
4+
schedule:
5+
- cron: '0 4 * * *' # 4 am UTC every day
6+
jobs:
7+
code-check:
8+
uses: ./.github/workflows/code-check.yml
9+
with:
10+
branch: 0.x
11+
unit-tests:
12+
uses: ./.github/workflows/unit-tests.yml
13+
with:
14+
branch: 0.x
15+
secrets:
16+
GIST_PAT: ${{ secrets.GIST_PAT }}
17+
security-scan:
18+
needs: [unit-tests]
19+
uses: ./.github/workflows/security-scan.yml
20+
with:
21+
branch: 0.x
22+
secrets:
23+
FOSSA_TOKEN: ${{ secrets.FOSSA_TOKEN }}
24+
SONARCLOUD_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }}
25+
tests:
26+
runs-on: ${{ matrix.os }}
27+
strategy:
28+
fail-fast: false # finish all jobs even if one fails
29+
max-parallel: 2
30+
matrix:
31+
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
32+
python-version: ['3.7', '3.8', '3.9', '3.10']
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@v2
39+
with:
40+
python-version: ${{ matrix.python-version }}
41+
42+
- name: Install dependencies
43+
run: |
44+
python -m pip install --upgrade pip
45+
python -m pip install ".[dev]"
46+
47+
- name: Test with pytest
48+
run: |
49+
pytest tests/unit
50+
51+
- name: Setup database and engine
52+
id: setup
53+
uses: firebolt-db/integration-testing-setup@v1
54+
with:
55+
firebolt-username: ${{ secrets.FIREBOLT_USERNAME }}
56+
firebolt-password: ${{ secrets.FIREBOLT_PASSWORD }}
57+
api-endpoint: "api.dev.firebolt.io"
58+
region: "us-east-1"
59+
db_suffix: ${{ format('{0}_{1}', matrix.os, matrix.python-version) }}
60+
61+
- name: Restore cached failed tests
62+
id: cache-tests-restore
63+
uses: actions/cache/restore@v3
64+
with:
65+
path: |
66+
.pytest_cache/v/cache/lastfailed
67+
key: ${{ runner.os }}-pytest-restore-failed-${{ github.ref }}-${{ github.sha }}
68+
69+
- name: Run integration tests
70+
env:
71+
USER_NAME: ${{ secrets.FIREBOLT_USERNAME }}
72+
PASSWORD: ${{ secrets.FIREBOLT_PASSWORD }}
73+
SERVICE_ID: ${{ secrets.SERVICE_ID }}
74+
SERVICE_SECRET: ${{ secrets.SERVICE_SECRET }}
75+
DATABASE_NAME: ${{ steps.setup.outputs.database_name }}
76+
ENGINE_NAME: ${{ steps.setup.outputs.engine_name }}
77+
ENGINE_URL: ${{ steps.setup.outputs.engine_url }}
78+
STOPPED_ENGINE_NAME: ${{ steps.setup.outputs.stopped_engine_name }}
79+
STOPPED_ENGINE_URL: ${{ steps.setup.outputs.stopped_engine_url }}
80+
ACCOUNT_NAME: "firebolt"
81+
FIREBOLT_BASE_URL: "api.dev.firebolt.io"
82+
run: |
83+
pytest --last-failed -o log_cli=true -o log_cli_level=INFO --junit-xml=report/junit.xml tests/integration
84+
85+
- name: Save failed tests
86+
id: cache-tests-save
87+
uses: actions/cache/save@v3
88+
if: failure()
89+
with:
90+
path: |
91+
.pytest_cache/v/cache/lastfailed
92+
key: ${{ steps.cache-tests-restore.outputs.cache-primary-key }}
93+
94+
- name: Slack Notify of failure
95+
if: failure()
96+
id: slack
97+
uses: firebolt-db/action-slack-nightly-notify@v1
98+
with:
99+
os: ${{ matrix.os }}
100+
programming-language: Python
101+
language-version: ${{ matrix.python-version }}
102+
notifications-channel: 'ecosystem-ci-notifications'
103+
slack-api-key: ${{ secrets.SLACK_BOT_TOKEN }}

.github/workflows/nightly.yml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ jobs:
4444
4545
- name: Setup database and engine
4646
id: setup
47-
uses: firebolt-db/integration-testing-setup@v1
47+
uses: firebolt-db/integration-testing-setup@v2
4848
with:
49-
firebolt-username: ${{ secrets.FIREBOLT_USERNAME }}
50-
firebolt-password: ${{ secrets.FIREBOLT_PASSWORD }}
49+
firebolt-client-id: ${{ secrets.FIREBOLT_CLIENT_ID_NEW_IDN }}
50+
firebolt-client-secret: ${{ secrets.FIREBOLT_CLIENT_SECRET_NEW_IDN }}
51+
account: "developer"
5152
api-endpoint: "api.dev.firebolt.io"
52-
region: "us-east-1"
5353
db_suffix: ${{ format('{0}_{1}', matrix.os, matrix.python-version) }}
5454

5555
- name: Restore cached failed tests
@@ -62,17 +62,13 @@ jobs:
6262

6363
- name: Run integration tests
6464
env:
65-
USER_NAME: ${{ secrets.FIREBOLT_USERNAME }}
66-
PASSWORD: ${{ secrets.FIREBOLT_PASSWORD }}
67-
SERVICE_ID: ${{ secrets.SERVICE_ID }}
68-
SERVICE_SECRET: ${{ secrets.SERVICE_SECRET }}
65+
SERVICE_ID: ${{ secrets.FIREBOLT_CLIENT_ID_NEW_IDN }}
66+
SERVICE_SECRET: ${{ secrets.FIREBOLT_CLIENT_SECRET_NEW_IDN }}
6967
DATABASE_NAME: ${{ steps.setup.outputs.database_name }}
7068
ENGINE_NAME: ${{ steps.setup.outputs.engine_name }}
71-
ENGINE_URL: ${{ steps.setup.outputs.engine_url }}
7269
STOPPED_ENGINE_NAME: ${{ steps.setup.outputs.stopped_engine_name }}
73-
STOPPED_ENGINE_URL: ${{ steps.setup.outputs.stopped_engine_url }}
74-
ACCOUNT_NAME: "firebolt"
7570
FIREBOLT_BASE_URL: "api.dev.firebolt.io"
71+
ACCOUNT_NAME: "developer"
7672
run: |
7773
pytest --last-failed -o log_cli=true -o log_cli_level=INFO --junit-xml=report/junit.xml tests/integration
7874
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: v0.x Integration tests
2+
3+
on:
4+
workflow_dispatch:
5+
workflow_call:
6+
secrets:
7+
FIREBOLT_USERNAME:
8+
required: true
9+
FIREBOLT_PASSWORD:
10+
required: true
11+
SERVICE_ID:
12+
required: true
13+
SERVICE_SECRET:
14+
required: true
15+
16+
jobs:
17+
integration-tests:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Check out code
21+
uses: actions/checkout@v2
22+
with:
23+
ref: 0.x
24+
25+
- name: Set up Python 3.7
26+
uses: actions/setup-python@v2
27+
with:
28+
python-version: 3.7
29+
30+
- name: Install dependencies
31+
run: |
32+
python -m pip install --upgrade pip
33+
pip install ".[dev]"
34+
35+
- name: Setup database and engine
36+
id: setup
37+
uses: firebolt-db/integration-testing-setup@v1
38+
with:
39+
firebolt-username: ${{ secrets.FIREBOLT_USERNAME }}
40+
firebolt-password: ${{ secrets.FIREBOLT_PASSWORD }}
41+
api-endpoint: "api.dev.firebolt.io"
42+
region: "us-east-1"
43+
44+
- name: Restore cached failed tests
45+
id: cache-tests-restore
46+
uses: actions/cache/restore@v3
47+
with:
48+
path: |
49+
.pytest_cache/v/cache/lastfailed
50+
key: ${{ runner.os }}-pytest-restore-failed-${{ github.ref }}-${{ github.sha }}
51+
52+
- name: Run integration tests
53+
env:
54+
USER_NAME: ${{ secrets.FIREBOLT_USERNAME }}
55+
PASSWORD: ${{ secrets.FIREBOLT_PASSWORD }}
56+
SERVICE_ID: ${{ secrets.SERVICE_ID }}
57+
SERVICE_SECRET: ${{ secrets.SERVICE_SECRET }}
58+
DATABASE_NAME: ${{ steps.setup.outputs.database_name }}
59+
ENGINE_NAME: ${{ steps.setup.outputs.engine_name }}
60+
ENGINE_URL: ${{ steps.setup.outputs.engine_url }}
61+
STOPPED_ENGINE_NAME: ${{ steps.setup.outputs.stopped_engine_name }}
62+
STOPPED_ENGINE_URL: ${{ steps.setup.outputs.stopped_engine_url }}
63+
FIREBOLT_BASE_URL: "api.dev.firebolt.io"
64+
run: |
65+
pytest --last-failed -o log_cli=true -o log_cli_level=INFO tests/integration
66+
67+
- name: Save failed tests
68+
id: cache-tests-save
69+
uses: actions/cache/save@v3
70+
if: failure()
71+
with:
72+
path: |
73+
.pytest_cache/v/cache/lastfailed
74+
key: ${{ steps.cache-tests-restore.outputs.cache-primary-key }}

.github/workflows/python-integration-tests.yml

Lines changed: 47 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,34 @@ name: 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
14+
workflow_call:
15+
inputs:
16+
environment:
17+
default: 'staging'
18+
required: false
19+
type: string
20+
branch:
21+
required: false
22+
type: string
23+
description: 'Branch to run on'
24+
secrets:
25+
FIREBOLT_CLIENT_ID_STG_NEW_IDN:
26+
required: true
27+
FIREBOLT_CLIENT_SECRET_STG_NEW_IDN:
28+
required: true
29+
FIREBOLT_CLIENT_ID_NEW_IDN:
30+
required: true
31+
FIREBOLT_CLIENT_SECRET_NEW_IDN:
32+
required: true
533

634
jobs:
735
integration-tests:
@@ -20,14 +48,24 @@ jobs:
2048
python -m pip install --upgrade pip
2149
pip install ".[dev]"
2250
51+
- name: Determine env variables
52+
run: |
53+
if [ "${{ inputs.environment }}" == 'staging' ]; then
54+
echo "CLIENT_ID=${{ secrets.FIREBOLT_CLIENT_ID_STG_NEW_IDN }}" >> "$GITHUB_ENV"
55+
echo "CLIENT_SECRET=${{ secrets.FIREBOLT_CLIENT_SECRET_STG_NEW_IDN }}" >> "$GITHUB_ENV"
56+
else
57+
echo "CLIENT_ID=${{ secrets.FIREBOLT_CLIENT_ID_NEW_IDN }}" >> "$GITHUB_ENV"
58+
echo "CLIENT_SECRET=${{ secrets.FIREBOLT_CLIENT_SECRET_NEW_IDN }}" >> "$GITHUB_ENV"
59+
fi
60+
2361
- name: Setup database and engine
2462
id: setup
25-
uses: firebolt-db/integration-testing-setup@v1
63+
uses: firebolt-db/integration-testing-setup@v2
2664
with:
27-
firebolt-username: ${{ secrets.FIREBOLT_USERNAME }}
28-
firebolt-password: ${{ secrets.FIREBOLT_PASSWORD }}
29-
api-endpoint: "api.dev.firebolt.io"
30-
region: "us-east-1"
65+
firebolt-client-id: ${{ env.CLIENT_ID }}
66+
firebolt-client-secret: ${{ env.CLIENT_SECRET }}
67+
account: "developer"
68+
api-endpoint: "api.${{ inputs.environment }}.firebolt.io"
3169

3270
- name: Restore cached failed tests
3371
id: cache-tests-restore
@@ -39,16 +77,13 @@ jobs:
3977

4078
- name: Run integration tests
4179
env:
42-
USER_NAME: ${{ secrets.FIREBOLT_USERNAME }}
43-
PASSWORD: ${{ secrets.FIREBOLT_PASSWORD }}
44-
SERVICE_ID: ${{ secrets.SERVICE_ID }}
45-
SERVICE_SECRET: ${{ secrets.SERVICE_SECRET }}
80+
SERVICE_ID: ${{ env.CLIENT_ID }}
81+
SERVICE_SECRET: ${{ env.CLIENT_SECRET }}
4682
DATABASE_NAME: ${{ steps.setup.outputs.database_name }}
4783
ENGINE_NAME: ${{ steps.setup.outputs.engine_name }}
48-
ENGINE_URL: ${{ steps.setup.outputs.engine_url }}
4984
STOPPED_ENGINE_NAME: ${{ steps.setup.outputs.stopped_engine_name }}
50-
STOPPED_ENGINE_URL: ${{ steps.setup.outputs.stopped_engine_url }}
51-
FIREBOLT_BASE_URL: "api.dev.firebolt.io"
85+
FIREBOLT_BASE_URL: "api.${{ inputs.environment }}.firebolt.io"
86+
ACCOUNT_NAME: "developer"
5287
run: |
5388
pytest --last-failed -o log_cli=true -o log_cli_level=INFO tests/integration
5489

.github/workflows/security-scan.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ name: Firebolt Security Scan
22

33
on:
44
workflow_call:
5+
inputs:
6+
branch:
7+
required: false
8+
type: string
9+
description: 'Branch to run on'
510
secrets:
611
FOSSA_TOKEN:
712
required: true
@@ -14,6 +19,8 @@ jobs:
1419
steps:
1520
- name: "Checkout Code"
1621
uses: actions/checkout@v2
22+
with:
23+
ref: ${{ inputs.branch }}
1724

1825
- name: "Download coverage report"
1926
uses: actions/download-artifact@v2

.github/workflows/unit-tests.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,16 @@ name: Unit tests
22

33
on:
44
workflow_call:
5+
inputs:
6+
branch:
7+
required: false
8+
type: string
9+
description: 'Branch to run on'
510
secrets:
611
GIST_PAT:
712
required: true
813
push:
9-
branches: [ main ]
14+
branches: [ main, 0.x ]
1015

1116
jobs:
1217
unit-tests:
@@ -16,6 +21,8 @@ jobs:
1621
steps:
1722
- name: Check out code
1823
uses: actions/checkout@v2
24+
with:
25+
ref: ${{ inputs.branch }}
1926

2027
- name: Set up Python 3.7
2128
uses: actions/setup-python@v2

0 commit comments

Comments
 (0)