Skip to content

Commit

Permalink
jaffle shop
Browse files Browse the repository at this point in the history
  • Loading branch information
ptiurin committed Dec 1, 2023
1 parent 8279b5c commit 3dba8b2
Show file tree
Hide file tree
Showing 3 changed files with 195 additions and 63 deletions.
82 changes: 82 additions & 0 deletions .github/workflows/jaffle-shop-v1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Run Jaffle shop tests V1
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
jobs:
tests:
runs-on: ubuntu-latest
steps:
- name: Check out dbt-adapter code
uses: actions/checkout@v2
with:
path: dbt-firebolt

- name: Check out Jaffle Shop code
uses: actions/checkout@v2
with:
repository: firebolt-db/jaffle_shop_firebolt
path: jaffle-shop

- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install "dbt-firebolt/.[dev]"
- name: Determine env variables
run: |
if [ "${{ 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: Keep environment name in the summary
run: echo '### Ran integration tests against ${{ inputs.environment }} ' >> $GITHUB_STEP_SUMMARY

- 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"
region: "us-east-1"

- name: Run Jaffle Shop test workflow
env:
USER_NAME: ${{ env.USERNAME }}
PASSWORD: ${{ env.PASSWORD }}
DATABASE_NAME: ${{ steps.setup.outputs.database_name }}
ENGINE_NAME: ${{ steps.setup.outputs.engine_name }}
API_ENDPOINT: "api.${{ inputs.environment }}.firebolt.io"
ACCOUNT_NAME: "firebolt"
DBT_PROFILES_DIR: "../dbt-firebolt/.github/workflows/jaffle_shop"
working-directory: jaffle-shop
run:
../dbt-firebolt/.github/workflows/jaffle_shop/run_test_workflow.sh
89 changes: 89 additions & 0 deletions .github/workflows/jaffle-shop-v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Run Jaffle shop tests V2
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_DEV_NEW_IDN:
required: true
FIREBOLT_CLIENT_SECRET_DEV_NEW_IDN:
required: true
FIREBOLT_CLIENT_ID_STG_NEW_IDN:
required: true
FIREBOLT_CLIENT_SECRET_STG_NEW_IDN:
required: true
jobs:
tests:
runs-on: ubuntu-latest
steps:
- name: Check out dbt-adapter code
uses: actions/checkout@v2
with:
path: dbt-firebolt

- name: Check out Jaffle Shop code
uses: actions/checkout@v2
with:
repository: firebolt-db/jaffle_shop_firebolt
path: jaffle-shop

- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install "dbt-firebolt/.[dev]"
- name: Determine env variables
run: |
if [ "${{ inputs.environment }}" == 'staging' ]; then
echo "KEY=${{ secrets.FIREBOLT_CLIENT_ID_STG_NEW_IDN }}" >> "$GITHUB_ENV"
echo "SECRET=${{ secrets.FIREBOLT_CLIENT_SECRET_STG_NEW_IDN }}" >> "$GITHUB_ENV"
else
echo "KEY=${{ secrets.FIREBOLT_CLIENT_ID_DEV_NEW_IDN }}" >> "$GITHUB_ENV"
echo "SECRET=${{ secrets.FIREBOLT_CLIENT_SECRET_DEV_NEW_IDN }}" >> "$GITHUB_ENV"
fi
- name: Keep environment name in the summary
run: echo '### Ran integration tests against ${{ inputs.environment }} ' >> $GITHUB_STEP_SUMMARY

- name: Setup database and engine
id: setup
uses: firebolt-db/integration-testing-setup@v2
with:
firebolt-client-id: ${{ secrets.KEY }}
firebolt-client-secret: ${{ secrets.SECRET }}
account: "developer"
api-endpoint: "api.${{ inputs.environment }}.firebolt.io"


- name: Run Jaffle Shop test workflow
env:
USER_NAME: ${{ env.KEY }}
PASSWORD: ${{ env.SECRET }}
DATABASE_NAME: ${{ steps.setup.outputs.database_name }}
ENGINE_NAME: ${{ steps.setup.outputs.engine_name }}
API_ENDPOINT: "api.${{ inputs.environment }}.firebolt.io"
ACCOUNT_NAME: "developer"
DBT_PROFILES_DIR: "../dbt-firebolt/.github/workflows/jaffle_shop"
working-directory: jaffle-shop
run:
../dbt-firebolt/.github/workflows/jaffle_shop/run_test_workflow.sh


87 changes: 24 additions & 63 deletions .github/workflows/jaffle_shop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,69 +17,30 @@ on:
required: false
type: string
secrets:
FIREBOLT_USERNAME:
FIREBOLT_USERNAME_STAGING:
required: true
FIREBOLT_PASSWORD:
FIREBOLT_PASSWORD_STAGING:
required: true
FIREBOLT_USERNAME_DEV:
required: true
FIREBOLT_PASSWORD_DEV:
required: true
FIREBOLT_CLIENT_ID_DEV_NEW_IDN:
required: true
FIREBOLT_CLIENT_SECRET_DEV_NEW_IDN:
required: true
FIREBOLT_CLIENT_ID_STG_NEW_IDN:
required: true
FIREBOLT_CLIENT_SECRET_STG_NEW_IDN:
required: true
jobs:
tests:
runs-on: ubuntu-latest
steps:
- name: Check out dbt-adapter code
uses: actions/checkout@v2
with:
path: dbt-firebolt

- name: Check out Jaffle Shop code
uses: actions/checkout@v2
with:
repository: firebolt-db/jaffle_shop_firebolt
path: jaffle-shop

- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install "dbt-firebolt/.[dev]"
- name: Determine env variables
run: |
if [ "${{ inputs.environment }}" == 'staging' ]; then
echo "USERNAME=${{ secrets.FIREBOLT_CLIENT_ID_STG_NEW_IDN }}" >> "$GITHUB_ENV"
echo "PASSWORD=${{ secrets.FIREBOLT_CLIENT_SECRET_STG_NEW_IDN }}" >> "$GITHUB_ENV"
else
echo "USERNAME=${{ secrets.FIREBOLT_USERNAME_DEV }}" >> "$GITHUB_ENV"
echo "PASSWORD=${{ secrets.FIREBOLT_PASSWORD_DEV }}" >> "$GITHUB_ENV"
fi
- name: Keep environment name in the summary
run: echo '### Ran integration tests against ${{ inputs.environment }} ' >> $GITHUB_STEP_SUMMARY

- name: Setup database and engine
id: setup
uses: firebolt-db/integration-testing-setup@v2
with:
firebolt-client-id: ${{ secrets.FIREBOLT_CLIENT_ID_STG_NEW_IDN }}
firebolt-client-secret: ${{ secrets.FIREBOLT_CLIENT_SECRET_STG_NEW_IDN }}
account: "developer"
api-endpoint: "api.${{ inputs.environment }}.firebolt.io"


- name: Run Jaffle Shop test workflow
env:
USER_NAME: ${{ env.USERNAME }}
PASSWORD: ${{ env.PASSWORD }}
DATABASE_NAME: ${{ steps.setup.outputs.database_name }}
ENGINE_NAME: ${{ steps.setup.outputs.engine_name }}
API_ENDPOINT: "api.${{ inputs.environment }}.firebolt.io"
ACCOUNT_NAME: "developer"
DBT_PROFILES_DIR: "../dbt-firebolt/.github/workflows/jaffle_shop"
working-directory: jaffle-shop
run:
../dbt-firebolt/.github/workflows/jaffle_shop/run_test_workflow.sh


jaffle-shop-v1:
uses: ./.github/workflows/jaffle-shop-v1.yml
with:
environment: ${{ github.event.inputs.environment }}
secrets: inherit
jaffle-shop-v2:
uses: ./.github/workflows/jaffle-shop-v2.yml
with:
environment: ${{ github.event.inputs.environment }}
secrets: inherit

0 comments on commit 3dba8b2

Please sign in to comment.