diff --git a/.github/workflows/integration-test-v1.yml b/.github/workflows/integration-test-v1.yml index 7a5dcc33c..d49b95521 100644 --- a/.github/workflows/integration-test-v1.yml +++ b/.github/workflows/integration-test-v1.yml @@ -1,15 +1,24 @@ name: Run integration tests v1 on: + workflow_dispatch: + inputs: + database: + description: 'Database override' + required: false + default: '' + engine: + description: 'Engine override' + required: false workflow_call: inputs: database: - description: 'Database - a new one will be created if not provided' + description: 'Database override' required: false default: '' type: string engine: - description: 'Engine - a new one will be created if not provided' + description: 'Database override' required: false type: string secrets: diff --git a/.github/workflows/integration-test-v2.yml b/.github/workflows/integration-test-v2.yml index 1f0a1920f..f8dda8e19 100644 --- a/.github/workflows/integration-test-v2.yml +++ b/.github/workflows/integration-test-v2.yml @@ -1,20 +1,33 @@ name: Run integration tests v2 on: + workflow_dispatch: + inputs: + database: + description: 'Database override' + required: false + default: '' + engine: + description: 'Engine override' + required: false + account: + description: 'Account override' + required: false + type: string workflow_call: inputs: database: - description: 'Database - a new one will be created if not provided' + description: 'Database override' required: false default: '' type: string engine: - description: 'Engine - a new one will be created if not provided' + description: 'Engine override' required: false type: string account: - description: 'Account' - required: true + description: 'Account override' + required: false type: string secrets: FIREBOLT_CLIENT_ID_STG_NEW_IDN: @@ -34,6 +47,17 @@ jobs: script: | core.setFailed("Database and Engine parameters should be provided simultaneously") + - name: Resolve account + id: set-account + run: | + if ! [[ -z "${{ inputs.account }}" ]]; then + echo "account=${{ inputs.account }}" >> $GITHUB_OUTPUT + echo "account=${{ inputs.account }}" + else + echo "account=${{ vars.FIREBOLT_ACCOUNT }}" >> $GITHUB_OUTPUT + echo "account=${{ vars.FIREBOLT_ACCOUNT }}" + fi + - name: Check out code uses: actions/checkout@v3 @@ -50,7 +74,7 @@ jobs: with: firebolt-client-id: ${{ secrets.FIREBOLT_CLIENT_ID_STG_NEW_IDN }} firebolt-client-secret: ${{ secrets.FIREBOLT_CLIENT_SECRET_STG_NEW_IDN }} - account: ${{ inputs.account }} + account: ${{ steps.set-account.outputs.account }} api-endpoint: "api.staging.firebolt.io" - name: Determine database name @@ -72,4 +96,4 @@ jobs: fi - name: Run integration tests - run: ./gradlew integrationTest -Ddb=${{ steps.find-database-name.outputs.database_name }} -Denv=staging -Dclient_secret="${{ secrets.FIREBOLT_CLIENT_SECRET_STG_NEW_IDN }}" -Dclient_id="${{ secrets.FIREBOLT_CLIENT_ID_STG_NEW_IDN }}" -Daccount="${{ inputs.account }}" -Dengine="${{ steps.find-engine-name.outputs.engine_name }}" -DexcludeTags=v1 + run: ./gradlew integrationTest -Ddb=${{ steps.find-database-name.outputs.database_name }} -Denv=staging -Dclient_secret="${{ secrets.FIREBOLT_CLIENT_SECRET_STG_NEW_IDN }}" -Dclient_id="${{ secrets.FIREBOLT_CLIENT_ID_STG_NEW_IDN }}" -Daccount="${{ steps.set-account.outputs.account }}" -Dengine="${{ steps.find-engine-name.outputs.engine_name }}" -DexcludeTags=v1 diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml index 9c99320bc..7be2cef70 100644 --- a/.github/workflows/integration-test.yml +++ b/.github/workflows/integration-test.yml @@ -2,56 +2,17 @@ name: Run integration tests on: workflow_dispatch: - inputs: - database1: - description: 'Database (v1) - a new one will be created if not provided' - required: false - default: '' - database-with-engine-v2: - description: 'Database (v2) for Firebolt v2 - a new one will be created if not provided' - required: false - default: '' - engine1: - description: 'Engine (v1) - a new one will be created if not provided' - required: false - engine_v2_fb_2_0: - description: 'Engine (v2) for Firebolt v2 - a new one will be created if not provided' - required: false - run-v1: - description: 'Run tests against Firebolt DB v1' - required: true - default: true - type: choice - options: - - 'true' - - 'false' - run-database-with-engine-v2: - description: 'Run tests against Firebolt DB v2 and Engine V2' - required: true - default: true - type: choice - options: - - 'true' - - 'false' + workflow_call: jobs: run-integration-tests1: - if: ${{ inputs.run-v1 == 'true' }} uses: ./.github/workflows/integration-test-v1.yml - with: - database: ${{ inputs.database1 }} - engine: ${{ inputs.engine1 }} secrets: FIREBOLT_STG_USERNAME: ${{ secrets.FIREBOLT_STG_USERNAME }} FIREBOLT_STG_PASSWORD: ${{ secrets.FIREBOLT_STG_PASSWORD }} run-integration-tests-engine2: - if: ${{ inputs.run-database-with-engine-v2 == 'true' }} uses: ./.github/workflows/integration-test-v2.yml - with: - database: ${{ inputs.database-with-engine-v2 }} - engine: ${{ inputs.engine_v2_fb_2_0 }} - account: ${{ vars.FIREBOLT_ACCOUNT_V2 }} 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 }}