From 333da52de6581069a7962bb386fe200d3104525e Mon Sep 17 00:00:00 2001 From: Gasol Wu Date: Mon, 13 May 2019 22:35:40 +0800 Subject: [PATCH] Test on modern node runtimes 1. Increase timeout when run tests with coverage report to resolve following issues. https://travis-ci.org/Gasol/aglio/jobs/531855660 1) Executable Should start a live preview server: Error: Timeout of 5000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/home/travis/build/Gasol/aglio/test/basic.coffee) at Timeout._onTimeout (test/basic.coffee:306:37) at listOnTimeout (internal/timers.js:531:17) at processTimers (internal/timers.js:475:7) 2. Keep the npm cache https://docs.travis-ci.com/user/caching/#npm-cache --- .travis.yml | 23 ++++++++++++++--------- package.json | 5 ++++- test/basic.coffee | 2 +- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index b85fca79..dec77384 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,12 +1,12 @@ +dist: xenial language: node_js -sudo: false node_js: - - "0.10" - - "0.12" - - "3" - - "4" - - "5" - - "6" + - "6" + - "8" + - "10" + - "11" + - "12" + addons: apt: sources: @@ -14,6 +14,11 @@ addons: packages: - gcc-4.8 - g++-4.8 -env: CXX="g++-4.8" CC="gcc-4.8" + +env: + - CXX="g++-4.8" CC="gcc-4.8" + after_script: - - npm run coveralls + - if [ "$TRAVIS_NODE_VERSION" = "12" ]; then npm run coveralls; fi + +cache: npm diff --git a/package.json b/package.json index 21860f0f..87cbb8a4 100644 --- a/package.json +++ b/package.json @@ -6,11 +6,14 @@ "bin": { "aglio": "./bin/aglio.js" }, + "config": { + "coverage_timeout": 10000 + }, "scripts": { "build": "npm run lint && npm run compile", "compile": "coffee -o lib -c src", "coverage": "npm run coverage:html", - "coverage:text": "npm run build && c8 mocha", + "coverage:text": "npm run build && c8 mocha -t $npm_package_config_coverage_timeout", "coverage:html": "npm run coverage:text && c8 -r html report", "coveralls": "npm run coverage:text && c8 -r text-lcov report | coveralls", "gen:examples": "npm run compile && ./scripts/generate-examples", diff --git a/test/basic.coffee b/test/basic.coffee index 8805abd2..ef268c9d 100644 --- a/test/basic.coffee +++ b/test/basic.coffee @@ -271,7 +271,7 @@ describe 'Executable', -> done() it 'Should start a live preview server', (done) -> - @timeout 5000 + @timeout process.env.npm_package_config_coverage_timeout || 5000 sinon .stub aglio, 'render'