-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a329fab
commit 30dc2ff
Showing
3 changed files
with
224 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
name: Run integration tests v1 | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
database: | ||
description: 'Database - a new one will be created if not provided' | ||
required: false | ||
default: '' | ||
engine: | ||
description: 'Engine - a new one will be created if not provided' | ||
required: false | ||
environment: | ||
description: 'Environment to run the tests against' | ||
type: choice | ||
required: true | ||
default: 'staging' | ||
options: | ||
- dev | ||
- staging | ||
|
||
jobs: | ||
run-integration-tests: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Validate database and engine | ||
if: ${{ (github.event.inputs.database == '') != (github.event.inputs.engine == '') }} | ||
uses: actions/github-script@v3 | ||
with: | ||
script: | | ||
core.setFailed("Database and Engine parameters should be provided simultaneously") | ||
- name: "Foresight: Collect Workflow Telemetry" | ||
uses: runforesight/foresight-workflow-kit-action@v1 | ||
if: ${{ always() }} | ||
- name: Check out code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Prepare java | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'zulu' | ||
java-version: '17' | ||
- name: Determine env variables | ||
run: | | ||
if [ "${{ github.event.inputs.environment }}" == 'staging' ]; then | ||
echo "USERNAME=${{ secrets.FIREBOLT_USERNAME_STAGING }}" >> "$GITHUB_ENV" | ||
echo "PASSWORD=${{ secrets.FIREBOLT_PASSWORD_STAGING }}" >> "$GITHUB_ENV" | ||
else | ||
echo "USERNAME=${{ secrets.FIREBOLT_USERNAME_DEV }}" >> "$GITHUB_ENV" | ||
echo "PASSWORD=${{ secrets.FIREBOLT_PASSWORD_DEV }}" >> "$GITHUB_ENV" | ||
fi | ||
- name: Setup database and engine | ||
id: setup | ||
if: ${{ github.event.inputs.database == '' }} | ||
uses: firebolt-db/integration-testing-setup@v1 | ||
with: | ||
firebolt-username: ${{ env.USERNAME }} | ||
firebolt-password: ${{ env.PASSWORD }} | ||
api-endpoint: "api.${{ github.event.inputs.environment }}.firebolt.io" | ||
region: "us-east-1" | ||
instance-type: "B2" | ||
|
||
- name: Determine database name | ||
id: find-database-name | ||
run: | | ||
if ! [[ -z "${{ github.event.inputs.database }}" ]]; then | ||
echo "database_name=${{ github.event.inputs.database }}" >> $GITHUB_OUTPUT | ||
else | ||
echo "database_name=${{ steps.setup.outputs.database_name }}" >> $GITHUB_OUTPUT | ||
fi | ||
- name: Determine engine name | ||
id: find-engine-name | ||
run: | | ||
if ! [[ -z "${{ github.event.inputs.engine }}" ]]; then | ||
echo "engine_name=${{ github.event.inputs.engine }}" >> $GITHUB_OUTPUT | ||
else | ||
echo "engine_name=${{ steps.setup.outputs.engine_name }}" >> $GITHUB_OUTPUT | ||
fi | ||
- name: Run integration tests | ||
run: ./gradlew integrationTest -Ddb=${{ steps.find-database-name.outputs.database_name }} -Dapi=api.${{ github.event.inputs.environment }}.firebolt.io -Dpassword="${{ env.PASSWORD }}" -Duser="${{ env.USERNAME }}" -Dengine="${{ steps.find-engine-name.outputs.engine_name }}" | ||
|
||
- name: "Foresight: Analyze Test Results" | ||
uses: runforesight/foresight-test-kit-action@v1 | ||
if: success() || failure() | ||
with: | ||
test_format: JUNIT | ||
test_framework: JUNIT | ||
test_path: ./build/test-results/ | ||
tags: | | ||
type:"integration" | ||
language:"Java" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
name: Run integration tests v2 | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
database: | ||
description: 'Database - a new one will be created if not provided' | ||
required: false | ||
default: '' | ||
engine: | ||
description: 'Engine - a new one will be created if not provided' | ||
required: false | ||
account: | ||
description: 'Account' | ||
required: true | ||
default: 'developer' | ||
environment: | ||
description: 'Environment to run the tests against' | ||
type: choice | ||
required: true | ||
default: 'staging' | ||
options: | ||
- dev | ||
- staging | ||
|
||
jobs: | ||
run-integration-tests: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Validate database and engine | ||
if: ${{ (github.event.inputs.database == '') != (github.event.inputs.engine == '') }} | ||
uses: actions/github-script@v3 | ||
with: | ||
script: | | ||
core.setFailed("Database and Engine parameters should be provided simultaneously") | ||
- name: "Foresight: Collect Workflow Telemetry" | ||
uses: runforesight/foresight-workflow-kit-action@v1 | ||
if: ${{ always() }} | ||
- name: Check out code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Prepare java | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'zulu' | ||
java-version: '17' | ||
- name: Determine env variables | ||
run: | | ||
if [ "${{ github.event.inputs.environment }}" == 'staging' ]; then | ||
echo "SERVICE_ACCOUNT_ID=${{ secrets.FIREBOLT_CLIENT_ID_STG_NEW_IDN }}" >> "$GITHUB_ENV" | ||
echo "SERVICE_ACCOUNT_SECRET=${{ secrets.FIREBOLT_CLIENT_SECRET_STG_NEW_IDN }}" >> "$GITHUB_ENV" | ||
else | ||
echo "SERVICE_ACCOUNT_ID=${{ secrets.FIREBOLT_CLIENT_ID_NEW_IDN }}" >> "$GITHUB_ENV" | ||
echo "SERVICE_ACCOUNT_SECRET=${{ secrets.FIREBOLT_CLIENT_SECRET_NEW_IDN }}" >> "$GITHUB_ENV" | ||
fi | ||
- name: Setup database and engine | ||
id: setup | ||
if: ${{ github.event.inputs.database == '' }} | ||
uses: firebolt-db/integration-testing-setup@v2 | ||
with: | ||
firebolt-client-id: ${{ env.SERVICE_ACCOUNT_ID }} | ||
firebolt-client-secret: ${{ env.SERVICE_ACCOUNT_SECRET }} | ||
account: ${{ github.event.inputs.account }} | ||
api-endpoint: "api.${{ github.event.inputs.environment }}.firebolt.io" | ||
instance-type: "B2" | ||
|
||
- name: Determine database name | ||
id: find-database-name | ||
run: | | ||
if ! [[ -z "${{ github.event.inputs.database }}" ]]; then | ||
echo "database_name=${{ github.event.inputs.database }}" >> $GITHUB_OUTPUT | ||
else | ||
echo "database_name=${{ steps.setup.outputs.database_name }}" >> $GITHUB_OUTPUT | ||
fi | ||
- name: Determine engine name | ||
id: find-engine-name | ||
run: | | ||
if ! [[ -z "${{ github.event.inputs.engine }}" ]]; then | ||
echo "engine_name=${{ github.event.inputs.engine }}" >> $GITHUB_OUTPUT | ||
else | ||
echo "engine_name=${{ steps.setup.outputs.engine_name }}" >> $GITHUB_OUTPUT | ||
fi | ||
- name: Run integration tests | ||
run: ./gradlew integrationTest -Ddb=${{ steps.find-database-name.outputs.database_name }} -Denv=${{ github.event.inputs.environment }} -Dclient_secret="${{ env.SERVICE_ACCOUNT_SECRET }}" -Dclient_id="${{ env.SERVICE_ACCOUNT_ID }}" -Daccount="${{ github.event.inputs.account }}" -Dengine="${{ steps.find-engine-name.outputs.engine_name }}" | ||
|
||
- name: "Foresight: Analyze Test Results" | ||
uses: runforesight/foresight-test-kit-action@v1 | ||
if: success() || failure() | ||
with: | ||
test_format: JUNIT | ||
test_framework: JUNIT | ||
test_path: ./build/test-results/ | ||
tags: | | ||
type:"integration" | ||
language:"Java" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters