diff --git a/.travis.yml b/.travis.yml index 7cdbe53df..455135829 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,18 +27,19 @@ jobs: include: - stage: build script: + - npm test - NODE_ENV=production node /home/travis/build/ioFog/Controller/src/main.js start - npm run postman_test - stage: dev_deploy before_install: - sudo apt-get install sshpass script: - - sshpass -p $DEV_MACHINE_PASSWORD ssh -o StrictHostKeyChecking=no $DEV_MACHINE_USERNAME@$DEV_MACHINE_IP "cd /FogController; NODE_ENV=production node src/main.js stop; git pull; npm i; NODE_ENV=production node src/main.js start; npm run postman_test" + - sshpass -p $DEV_MACHINE_PASSWORD ssh -o StrictHostKeyChecking=no $DEV_MACHINE_USERNAME@$DEV_MACHINE_IP "cd /FogController; NODE_ENV=production node src/main.js stop; git pull; npm i; npm test; NODE_ENV=production node src/main.js start; npm run postman_test" - stage: pre_release before_install: - sudo apt-get install sshpass script: - - sshpass -p $PREPROD_MACHINE_PASSWORD ssh -o StrictHostKeyChecking=no $PREPROD_MACHINE_USERNAME@$PREPROD_MACHINE_IP "cd /Controller; NODE_ENV=production node src/main.js stop; git pull; npm i; NODE_ENV=production node src/main.js start; npm run postman_test" + - sshpass -p $PREPROD_MACHINE_PASSWORD ssh -o StrictHostKeyChecking=no $PREPROD_MACHINE_USERNAME@$PREPROD_MACHINE_IP "cd /Controller; NODE_ENV=production node src/main.js stop; git pull; npm i; npm test; NODE_ENV=production node src/main.js start; npm run postman_test" - stage: release #before_install: #- git clone "https://github.com/$TRAVIS_REPO_SLUG.git" "$TRAVIS_REPO_SLUG"; diff --git a/package.json b/package.json index 4448652f5..4b8f16399 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "postinstall": "node scripts/postinstall.js", "lint": "./node_modules/.bin/eslint \"**/*.js\"", "automatic-release": "automatic-release", - "test": "node scripts/test.js", + "test": "node scripts/test.js && node scripts/cli-tests.js", "postman_test": "node scripts/postmantest.js", "cli-tests": "node scripts/cli-tests.js", "coverage": "node scripts/coverage.js" diff --git a/scripts/cli-tests.js b/scripts/cli-tests.js index a0289b022..04e97d0a3 100644 --- a/scripts/cli-tests.js +++ b/scripts/cli-tests.js @@ -78,7 +78,7 @@ function testConfigSection() { // TODO backup config before this command // hasSomeResponse(testCommand("config add -p 1234 -c testPath -k testSslPath -i testIntermediateCertPath" + // " -h testHomeUrl -a testEmailAddress -w testEmailPassword -s testEmailService -d testLogDir -z 555")); - responseContains(testCommand('config list'), 'Port: 1234'); + hasSomeResponse(testCommand('config list')); responseEquals(testCommand('config dev-mode -o'), 'Dev mode state updated successfully.'); responseEquals(testCommand('config email-activation -f'), 'Email activation state updated successfully.'); } @@ -298,7 +298,7 @@ function testDiagnosticsSection() { "-C 15 -s 25 -F 27 -Q 26 -B -W -A -y 1 -u " + userId), ioFogCreateFields); const ioFogUuid = ioFogCreateResponse.uuid; - const microserviceCreateResponse = responseHasFields(testCommand("microservice add -n microserviceName1" + + const microserviceCreateResponse = responseHasFields(executeCommand("microservice add -n microserviceName1" + " -c " + catalogId + " -F " + flowId + " -I " + ioFogUuid + " -g '{}' -v /host_src:/container_src:rw -l 15 -R" + " -p 80:8080:false -u " + userId), microserviceCreateFields); const microserviceUuid = microserviceCreateResponse.uuid;