Skip to content

Commit bb1dc73

Browse files
feat: backwards-compatible version merge (#323)
Co-authored-by: Stepan Burlakov <[email protected]>
1 parent 0d6fae4 commit bb1dc73

File tree

126 files changed

+8705
-698
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

126 files changed

+8705
-698
lines changed
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
name: Integration tests FB 1.0
2+
on:
3+
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
13+
workflow_call:
14+
inputs:
15+
environment:
16+
default: 'staging'
17+
required: false
18+
type: string
19+
branch:
20+
required: false
21+
type: string
22+
description: 'Branch to run on'
23+
secrets:
24+
FIREBOLT_USERNAME:
25+
required: true
26+
FIREBOLT_PASSWORD:
27+
required: true
28+
FIREBOLT_STG_USERNAME:
29+
required: true
30+
FIREBOLT_STG_PASSWORD:
31+
required: true
32+
SERVICE_ID:
33+
required: true
34+
SERVICE_SECRET:
35+
required: true
36+
jobs:
37+
tests:
38+
runs-on: ubuntu-latest
39+
steps:
40+
- name: Check out code
41+
uses: actions/checkout@v2
42+
with:
43+
ref: ${{ inputs.branch }}
44+
45+
- name: Set up Python 3.7
46+
uses: actions/setup-python@v2
47+
with:
48+
python-version: 3.7
49+
50+
- name: Install dependencies
51+
run: |
52+
python -m pip install --upgrade pip
53+
pip install ".[dev]"
54+
55+
- name: Determine env variables
56+
run: |
57+
if [ "${{ inputs.environment }}" == 'staging' ]; then
58+
echo "USERNAME=${{ secrets.FIREBOLT_STG_USERNAME }}" >> "$GITHUB_ENV"
59+
echo "PASSWORD=${{ secrets.FIREBOLT_STG_PASSWORD }}" >> "$GITHUB_ENV"
60+
echo "CLIENT_ID=${{ secrets.SERVICE_ID_STG }}" >> "$GITHUB_ENV"
61+
echo "CLIENT_SECRET=${{ secrets.SERVICE_SECRET_STG }}" >> "$GITHUB_ENV"
62+
else
63+
echo "USERNAME=${{ secrets.FIREBOLT_USERNAME }}" >> "$GITHUB_ENV"
64+
echo "PASSWORD=${{ secrets.FIREBOLT_PASSWORD }}" >> "$GITHUB_ENV"
65+
echo "CLIENT_ID=${{ secrets.FIREBOLT_CLIENT_ID }}" >> "$GITHUB_ENV"
66+
echo "CLIENT_SECRET=${{ secrets.FIREBOLT_CLIENT_SECRET }}" >> "$GITHUB_ENV"
67+
fi
68+
69+
- name: Setup database and engine
70+
id: setup
71+
uses: firebolt-db/integration-testing-setup@v1
72+
with:
73+
firebolt-username: ${{ env.USERNAME }}
74+
firebolt-password: ${{ env.PASSWORD }}
75+
api-endpoint: "api.${{ inputs.environment }}.firebolt.io"
76+
region: "us-east-1"
77+
78+
- name: Restore cached failed tests
79+
id: cache-tests-restore
80+
uses: actions/cache/restore@v3
81+
with:
82+
path: |
83+
.pytest_cache/v/cache/lastfailed
84+
key: ${{ runner.os }}-pytest-restore-failed-${{ github.ref }}-${{ github.sha }}
85+
86+
- name: Run integration tests
87+
env:
88+
USER_NAME: ${{ env.USERNAME }}
89+
PASSWORD: ${{ env.PASSWORD }}
90+
SERVICE_ID: ${{ env.CLIENT_ID }}
91+
SERVICE_SECRET: ${{ env.CLIENT_SECRET }}
92+
DATABASE_NAME: ${{ steps.setup.outputs.database_name }}
93+
ENGINE_NAME: ${{ steps.setup.outputs.engine_name }}
94+
ENGINE_URL: ${{ steps.setup.outputs.engine_url }}
95+
STOPPED_ENGINE_NAME: ${{ steps.setup.outputs.stopped_engine_name }}
96+
STOPPED_ENGINE_URL: ${{ steps.setup.outputs.stopped_engine_url }}
97+
API_ENDPOINT: "api.${{ inputs.environment }}.firebolt.io"
98+
ACCOUNT_NAME: "firebolt"
99+
run: |
100+
pytest --last-failed -n 6 --dist loadgroup --timeout_method "signal" -o log_cli=true -o log_cli_level=INFO tests/integration -k "not V2"
101+
102+
- name: Save failed tests
103+
id: cache-tests-save
104+
uses: actions/cache/save@v3
105+
if: failure()
106+
with:
107+
path: |
108+
.pytest_cache/v/cache/lastfailed
109+
key: ${{ steps.cache-tests-restore.outputs.cache-primary-key }}
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Integration tests FB 2.0
2+
on:
3+
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
13+
workflow_call:
14+
inputs:
15+
environment:
16+
default: 'staging'
17+
required: false
18+
type: string
19+
branch:
20+
required: false
21+
type: string
22+
description: 'Branch to run on'
23+
secrets:
24+
FIREBOLT_CLIENT_ID_STG_NEW_IDN:
25+
required: true
26+
FIREBOLT_CLIENT_SECRET_STG_NEW_IDN:
27+
required: true
28+
FIREBOLT_CLIENT_ID_NEW_IDN:
29+
required: true
30+
FIREBOLT_CLIENT_SECRET_NEW_IDN:
31+
required: true
32+
jobs:
33+
tests:
34+
runs-on: ubuntu-latest
35+
steps:
36+
- name: Check out code
37+
uses: actions/checkout@v2
38+
with:
39+
ref: ${{ inputs.branch }}
40+
41+
- name: Set up Python 3.7
42+
uses: actions/setup-python@v2
43+
with:
44+
python-version: 3.7
45+
46+
- name: Install dependencies
47+
run: |
48+
python -m pip install --upgrade pip
49+
pip install ".[dev]"
50+
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+
61+
- name: Setup database and engine
62+
id: setup
63+
uses: firebolt-db/integration-testing-setup@v2
64+
with:
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"
69+
70+
- name: Run integration tests
71+
env:
72+
SERVICE_ID: ${{ env.CLIENT_ID }}
73+
SERVICE_SECRET: ${{ env.CLIENT_SECRET }}
74+
DATABASE_NAME: ${{ steps.setup.outputs.database_name }}
75+
ENGINE_NAME: ${{ steps.setup.outputs.engine_name }}
76+
STOPPED_ENGINE_NAME: ${{ steps.setup.outputs.stopped_engine_name }}
77+
API_ENDPOINT: "api.${{ inputs.environment }}.firebolt.io"
78+
ACCOUNT_NAME: "developer"
79+
run: |
80+
pytest -n 6 --dist loadgroup --timeout_method "signal" -o log_cli=true -o log_cli_level=WARNING tests/integration -k "not V1"

.github/workflows/integration-tests.yml

Lines changed: 35 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,19 @@ on:
2121
type: string
2222
description: 'Branch to run on'
2323
secrets:
24+
FIREBOLT_USERNAME:
25+
required: true
26+
FIREBOLT_PASSWORD:
27+
required: true
28+
FIREBOLT_STG_USERNAME:
29+
required: true
30+
FIREBOLT_STG_PASSWORD:
31+
required: true
32+
SERVICE_ID:
33+
required: true
34+
SERVICE_SECRET:
35+
required: true
36+
# V2 secrets
2437
FIREBOLT_CLIENT_ID_STG_NEW_IDN:
2538
required: true
2639
FIREBOLT_CLIENT_SECRET_STG_NEW_IDN:
@@ -30,51 +43,25 @@ on:
3043
FIREBOLT_CLIENT_SECRET_NEW_IDN:
3144
required: true
3245
jobs:
33-
tests:
34-
runs-on: ubuntu-latest
35-
steps:
36-
- name: Check out code
37-
uses: actions/checkout@v2
38-
with:
39-
ref: ${{ inputs.branch }}
40-
41-
- name: Set up Python 3.7
42-
uses: actions/setup-python@v2
43-
with:
44-
python-version: 3.7
45-
46-
- name: Install dependencies
47-
run: |
48-
python -m pip install --upgrade pip
49-
pip install ".[dev]"
50-
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-
61-
- name: Setup database and engine
62-
id: setup
63-
uses: firebolt-db/integration-testing-setup@v2
64-
with:
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"
69-
70-
- name: Run integration tests
71-
env:
72-
SERVICE_ID: ${{ env.CLIENT_ID }}
73-
SERVICE_SECRET: ${{ env.CLIENT_SECRET }}
74-
DATABASE_NAME: ${{ steps.setup.outputs.database_name }}
75-
ENGINE_NAME: ${{ steps.setup.outputs.engine_name }}
76-
STOPPED_ENGINE_NAME: ${{ steps.setup.outputs.stopped_engine_name }}
77-
API_ENDPOINT: "api.${{ inputs.environment }}.firebolt.io"
78-
ACCOUNT_NAME: "developer"
79-
run: |
80-
pytest -n 6 --dist loadgroup --timeout_method "signal" -o log_cli=true -o log_cli_level=WARNING tests/integration
46+
integration-test-v1:
47+
uses: ./.github/workflows/integration-tests-v1.yml
48+
with:
49+
environment: ${{ github.event.inputs.environment }}
50+
branch: ${{ github.event.inputs.branch }}
51+
secrets:
52+
FIREBOLT_USERNAME: ${{ secrets.FIREBOLT_USERNAME }}
53+
FIREBOLT_PASSWORD: ${{ secrets.FIREBOLT_PASSWORD }}
54+
FIREBOLT_STG_USERNAME: ${{ secrets.FIREBOLT_STG_USERNAME }}
55+
FIREBOLT_STG_PASSWORD: ${{ secrets.FIREBOLT_STG_PASSWORD }}
56+
SERVICE_ID: ${{ secrets.SERVICE_ID }}
57+
SERVICE_SECRET: ${{ secrets.SERVICE_SECRET }}
58+
integration-test-v2:
59+
uses: ./.github/workflows/integration-tests-v2.yml
60+
with:
61+
environment: ${{ github.event.inputs.environment }}
62+
branch: ${{ github.event.inputs.branch }}
63+
secrets:
64+
FIREBOLT_CLIENT_ID_STG_NEW_IDN: ${{ secrets.FIREBOLT_CLIENT_ID_STG_NEW_IDN }}
65+
FIREBOLT_CLIENT_SECRET_STG_NEW_IDN: ${{ secrets.FIREBOLT_CLIENT_SECRET_STG_NEW_IDN }}
66+
FIREBOLT_CLIENT_ID_NEW_IDN: ${{ secrets.FIREBOLT_CLIENT_ID_NEW_IDN }}
67+
FIREBOLT_CLIENT_SECRET_NEW_IDN: ${{ secrets.FIREBOLT_CLIENT_SECRET_NEW_IDN }}

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

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,18 @@
1-
name: v0.x Nightly code check
1+
name: v1 Nightly code check
22
on:
33
workflow_dispatch:
44
schedule:
55
- cron: '0 3 * * *' # 3 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:
2317
FOSSA_TOKEN: ${{ secrets.FOSSA_TOKEN }}
2418
SONARCLOUD_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }}
@@ -33,8 +27,6 @@ jobs:
3327
steps:
3428
- name: Check out code
3529
uses: actions/checkout@v2
36-
with:
37-
ref: 0.x
3830

3931
- name: Set up Python 3.7
4032
uses: actions/setup-python@v2
@@ -73,7 +65,7 @@ jobs:
7365
ACCOUNT_NAME: "firebolt"
7466
API_ENDPOINT: "api.staging.firebolt.io"
7567
run: |
76-
pytest --timeout_method "thread" -o log_cli=true -o log_cli_level=WARNING --junit-xml=report/junit.xml tests/integration
68+
pytest --timeout_method "thread" -o log_cli=true -o log_cli_level=WARNING --junit-xml=report/junit.xml tests/integration -k "not V2"
7769
7870
- name: Slack Notify of failure
7971
if: failure()

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

Lines changed: 2 additions & 2 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:
@@ -62,7 +62,7 @@ jobs:
6262
ACCOUNT_NAME: "developer"
6363
API_ENDPOINT: "api.staging.firebolt.io"
6464
run: |
65-
pytest --timeout_method "thread" -o log_cli=true -o log_cli_level=WARNING --junit-xml=report/junit.xml tests/integration
65+
pytest --timeout_method "thread" -o log_cli=true -o log_cli_level=WARNING --junit-xml=report/junit.xml tests/integration -k "not V1"
6666
6767
- name: Slack Notify of failure
6868
if: failure()

.github/workflows/release-v0.yml

Lines changed: 0 additions & 45 deletions
This file was deleted.

0 commit comments

Comments
 (0)