superset-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject [incubator-superset] branch master updated: Split cypress tests (#6241)
Date Thu, 15 Nov 2018 20:26:39 GMT
This is an automated email from the ASF dual-hosted git repository.

timi 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 c17de39  Split cypress tests (#6241)
c17de39 is described below

commit c17de3940cd57c30c5518718433ccd27ba9b0c66
Author: timifasubaa <30888507+timifasubaa@users.noreply.github.com>
AuthorDate: Thu Nov 15 12:26:33 2018 -0800

    Split cypress tests (#6241)
    
    * aplit cypress tests
    
    * split into three
---
 .travis.yml                      | 28 +++++++++++++++++++++++++++-
 cypress.json                     |  0
 superset/assets/cypress.json     |  2 ++
 superset/assets/cypress_build.sh | 18 +++++++++---------
 tox.ini                          | 30 +++++++++++++++++++++++++++---
 5 files changed, 65 insertions(+), 13 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 247f9e4..cb7164d 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -4,7 +4,33 @@ jobs:
   include:
     - language: python
       python: 3.6
-      env: TOXENV=cypress
+      env: TOXENV=cypress-dashboard
+      cache:
+        pip: true
+        yarn: true
+        directories:
+          - ~/.npm
+          - ~/.cache
+      services:
+        - redis-server
+      before_install:
+        - nvm install 8.9
+    - language: python
+      python: 3.6
+      env: TOXENV=cypress-explore
+      cache:
+        pip: true
+        yarn: true
+        directories:
+          - ~/.npm
+          - ~/.cache
+      services:
+        - redis-server
+      before_install:
+        - nvm install 8.9
+    - language: python
+      python: 3.6
+      env: TOXENV=cypress-sqllab
       cache:
         pip: true
         yarn: true
diff --git a/cypress.json b/cypress.json
new file mode 100644
index 0000000..e69de29
diff --git a/superset/assets/cypress.json b/superset/assets/cypress.json
index 872283c..58ae32f 100644
--- a/superset/assets/cypress.json
+++ b/superset/assets/cypress.json
@@ -1,8 +1,10 @@
 {
   "baseUrl": "http://localhost:8081",
   "videoUploadOnPasses": false,
+  "video": false,
   "ignoreTestFiles": ["**/!(*.test.js)"],
   "projectId": "fbf96q",
+  "defaultCommandTimeout": 10000,
   "viewportWidth": 1280,
   "viewportHeight": 800
 }
diff --git a/superset/assets/cypress_build.sh b/superset/assets/cypress_build.sh
index 9e72e9f..6925400 100755
--- a/superset/assets/cypress_build.sh
+++ b/superset/assets/cypress_build.sh
@@ -1,15 +1,15 @@
 #!/bin/bash
 set -e
 
-superset/bin/superset db upgrade
-superset/bin/superset load_test_users
-superset/bin/superset load_examples
-superset/bin/superset init
-flask run -p 8081 --with-threads --reload --debugger &
-
 cd "$(dirname "$0")"
 
-yarn install --frozen-lockfile
-npm run build
-npm run cypress run
+#run all the python steps in a background process
+(time /home/travis/build/apache/incubator-superset/superset/bin/superset db upgrade; time
/home/travis/build/apache/incubator-superset/superset/bin/superset load_test_users; /home/travis/build/apache/incubator-superset/superset/bin/superset
load_examples; time /home/travis/build/apache/incubator-superset/superset/bin/superset init;
echo "[completed python build steps]"; flask run -p 8081 --with-threads --reload --debugger)
&
+
+#block on the longer running javascript process
+(time yarn install --frozen-lockfile; time npm run build; echo "[completed js build steps]")
+
+CYPRESS_PATH='cypress/integration/'${1}'/*'
+time npm run cypress run -- --spec "$CYPRESS_PATH" --record false --config video=false
+
 kill %1
diff --git a/tox.ini b/tox.ini
index 53949a3..5014168 100644
--- a/tox.ini
+++ b/tox.ini
@@ -45,9 +45,31 @@ setenv =
 whitelist_externals =
     npm
 
-[testenv:cypress]
+[testenv:cypress-dashboard]
 commands =
-    {toxinidir}/superset/assets/cypress_build.sh
+    {toxinidir}/superset/assets/cypress_build.sh dashboard
+setenv =
+    PYTHONPATH = {toxinidir}
+    SUPERSET_CONFIG = tests.superset_test_config
+    SUPERSET_HOME = {envtmpdir}
+deps =
+    -rrequirements.txt
+    -rrequirements-dev.txt
+
+[testenv:cypress-explore]
+commands =
+    {toxinidir}/superset/assets/cypress_build.sh explore
+setenv =
+    PYTHONPATH = {toxinidir}
+    SUPERSET_CONFIG = tests.superset_test_config
+    SUPERSET_HOME = {envtmpdir}
+deps =
+    -rrequirements.txt
+    -rrequirements-dev.txt
+
+[testenv:cypress-sqllab]
+commands =
+    {toxinidir}/superset/assets/cypress_build.sh sqllab
 setenv =
     PYTHONPATH = {toxinidir}
     SUPERSET_CONFIG = tests.superset_test_config
@@ -83,7 +105,9 @@ deps =
 
 [tox]
 envlist =
-    cypress
+    cypress-dashboard
+    cypress-explore
+    cypress-sqllab
     eslint
     flake8
     javascript


Mime
View raw message