Skip to content

Commit

Permalink
ci: remove env parameter from ci (#344)
Browse files Browse the repository at this point in the history
  • Loading branch information
stepansergeevitch authored Jan 30, 2024
1 parent 33de2c7 commit 6a8c166
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 141 deletions.
52 changes: 8 additions & 44 deletions .github/workflows/integration-tests-v1.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,12 @@
name: Integration tests FB 1.0
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:
required: true
SERVICE_ID:
required: true
SERVICE_SECRET:
required: true
SERVICE_ID_STG:
required: true
SERVICE_SECRET_STG:
Expand All @@ -50,27 +28,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"
echo "CLIENT_ID=${{ secrets.SERVICE_ID_STG }}" >> "$GITHUB_ENV"
echo "CLIENT_SECRET=${{ secrets.SERVICE_SECRET_STG }}" >> "$GITHUB_ENV"
else
echo "USERNAME=${{ secrets.FIREBOLT_USERNAME }}" >> "$GITHUB_ENV"
echo "PASSWORD=${{ secrets.FIREBOLT_PASSWORD }}" >> "$GITHUB_ENV"
echo "CLIENT_ID=${{ secrets.SERVICE_ID }}" >> "$GITHUB_ENV"
echo "CLIENT_SECRET=${{ secrets.SERVICE_SECRET }}" >> "$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 @@ -83,16 +47,16 @@ jobs:

- name: Run integration tests
env:
USER_NAME: ${{ env.USERNAME }}
PASSWORD: ${{ env.PASSWORD }}
SERVICE_ID: ${{ env.CLIENT_ID }}
SERVICE_SECRET: ${{ env.CLIENT_SECRET }}
USER_NAME: ${{ secrets.FIREBOLT_STG_USERNAME}}
PASSWORD: ${{ secrets.FIREBOLT_STG_PASSWORD }}
SERVICE_ID: ${{ secrets.SERVICE_ID_STG }}
SERVICE_SECRET: ${{ secrets.SERVICE_SECRET_STG }}
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 }}
API_ENDPOINT: "api.${{ inputs.environment }}.firebolt.io"
API_ENDPOINT: "api.staging.firebolt.io"
ACCOUNT_NAME: "firebolt"
run: |
pytest --last-failed -n 6 --dist loadgroup --timeout_method "signal" -o log_cli=true -o log_cli_level=INFO tests/integration -k "not V2" --runslow
Expand Down
45 changes: 9 additions & 36 deletions .github/workflows/integration-tests-v2.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,13 @@
name: Integration tests FB 2.0
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:
tests:
runs-on: ubuntu-latest
Expand All @@ -42,33 +25,23 @@ 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: Run integration tests
env:
SERVICE_ID: ${{ env.CLIENT_ID }}
SERVICE_SECRET: ${{ env.CLIENT_SECRET }}
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 }}
API_ENDPOINT: "api.${{ inputs.environment }}.firebolt.io"
ACCOUNT_NAME: "developer"
API_ENDPOINT: "api.staging.firebolt.io"
ACCOUNT_NAME: ${{ vars.FIREBOLT_ACCOUNT }}
run: |
pytest -n 6 --dist loadgroup --timeout_method "signal" -o log_cli=true -o log_cli_level=WARNING tests/integration -k "not V1" --runslow
46 changes: 2 additions & 44 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,12 @@
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:
required: true
SERVICE_ID:
required: true
SERVICE_SECRET:
required: true
SERVICE_ID_STG:
required: true
SERVICE_SECRET_STG:
Expand All @@ -38,30 +16,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:
FIREBOLT_USERNAME: ${{ secrets.FIREBOLT_USERNAME }}
FIREBOLT_PASSWORD: ${{ secrets.FIREBOLT_PASSWORD }}
FIREBOLT_STG_USERNAME: ${{ secrets.FIREBOLT_STG_USERNAME }}
FIREBOLT_STG_PASSWORD: ${{ secrets.FIREBOLT_STG_PASSWORD }}
SERVICE_ID: ${{ secrets.SERVICE_ID }}
SERVICE_SECRET: ${{ secrets.SERVICE_SECRET }}
SERVICE_ID_STG: ${{ secrets.SERVICE_ID_STG }}
SERVICE_SECRET_STG: ${{ secrets.SERVICE_SECRET_STG }}
secrets: inherit
integration-test-v2:
uses: ./.github/workflows/integration-tests-v2.yml
with:
environment: ${{ inputs.environment }}
secrets:
FIREBOLT_CLIENT_ID_STG_NEW_IDN: ${{ secrets.FIREBOLT_CLIENT_ID_STG_NEW_IDN }}
FIREBOLT_CLIENT_SECRET_STG_NEW_IDN: ${{ secrets.FIREBOLT_CLIENT_SECRET_STG_NEW_IDN }}
FIREBOLT_CLIENT_ID_NEW_IDN: ${{ secrets.FIREBOLT_CLIENT_ID_NEW_IDN }}
FIREBOLT_CLIENT_SECRET_NEW_IDN: ${{ secrets.FIREBOLT_CLIENT_SECRET_NEW_IDN }}
secrets: inherit
4 changes: 2 additions & 2 deletions .github/workflows/nightly-v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
firebolt-client-id: ${{ secrets.FIREBOLT_CLIENT_ID_STG_NEW_IDN }}
firebolt-client-secret: ${{ secrets.FIREBOLT_CLIENT_SECRET_STG_NEW_IDN }}
api-endpoint: "api.staging.firebolt.io"
account: "developer"
account: ${{ vars.FIREBOLT_ACCOUNT }}
db_suffix: ${{ format('{0}_{1}', matrix.os, matrix.python-version) }}

- name: Run integration tests
Expand All @@ -59,7 +59,7 @@ jobs:
DATABASE_NAME: ${{ steps.setup.outputs.database_name }}
ENGINE_NAME: ${{ steps.setup.outputs.engine_name }}
STOPPED_ENGINE_NAME: ${{ steps.setup.outputs.stopped_engine_name }}
ACCOUNT_NAME: "developer"
ACCOUNT_NAME: ${{ vars.FIREBOLT_ACCOUNT }}
API_ENDPOINT: "api.staging.firebolt.io"
run: |
pytest --timeout_method "thread" -o log_cli=true -o log_cli_level=WARNING --junit-xml=report/junit.xml tests/integration -k "not V1"
Expand Down
16 changes: 1 addition & 15 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,7 @@ on:
jobs:
integration-tests:
uses: ./.github/workflows/integration-tests.yml
with:
environment: "staging"
secrets:
FIREBOLT_CLIENT_ID_STG_NEW_IDN: ${{ secrets.FIREBOLT_CLIENT_ID_STG_NEW_IDN }}
FIREBOLT_CLIENT_SECRET_STG_NEW_IDN: ${{ secrets.FIREBOLT_CLIENT_SECRET_STG_NEW_IDN }}
FIREBOLT_CLIENT_ID_NEW_IDN: ${{ secrets.FIREBOLT_CLIENT_ID_NEW_IDN }}
FIREBOLT_CLIENT_SECRET_NEW_IDN: ${{ secrets.FIREBOLT_CLIENT_SECRET_NEW_IDN }}
FIREBOLT_USERNAME: ${{ secrets.FIREBOLT_USERNAME }}
FIREBOLT_PASSWORD: ${{ secrets.FIREBOLT_PASSWORD }}
FIREBOLT_STG_USERNAME: ${{ secrets.FIREBOLT_STG_USERNAME }}
FIREBOLT_STG_PASSWORD: ${{ secrets.FIREBOLT_STG_PASSWORD }}
SERVICE_ID: ${{ secrets.SERVICE_ID }}
SERVICE_SECRET: ${{ secrets.SERVICE_SECRET }}
SERVICE_ID_STG: ${{ secrets.SERVICE_ID_STG }}
SERVICE_SECRET_STG: ${{ secrets.SERVICE_SECRET_STG }}
secrets: inherit

publish:
runs-on: ubuntu-latest
Expand Down

0 comments on commit 6a8c166

Please sign in to comment.