|
1 | 1 | name: Integration tests |
2 | 2 | on: |
3 | 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 |
4 | 13 | workflow_call: |
5 | 14 | inputs: |
| 15 | + environment: |
| 16 | + default: 'staging' |
| 17 | + required: false |
| 18 | + type: string |
6 | 19 | branch: |
7 | 20 | required: false |
8 | 21 | type: string |
@@ -35,13 +48,27 @@ jobs: |
35 | 48 | python -m pip install --upgrade pip |
36 | 49 | pip install ".[dev]" |
37 | 50 |
|
| 51 | + - name: Determine env variables |
| 52 | + run: | |
| 53 | + if [ "${{ inputs.environment }}" == 'staging' ]; then |
| 54 | + echo "USERNAME=${{ secrets.FIREBOLT_USERNAME_STAGING }}" >> "$GITHUB_ENV" |
| 55 | + echo "PASSWORD=${{ secrets.FIREBOLT_PASSWORD_STAGING }}" >> "$GITHUB_ENV" |
| 56 | + echo "CLIENT_ID=${{ secrets.FIREBOLT_CLIENT_ID_STAGING }}" >> "$GITHUB_ENV" |
| 57 | + echo "CLIENT_SECRET=${{ secrets.FIREBOLT_CLIENT_SECRET_STAGING }}" >> "$GITHUB_ENV" |
| 58 | + else |
| 59 | + echo "USERNAME=${{ secrets.FIREBOLT_USERNAME_DEV }}" >> "$GITHUB_ENV" |
| 60 | + echo "PASSWORD=${{ secrets.FIREBOLT_PASSWORD_DEV }}" >> "$GITHUB_ENV" |
| 61 | + echo "CLIENT_ID=${{ secrets.FIREBOLT_CLIENT_ID_DEV }}" >> "$GITHUB_ENV" |
| 62 | + echo "CLIENT_SECRET=${{ secrets.FIREBOLT_CLIENT_SECRET_DEV }}" >> "$GITHUB_ENV" |
| 63 | + fi |
| 64 | +
|
38 | 65 | - name: Setup database and engine |
39 | 66 | id: setup |
40 | 67 | uses: firebolt-db/integration-testing-setup@master |
41 | 68 | with: |
42 | 69 | firebolt-username: ${{ secrets.FIREBOLT_USERNAME }} |
43 | 70 | firebolt-password: ${{ secrets.FIREBOLT_PASSWORD }} |
44 | | - api-endpoint: "api.dev.firebolt.io" |
| 71 | + api-endpoint: "api.${{ inputs.environment }}.firebolt.io" |
45 | 72 | region: "us-east-1" |
46 | 73 |
|
47 | 74 | - name: Run integration tests |
|
55 | 82 | ENGINE_URL: ${{ steps.setup.outputs.engine_url }} |
56 | 83 | STOPPED_ENGINE_NAME: ${{ steps.setup.outputs.stopped_engine_name }} |
57 | 84 | STOPPED_ENGINE_URL: ${{ steps.setup.outputs.stopped_engine_url }} |
58 | | - API_ENDPOINT: "api.dev.firebolt.io" |
| 85 | + API_ENDPOINT: "api.${{ inputs.environment }}.firebolt.io" |
59 | 86 | ACCOUNT_NAME: "firebolt" |
60 | 87 | run: | |
61 | 88 | pytest -n 6 --dist loadgroup --timeout_method "signal" -o log_cli=true -o log_cli_level=INFO tests/integration --alluredir=allure-results |
|
0 commit comments