You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ta...@apache.org on 2020/09/16 19:31:35 UTC

[incubator-superset] branch master updated: chore: update port that cypress runs on for local vs test (#10847)

This is an automated email from the ASF dual-hosted git repository.

tai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
     new 0d90bc9  chore: update port that cypress runs on for local vs test (#10847)
0d90bc9 is described below

commit 0d90bc9920c211043002337987621a502286764e
Author: Elizabeth Thompson <el...@easypost.com>
AuthorDate: Wed Sep 16 12:31:03 2020 -0700

    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 5cd9221..181fca1 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 </dev/null &
   local flaskProcessId=$!
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index fd77393..835ee86 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -607,6 +607,7 @@ We use [Cypress](https://www.cypress.io/) for integration tests. Tests can be ru
 
 ```bash
 export SUPERSET_CONFIG=tests.superset_test_config
+export CYPRESS_BASE_URL="http://localhost:8081"
 superset db upgrade
 superset init
 superset load_test_users
@@ -632,6 +633,10 @@ npm run cypress run -- --spec cypress/integration/dashboard/index.test.js --conf
 
 # to open the cypress ui
 npm run cypress open
+
+# to point cypress to a url other than the default (http://localhost:8088) set the environment variable before running the script
+# e.g., CYPRESS_BASE_URL="http://localhost:9000"
+CYPRESS_BASE_URL=<your url> 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 8856588..7f1c394 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 24ee884..a71edf2 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