From 25d8e06c1d261cf07969ee0cd39f29af1033f55d Mon Sep 17 00:00:00 2001 From: Carlos Jimenez Ruiz Date: Wed, 13 Feb 2019 10:00:56 +0100 Subject: [PATCH] updated backend unit test gulp tasks --- gulpfile.js | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index d69dd5d0de..b6427cdd1b 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -74,7 +74,7 @@ defaultTask.description = `Starts all application services`; // Backend tests -async function backTestOnly() { +async function backTestOnce() { let bootOptions; if (argv['random']) @@ -107,11 +107,19 @@ async function backTestOnly() { await app.disconnect(); } -backTestOnly.description = `Runs the backend tests only, can receive --junit arg to save reports on a xml file`; +backTestOnce.description = `Runs the backend tests once, can receive --junit arg to save reports on a xml file`; + +async function backTestDockerOnce() { + let containerId = await docker(); + await backTestOnce(); + if (argv['random']) + await execP(`docker rm -fv ${containerId}`); +} +backTestDockerOnce.description = `Runs backend tests using in site container once`; async function backTestDocker() { let containerId = await docker(); - await backTestOnly(); + await backTest(); if (argv['random']) await execP(`docker rm -fv ${containerId}`); } @@ -122,7 +130,7 @@ function backTest(done) { nodemon({ exec: ['node ./node_modules/gulp/bin/gulp.js'], - args: ['backTestOnly'], + args: ['backTestOnce'], watch: backSources, done: done }); @@ -484,8 +492,9 @@ module.exports = { back, backOnly, backWatch, + backTestOnce, + backTestDockerOnce, backTest, - backTestOnly, backTestDocker, e2e, e2eOnly,