From 50c701c0e86de08385e97d34b2dcd41e6c5ff5cd Mon Sep 17 00:00:00 2001 From: Krist Wongsuphasawat Date: Thu, 4 Oct 2018 14:54:44 -0700 Subject: [PATCH] [ci] Update ci config to reduce javascript test time and some of cypress. (#6016) * try travis config * try more complex config * fix config * add cache and stages * separate cache * swap order * fix redis * remove env * add cypress * adjust caching * reduce cache * change order of execution * change order again * change node version * install yarn via curl * update cypress command * update cypress command * adjust cache and node version * do not install yarn * add npm cache * remove export * remove commented code * change order of jobs * fix indent --- .travis.yml | 104 ++++++++++++++++++++----------- superset/assets/cypress_build.sh | 5 +- 2 files changed, 68 insertions(+), 41 deletions(-) diff --git a/.travis.yml b/.travis.yml index a02d009f8..180db344c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,44 +1,72 @@ -language: python -python: - - 2.7 - - 3.6 -services: - - mysql - - postgres - - redis-server cache: - - pip -matrix: + pip: true +jobs: include: - - python: 2.7 - env: TOXENV=flake8 - - python: 2.7 - env: TOXENV=py27-mysql - - python: 2.7 - env: TOXENV=py27-sqlite - - python: 2.7 - env: TOXENV=pylint - - python: 3.6 - env: TOXENV=flake8 - - python: 3.6 - env: TOXENV=javascript - - python: 3.6 - env: TOXENV=py36-postgres - - python: 3.6 - env: TOXENV=py36-sqlite - - python: 3.6 - env: TOXENV=pylint - - python: 3.6 + - language: python + python: 3.6 env: TOXENV=cypress - exclude: - - python: 2.7 - - python: 3.6 -before_script: - - mysql -u root -e "DROP DATABASE IF EXISTS superset; CREATE DATABASE superset DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci" - - mysql -u root -e "CREATE USER 'mysqluser'@'localhost' IDENTIFIED BY 'mysqluserpassword';" - - mysql -u root -e "GRANT ALL ON superset.* TO 'mysqluser'@'localhost';" - - psql -U postgres -c "CREATE DATABASE superset;" - - psql -U postgres -c "CREATE USER postgresuser WITH PASSWORD 'pguserpassword';" + cache: + pip: true + yarn: true + directories: + - ~/.npm + - ~/.cache + services: + - redis-server + before_install: + - nvm install 8.9 + - language: python + python: 2.7 + env: TOXENV=flake8 + - language: python + python: 2.7 + env: TOXENV=py27-sqlite + services: + - redis-server + - language: python + python: 2.7 + env: TOXENV=py27-mysql + services: + - mysql + - redis-server + before_script: + - mysql -u root -e "DROP DATABASE IF EXISTS superset; CREATE DATABASE superset DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci" + - mysql -u root -e "CREATE USER 'mysqluser'@'localhost' IDENTIFIED BY 'mysqluserpassword';" + - mysql -u root -e "GRANT ALL ON superset.* TO 'mysqluser'@'localhost';" + - language: python + python: 2.7 + env: TOXENV=pylint + - language: node_js + node_js: 8.9 + cache: + yarn: true + before_install: + - cd superset/assets + install: + - yarn install --frozen-lockfile + script: + - npm run lint + - npm run cover + - language: python + python: 3.6 + env: TOXENV=flake8 + - language: python + python: 3.6 + env: TOXENV=py36-sqlite + services: + - redis-server + - language: python + python: 3.6 + env: TOXENV=py36-postgres + services: + - postgres + - redis-server + before_script: + - psql -U postgres -c "CREATE DATABASE superset;" + - psql -U postgres -c "CREATE USER postgresuser WITH PASSWORD 'pguserpassword';" + - language: python + python: 3.6 + env: TOXENV=pylint install: - pip install --upgrade pip - pip install codecov tox diff --git a/superset/assets/cypress_build.sh b/superset/assets/cypress_build.sh index 950e01a95..26b0a088d 100755 --- a/superset/assets/cypress_build.sh +++ b/superset/assets/cypress_build.sh @@ -9,8 +9,7 @@ superset/bin/superset runserver & cd "$(dirname "$0")" -npm install -g yarn -yarn +yarn install --frozen-lockfile npm run build -npm run cypress run --record +npm run cypress run kill %1