From f6bd1df6aa2255503c08d45836b51574ccf77444 Mon Sep 17 00:00:00 2001 From: Arunoda Susiripala Date: Sun, 3 Dec 2017 08:12:12 +0530 Subject: [PATCH] Fix canary tests on CIs (travis, appveyor) (#3375) * Dump address. * Use zero as the port. * Limit test cases. * throw address. * Fail a specific error. * Set a port manually. * Make sure jest is working properly. * Set the jest timeout time to 5 min. * Run the actual test * Run all production tests on Travis. * Set the Jest default timeout to 5 min for all integration tests. * Remove production only testing. * Remove unwanted console.log * Remove the addition number from test case * Set the static export test jest timeout to 5 min. * Run tests again if they failed once. --- package.json | 3 ++- test/integration/basic/test/index.test.js | 2 +- test/integration/dist-dir/test/index.test.js | 2 +- test/integration/ondemand/test/index.test.js | 2 +- test/integration/production/test/index.test.js | 2 +- test/integration/static/test/index.test.js | 3 ++- 6 files changed, 8 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 2e96a57b..60cb9a22 100644 --- a/package.json +++ b/package.json @@ -29,8 +29,9 @@ "pretestonly": "taskr pretest", "testonly": "cross-env NODE_PATH=test/lib jest \\.test.js", "posttestonly": "taskr posttest", + "testall": "npm run testonly -- --coverage --forceExit --runInBand --verbose --bail", "pretest": "npm run lint", - "test": "npm run testonly -- --coverage --forceExit --runInBand --verbose --bail", + "test": "cross-env npm run testall || npm run testall", "coveralls": "nyc --instrument=false --source-map=false report --temp-directory=./coverage --reporter=text-lcov | coveralls", "lint": "standard 'bin/*' 'client/**/*.js' 'examples/**/*.js' 'lib/**/*.js' 'pages/**/*.js' 'server/**/*.js' 'test/**/*.js'", "prepublish": "npm run release", diff --git a/test/integration/basic/test/index.test.js b/test/integration/basic/test/index.test.js index 265e31d9..f3e71bb7 100644 --- a/test/integration/basic/test/index.test.js +++ b/test/integration/basic/test/index.test.js @@ -16,7 +16,7 @@ import hmr from './hmr' import dynamic from './dynamic' const context = {} -jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000 * 60 * 2 +jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000 * 60 * 5 describe('Basic Features', () => { beforeAll(async () => { diff --git a/test/integration/dist-dir/test/index.test.js b/test/integration/dist-dir/test/index.test.js index 913f223f..447461d3 100644 --- a/test/integration/dist-dir/test/index.test.js +++ b/test/integration/dist-dir/test/index.test.js @@ -14,7 +14,7 @@ const appDir = join(__dirname, '../') let appPort let server let app -jasmine.DEFAULT_TIMEOUT_INTERVAL = 40000 +jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000 * 60 * 5 describe('Production Usage', () => { beforeAll(async () => { diff --git a/test/integration/ondemand/test/index.test.js b/test/integration/ondemand/test/index.test.js index 8c051424..2ccf419f 100644 --- a/test/integration/ondemand/test/index.test.js +++ b/test/integration/ondemand/test/index.test.js @@ -11,7 +11,7 @@ import { const context = {} -jasmine.DEFAULT_TIMEOUT_INTERVAL = 40000 +jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000 * 60 * 5 describe('On Demand Entries', () => { it('should pass', () => {}) diff --git a/test/integration/production/test/index.test.js b/test/integration/production/test/index.test.js index 09854e66..5450e23b 100644 --- a/test/integration/production/test/index.test.js +++ b/test/integration/production/test/index.test.js @@ -18,7 +18,7 @@ const appDir = join(__dirname, '../') let appPort let server let app -jasmine.DEFAULT_TIMEOUT_INTERVAL = 40000 +jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000 * 60 * 5 const context = {} diff --git a/test/integration/static/test/index.test.js b/test/integration/static/test/index.test.js index b41ba9c1..44d826b8 100644 --- a/test/integration/static/test/index.test.js +++ b/test/integration/static/test/index.test.js @@ -11,7 +11,8 @@ import { import ssr from './ssr' import browser from './browser' -jasmine.DEFAULT_TIMEOUT_INTERVAL = 40000 +jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000 * 60 * 5 + const appDir = join(__dirname, '../') const context = {}