From e17e6555e6bb5f5550a361e18debe1b14acb1936 Mon Sep 17 00:00:00 2001 From: Bo Xu Date: Wed, 21 Oct 2020 10:15:02 -0700 Subject: [PATCH] Fix deploy error: need 'cd server' so requirements-core.txt can be found (#634) * Fix staging deploy error: need 'cd server' so requirements-core.txt can be found * comment * Update package-lock.json * clean * clean * fix * fix test --- cloudbuild.deploy.yaml | 10 +++++----- cloudbuild.py.yaml | 3 +-- cloudbuild.screenshot.yaml | 2 +- server/webdriver_tests/screenshot/screenshot_test.py | 2 +- static/package-lock.json | 6 ++++++ 5 files changed, 14 insertions(+), 9 deletions(-) diff --git a/cloudbuild.deploy.yaml b/cloudbuild.deploy.yaml index 388df6849..712cda798 100644 --- a/cloudbuild.deploy.yaml +++ b/cloudbuild.deploy.yaml @@ -19,7 +19,6 @@ steps: args: - -c - | - set -x ./run_test.sh -lbc - id: flask_test @@ -28,7 +27,6 @@ steps: args: - -c - | - set -x ./run_test.sh -p - id: deploy @@ -37,7 +35,7 @@ steps: args: - -c - | - set -x + set -e # Set project gcloud config set project datcom-browser-staging @@ -50,7 +48,8 @@ steps: # Deploy flask app service gcloud config set app/cloud_build_timeout 1200 - gcloud app deploy server/app_staging.yaml -q --version=$SHORT_SHA + cd server + gcloud app deploy app_staging.yaml -q --version=$SHORT_SHA # Keep at most 5 recent versions if [[ "$(gcloud app versions list | wc -l)" -gt 6 ]]; then @@ -65,7 +64,8 @@ steps: args: - -c - | - set -x + set -e + gcloud source repos clone deployment --project=datcom-ci cd deployment # Configure Git to create commits with Cloud Build's service account diff --git a/cloudbuild.py.yaml b/cloudbuild.py.yaml index c290d5582..0d731d420 100644 --- a/cloudbuild.py.yaml +++ b/cloudbuild.py.yaml @@ -14,7 +14,6 @@ steps: args: - -c - | - set -x # ./run_test.sh -b can run npm run-script build command which can build all the js files. # These js files generated will be necessery for the flask_webdriver_test task. ./run_test.sh -b @@ -32,5 +31,5 @@ steps: entrypoint: /bin/sh args: - -c + - set -x - "cd tools/pv_tree_generator && pip install -r requirements.txt && python -m pytest" -# TODO: Add Python linter and any other useful code health tools. diff --git a/cloudbuild.screenshot.yaml b/cloudbuild.screenshot.yaml index 2e5286e30..d2f6dcab5 100644 --- a/cloudbuild.screenshot.yaml +++ b/cloudbuild.screenshot.yaml @@ -20,7 +20,6 @@ steps: args: - -c - | - set -x # ./run_test.sh -b can run npm run-script build command which can build all the js files. # These js files generated will be necessery for the flask_webdriver_test task. ./run_test.sh -b @@ -40,6 +39,7 @@ steps: args: - -c - | + set -e gsutil cp server/test_screenshots/*.png gs://datcom-browser-screenshot/$SHORT_SHA/ rm -rf server/test_screenshots # # Fetch author email from git commit history diff --git a/server/webdriver_tests/screenshot/screenshot_test.py b/server/webdriver_tests/screenshot/screenshot_test.py index 6917d188c..d7ea5dc20 100644 --- a/server/webdriver_tests/screenshot/screenshot_test.py +++ b/server/webdriver_tests/screenshot/screenshot_test.py @@ -91,7 +91,7 @@ }, { 'url': - '/ranking/Count_Person_BelowPovertyLevelInThePast12Months_NativeHawaiianOrOtherPacificIslanderAlone/City/geoId/06085?h=geoId%2F0649670&pc=1&scaling=100&unit=%25', + '/ranking/Count_Person_BelowPovertyLevelInThePast12Months_AsianAlone/City/geoId/06085?h=geoId%2F0649670&pc=1&scaling=100&unit=%25', 'filename_suffix': 'ranking_poverty.png', 'test_class': diff --git a/static/package-lock.json b/static/package-lock.json index cf7791b99..400262427 100644 --- a/static/package-lock.json +++ b/static/package-lock.json @@ -8733,6 +8733,12 @@ "integrity": "sha512-r8EC6NO1sngH/zdD9fiRDLdcgnbayXah+mLgManTaIZJqEC1MZstmnox8KpnI2/fxQwrp5OpCOYWLp4rBl4Jcg==", "dev": true }, + "geo-albers-usa-territories": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/geo-albers-usa-territories/-/geo-albers-usa-territories-0.1.0.tgz", + "integrity": "sha512-mmYOFbMcDbO/EP/bs01huipWEVGN8J6kz2zasMCx1CI1nAQyAAmfXQhpIROleDm4/RoOiaql5qO81eW+tPs9og==", + "dev": true + }, "get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",