Skip to content

Commit 10ec818

Browse files
committed
skip tests in dev environment api deployment
1 parent 96552cc commit 10ec818

3 files changed

Lines changed: 17 additions & 7 deletions

File tree

.github/workflows/api-deployer.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ on:
6060
description: Oauth client id part of the authorization for the operations API
6161
required: true
6262
type: string
63+
SKIP_TEST:
64+
description: The skip test parameter is useful for DEV environment deployments, not advised for QA and PROD.
65+
required: false
66+
type: boolean
67+
default: false
6368

6469
env:
6570
python_version: '3.11'
@@ -74,6 +79,8 @@ jobs:
7479
api-build-test:
7580
uses: ./.github/workflows/build-test.yml
7681
name: Build & Test
82+
with:
83+
SKIP_TEST: ${{ inputs.SKIP_TESTS }}
7784

7885
create-artifact-repo:
7986
runs-on: ubuntu-latest

.github/workflows/api-dev.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ jobs:
2323
TF_APPLY: true
2424
VALIDATOR_ENDPOINT: https://stg-gtfs-validator-web-mbzoxaljzq-ue.a.run.app
2525
OPERATIONS_OAUTH2_CLIENT_ID_1PASSWORD: "op://rbiv7rvkkrsdlpcrz3bmv7nmcu/GCP_RETOOL_OAUTH2_CREDS/username"
26+
SKIP_TEST: true
2627
secrets:
2728
GCP_MOBILITY_FEEDS_SA_KEY: ${{ secrets.DEV_GCP_MOBILITY_FEEDS_SA_KEY }}
2829
OAUTH2_CLIENT_ID: ${{ secrets.DEV_MOBILITY_FEEDS_OAUTH2_CLIENT_ID}}

.github/workflows/build-test.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,17 @@ on:
88
- "functions/**"
99
- ".github/workflows/web-*.yml"
1010
workflow_call:
11+
inputs:
12+
SKIP_TEST:
13+
description: The skip test parameter is useful for DEV environment deployments, not advised for QA and PROD.
14+
required: false
15+
type: boolean
16+
default: false
1117

1218
env:
1319
python_version: '3.11'
1420
java_version: '11' # needed by setup-openapi-generator.sh
21+
SKIP_TESTS: ${{ inputs.SKIP_TEST || false }}
1522

1623
jobs:
1724
build-test:
@@ -54,13 +61,6 @@ jobs:
5461
sudo apt-get update
5562
sudo apt-get install liquibase=4.25.1
5663
57-
# Uncomment the following block to test the local databases connections
58-
# - name: Test Database Connection
59-
# run: |
60-
# sudo apt-get update && sudo apt-get install -y postgresql-client
61-
# PGPASSWORD=postgres psql -h localhost -p 5432 -U postgres -d MobilityDatabase -c "SELECT version();"
62-
# PGPASSWORD=postgres psql -h localhost -p 54320 -U postgres -d MobilityDatabaseTest -c "SELECT version();"
63-
6464
- name: Run Liquibase on Python functions test DB
6565
run: |
6666
export LIQUIBASE_CLASSPATH="liquibase"
@@ -85,11 +85,13 @@ jobs:
8585
scripts/api-operations-gen.sh
8686
8787
- name: Unit tests - API
88+
if: ${{ !env.SKIP_TESTS }}
8889
shell: bash
8990
run: |
9091
scripts/api-tests.sh --folder api --html_report
9192
9293
- name: Unit tests - Python Functions
94+
if: ${{ !env.SKIP_TESTS }}
9395
shell: bash
9496
run: |
9597
scripts/api-tests.sh --folder functions-python --html_report

0 commit comments

Comments
 (0)