Split cypress tests (#6241)

* aplit cypress tests

* split into three
This commit is contained in:
timifasubaa 2018-11-15 12:26:33 -08:00 committed by GitHub
parent ec1316a5a8
commit c17de3940c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 65 additions and 13 deletions

View File

@ -4,7 +4,33 @@ jobs:
include: include:
- language: python - language: python
python: 3.6 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: cache:
pip: true pip: true
yarn: true yarn: true

0
cypress.json Normal file
View File

View File

@ -1,8 +1,10 @@
{ {
"baseUrl": "http://localhost:8081", "baseUrl": "http://localhost:8081",
"videoUploadOnPasses": false, "videoUploadOnPasses": false,
"video": false,
"ignoreTestFiles": ["**/!(*.test.js)"], "ignoreTestFiles": ["**/!(*.test.js)"],
"projectId": "fbf96q", "projectId": "fbf96q",
"defaultCommandTimeout": 10000,
"viewportWidth": 1280, "viewportWidth": 1280,
"viewportHeight": 800 "viewportHeight": 800
} }

View File

@ -1,15 +1,15 @@
#!/bin/bash #!/bin/bash
set -e 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")" cd "$(dirname "$0")"
yarn install --frozen-lockfile #run all the python steps in a background process
npm run build (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) &
npm run cypress run
#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 kill %1

30
tox.ini
View File

@ -45,9 +45,31 @@ setenv =
whitelist_externals = whitelist_externals =
npm npm
[testenv:cypress] [testenv:cypress-dashboard]
commands = 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 = setenv =
PYTHONPATH = {toxinidir} PYTHONPATH = {toxinidir}
SUPERSET_CONFIG = tests.superset_test_config SUPERSET_CONFIG = tests.superset_test_config
@ -83,7 +105,9 @@ deps =
[tox] [tox]
envlist = envlist =
cypress cypress-dashboard
cypress-explore
cypress-sqllab
eslint eslint
flake8 flake8
javascript javascript