From 0d90bc9920c211043002337987621a502286764e Mon Sep 17 00:00:00 2001 From: Elizabeth Thompson Date: Wed, 16 Sep 2020 12:31:03 -0700 Subject: [PATCH] chore: update port that cypress runs on for local vs test (#10847) --- .github/workflows/bashlib.sh | 1 + CONTRIBUTING.md | 5 +++++ superset-frontend/cypress-base/cypress.json | 2 +- superset-frontend/cypress_build.sh | 4 +++- 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/bashlib.sh b/.github/workflows/bashlib.sh index 5cd9221e26..181fca18dc 100644 --- a/.github/workflows/bashlib.sh +++ b/.github/workflows/bashlib.sh @@ -181,6 +181,7 @@ cypress-run-all() { # so errors can print to stderr. local flasklog="${HOME}/flask.log" local port=8081 + export CYPRESS_BASE_URL="http://localhost:${port}" nohup flask run --no-debugger -p $port >"$flasklog" 2>&1 npm run cypress open ``` See [`superset-frontend/cypress_build.sh`](https://github.com/apache/incubator-superset/blob/master/superset-frontend/cypress_build.sh). diff --git a/superset-frontend/cypress-base/cypress.json b/superset-frontend/cypress-base/cypress.json index 8856588dfa..7f1c39436d 100644 --- a/superset-frontend/cypress-base/cypress.json +++ b/superset-frontend/cypress-base/cypress.json @@ -1,5 +1,5 @@ { - "baseUrl": "http://localhost:8081", + "baseUrl": "http://localhost:8088", "chromeWebSecurity": false, "defaultCommandTimeout": 5000, "experimentalFetchPolyfill": true, diff --git a/superset-frontend/cypress_build.sh b/superset-frontend/cypress_build.sh index 24ee884386..a71edf27f8 100755 --- a/superset-frontend/cypress_build.sh +++ b/superset-frontend/cypress_build.sh @@ -25,7 +25,8 @@ time superset load_test_users time superset load_examples --load-test-data time superset init echo "[completed python build steps]" -flask run -p 8081 --with-threads --reload --debugger & +PORT='8081' +flask run -p $PORT --with-threads --reload --debugger & #block on the longer running javascript process time npm ci @@ -35,6 +36,7 @@ echo "[completed js build steps]" #setup cypress cd cypress-base time npm ci +export CYPRESS_BASE_URL="http://localhost:${PORT}" CYPRESS_PATH='cypress/integration/'${1}'/*' time npm run cypress run -- --spec "$CYPRESS_PATH" --record false --config video=false