Skip to content

Commit

Permalink
Corrected wrong test
Browse files Browse the repository at this point in the history
  • Loading branch information
jcpitre committed Aug 13, 2024
1 parent 0c1f54e commit 01674ff
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 30 deletions.
61 changes: 32 additions & 29 deletions .github/workflows/db-update-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ on:
workflow_dispatch:
workflow_call:
repository_dispatch: # Update on mobility-database-catalog repo dispatch
types: [ catalog-sources-updated ]
types: [ catalog-sources-updated-test ]
push: # Update on merge on main branch if the changelog file has been updated
branches:
- 655-integration-tests-is-blocking-catalog-update-in-prod-2
jobs:
update-qa: # Update the QA database first
uses: ./.github/workflows/db-update.yml
Expand All @@ -23,7 +26,7 @@ jobs:
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
POSTGRE_SQL_INSTANCE_NAME: ${{ secrets.DB_INSTANCE_NAME }}
integration-tests-qa: # Run integration tests on QA
if: github.event_name == 'repository_dispatch'
if: github.event_name == 'push'
uses: ./.github/workflows/integration-tests.yml
needs:
- update-qa
Expand All @@ -32,30 +35,30 @@ jobs:
ENVIRONMENT: 'qa'
secrets:
REFRESH_TOKEN: ${{ secrets.QA_API_TEST_REFRESH_TOKEN }}
update:
uses: ./.github/workflows/db-update.yml
needs:
- integration-tests-qa
with:
PROJECT_ID: ${{ vars.PROD_MOBILITY_FEEDS_PROJECT_ID }}
REGION: ${{ vars.MOBILITY_FEEDS_REGION }}
DB_NAME: ${{ vars.PROD_POSTGRE_SQL_DB_NAME }}
ENVIRONMENT: ${{ vars.PROD_MOBILITY_FEEDS_ENVIRONMENT }}
DB_ENVIRONMENT: ${{ vars.PROD_MOBILITY_FEEDS_ENVIRONMENT }}
secrets:
DB_USER_PASSWORD: ${{ secrets.PROD_POSTGRE_USER_PASSWORD }}
DB_USER_NAME: ${{ secrets.PROD_POSTGRE_USER_NAME }}
DB_INSTANCE_NAME: ${{ secrets.DB_INSTANCE_NAME }}
GCP_MOBILITY_FEEDS_SA_KEY: ${{ secrets.PROD_GCP_MOBILITY_FEEDS_SA_KEY }}
DB_GCP_MOBILITY_FEEDS_SA_KEY: ${{ secrets.PROD_GCP_MOBILITY_FEEDS_SA_KEY }}
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
POSTGRE_SQL_INSTANCE_NAME: ${{ secrets.DB_INSTANCE_NAME }}
integration-tests-prod:
if: github.event_name == 'repository_dispatch'
uses: ./.github/workflows/integration-tests.yml
needs: update
with:
API_URL: "https://api.mobilitydatabase.org"
ENVIRONMENT: 'prod'
secrets:
REFRESH_TOKEN: ${{ secrets.PROD_API_TEST_REFRESH_TOKEN }}
# update:
# uses: ./.github/workflows/db-update.yml
# needs:
# - integration-tests-qa
# with:
# PROJECT_ID: ${{ vars.PROD_MOBILITY_FEEDS_PROJECT_ID }}
# REGION: ${{ vars.MOBILITY_FEEDS_REGION }}
# DB_NAME: ${{ vars.PROD_POSTGRE_SQL_DB_NAME }}
# ENVIRONMENT: ${{ vars.PROD_MOBILITY_FEEDS_ENVIRONMENT }}
# DB_ENVIRONMENT: ${{ vars.PROD_MOBILITY_FEEDS_ENVIRONMENT }}
# secrets:
# DB_USER_PASSWORD: ${{ secrets.PROD_POSTGRE_USER_PASSWORD }}
# DB_USER_NAME: ${{ secrets.PROD_POSTGRE_USER_NAME }}
# DB_INSTANCE_NAME: ${{ secrets.DB_INSTANCE_NAME }}
# GCP_MOBILITY_FEEDS_SA_KEY: ${{ secrets.PROD_GCP_MOBILITY_FEEDS_SA_KEY }}
# DB_GCP_MOBILITY_FEEDS_SA_KEY: ${{ secrets.PROD_GCP_MOBILITY_FEEDS_SA_KEY }}
# OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
# POSTGRE_SQL_INSTANCE_NAME: ${{ secrets.DB_INSTANCE_NAME }}
# integration-tests-prod:
# if: github.event_name == 'repository_dispatch'
# uses: ./.github/workflows/integration-tests.yml
# needs: update
# with:
# API_URL: "https://api.mobilitydatabase.org"
# ENVIRONMENT: 'prod'
# secrets:
# REFRESH_TOKEN: ${{ secrets.PROD_API_TEST_REFRESH_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
# at the exact values, so always do these tests.
run: |
health_check_classes="BasicMetadataEndpointTests"
if [[ "${{ github.event_name }}" == "repository_dispatch" ]]; then
if [[ "${{ github.event_name }}" != "push" ]]; then
health_check_classes += ",MetadataEndpointTests"
fi
./scripts/integration-tests.sh -u ${{ inputs.API_URL }} -f $FILE_PATH -c $health_check_classes
Expand Down

0 comments on commit 01674ff

Please sign in to comment.