From 3f9b5fc59f7b54b6b80c5e473f17b317e39feaa6 Mon Sep 17 00:00:00 2001 From: Umed Khudoiberdiev Date: Wed, 13 Sep 2017 21:47:11 +0500 Subject: [PATCH] added delay for ci tests --- gulpfile.ts | 33 ++++++++++++++++++++++++++++++--- package.json | 2 +- 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/gulpfile.ts b/gulpfile.ts index 0dde2e26e..d556661dc 100644 --- a/gulpfile.ts +++ b/gulpfile.ts @@ -19,7 +19,7 @@ const sourcemaps = require("gulp-sourcemaps"); const istanbul = require("gulp-istanbul"); const remapIstanbul = require("remap-istanbul/lib/gulpRemapIstanbul"); const ts = require("gulp-typescript"); -const args = require('yargs').argv; +const args = require("yargs").argv; @Gulpclass() export class Gulpfile { @@ -28,6 +28,14 @@ export class Gulpfile { // General tasks // ------------------------------------------------------------------------- + /** + * Creates a delay and resolves after 10 seconds. + */ + @Task() + wait(cb: Function) { + setTimeout(() => cb(), 10000); + } + /** * Cleans build folder. */ @@ -144,7 +152,7 @@ export class Gulpfile { return del([ "./build/systemjs/**", "./build/browser/**" - ]) + ]); } // ------------------------------------------------------------------------- @@ -361,7 +369,26 @@ export class Gulpfile { */ @SequenceTask() tests() { - return ["compile", "tslint", "coveragePost", "coverageRemap"]; + return [ + "compile", + "tslint", + "coveragePost", + "coverageRemap" + ]; + } + + /** + * Runs tests, but creates a small delay before running them to make sure to give time for docker containers to be initialized. + */ + @SequenceTask("ci-tests") + ciTests() { + return [ + "wait", + "compile", + "tslint", + "coveragePost", + "coverageRemap" + ]; } /** diff --git a/package.json b/package.json index 47df136af..70ed154ce 100644 --- a/package.json +++ b/package.json @@ -88,7 +88,7 @@ "yargs": "^8.0.2" }, "scripts": { - "test": "gulp tests", + "test": "gulp ci-tests", "compile": "tsc", "setup:config": "gulp createTravisOrmConfig", "package": "gulp package"