From 082518c69860ea59460c7809afcfa7925898971a Mon Sep 17 00:00:00 2001 From: denys-codefresh <41425204+denys-codefresh@users.noreply.github.com> Date: Wed, 8 Aug 2018 14:33:41 +0300 Subject: [PATCH 01/18] Update docker-compose.yml --- docker-compose.yml | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 09e6781..6026b31 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,12 +1,9 @@ - -#this is an example of a self-hosted chat app. -#the composition uses just mongo as a database and an image that was built from a demo application https://github.com/containers101/demochat - version: '2' services: - demochat: - build: . - ports: - - 5000 - mongo: - image: mongo + elasticsearch: + image: 'elasticsearch:5.1-alpine' + datasets: + image: 'circleci/postgres:9.6-alpine' + command: ls -la /amir + volumes: + - '/var/lib/docker/volumes/${{CF_VOLUME}}/_data/${{CF_REPO_NAME}}/extras/emotes/:/amir' From 6ad5292d3882c254de867c05cb709ea90f655c4d Mon Sep 17 00:00:00 2001 From: denys-codefresh <41425204+denys-codefresh@users.noreply.github.com> Date: Fri, 7 Sep 2018 14:57:36 +0300 Subject: [PATCH 02/18] Update docker-compose.yml --- docker-compose.yml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 6026b31..c0d0dc9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,9 +1,11 @@ +#this is an example of a self-hosted chat app. +#the composition uses just mongo as a database and an image that was built from a demo application https://github.com/containers101/demochat + version: '2' services: - elasticsearch: - image: 'elasticsearch:5.1-alpine' - datasets: - image: 'circleci/postgres:9.6-alpine' - command: ls -la /amir - volumes: - - '/var/lib/docker/volumes/${{CF_VOLUME}}/_data/${{CF_REPO_NAME}}/extras/emotes/:/amir' + demochat: + build: . + ports: + - 5000 + mongo: + image: mongo From eb33ab836cca79fb20b80e715995cb342467d92d Mon Sep 17 00:00:00 2001 From: denys Date: Fri, 7 Sep 2018 15:43:56 +0300 Subject: [PATCH 03/18] generate allure report --- gulpfile.js | 6 +++--- package.json | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index d441313..2bda193 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -15,10 +15,10 @@ gulp.task('pre-test', function () { gulp.task('test', ['pre-test'], function () { console.log('test task') return gulp.src(['app/tests/*.js']) - .pipe(debug({title: 'unicorn:'})) - .pipe(mocha({timeout:10000})) + // .pipe(debug({title: 'unicorn:'})) + .pipe(mocha({ timeout:10000, reporter: 'mocha-allure-reporter' })) // Creating the reports after tests ran - .pipe(istanbul.writeReports()) + // .pipe(istanbul.writeReports()) // Enforce a coverage of at least 90% //.pipe(istanbul.enforceThresholds({ thresholds: { global: 20} })); }); diff --git a/package.json b/package.json index 64296ce..3b985f8 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "stop": "pkill --signal SIGINT letschat", "prestart": "migroose", "migrate": "migroose", - "test": "mocha ./app/tests" + "test": "gulp test" }, "engine": { "node": "0.10.x", @@ -80,6 +80,7 @@ "md5": "^2.0.0", "migroose": "^0.5.0", "migroose-cli": "^0.1.0", + "mocha-allure-reporter": "^1.4.0", "moment": "^2.10.6", "mongoose": "~4.1.8", "mongoose-unique-validator": "~0.4.1", From 3e582afd7ef27915d539338c6bb07bc5a0c0e4b5 Mon Sep 17 00:00:00 2001 From: denys Date: Fri, 7 Sep 2018 15:55:36 +0300 Subject: [PATCH 04/18] remove istanbul --- Dockerfile | 4 ++-- gulpfile.js | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index e312007..4a3b5d2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ -FROM node:0.10-slim +FROM node:9.6.1-alpine RUN npm install -g mocha -RUN npm install -g istanbul +#RUN npm install -g istanbul RUN npm install -g gulp COPY ./package.json /src/package.json diff --git a/gulpfile.js b/gulpfile.js index 2bda193..9868162 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,18 +1,18 @@ var gulp = require('gulp'); -var istanbul = require('gulp-istanbul'); +// var istanbul = require('gulp-istanbul'); // We'll use mocha in this example, but any test framework will work var mocha = require('gulp-mocha'); var debug = require('gulp-debug'); -gulp.task('pre-test', function () { - return gulp.src(['app/**/*.js','!app/tests/**/*.spec.js']) +/*gulp.task('pre-test', function () { + return gulp.src(['app/!**!/!*.js','!app/tests/!**!/!*.spec.js']) // Covering files .pipe(istanbul()) // Force `require` to return covered files .pipe(istanbul.hookRequire()); -}); +});*/ -gulp.task('test', ['pre-test'], function () { +gulp.task('test', function () { console.log('test task') return gulp.src(['app/tests/*.js']) // .pipe(debug({title: 'unicorn:'})) From 3f62f136e9a5a754879a8dc054299422a55b02e8 Mon Sep 17 00:00:00 2001 From: denys-codefresh <41425204+denys-codefresh@users.noreply.github.com> Date: Tue, 11 Sep 2018 14:58:48 +0300 Subject: [PATCH 05/18] Update Dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 4a3b5d2..9a0197a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM node:9.6.1-alpine RUN npm install -g mocha -#RUN npm install -g istanbul +RUN npm install -g istanbul RUN npm install -g gulp COPY ./package.json /src/package.json From 05dd8e21b6ddd75adb3ad0301114a51800eede51 Mon Sep 17 00:00:00 2001 From: denys-codefresh <41425204+denys-codefresh@users.noreply.github.com> Date: Tue, 11 Sep 2018 15:09:33 +0300 Subject: [PATCH 06/18] Update Dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 9a0197a..4a3b5d2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM node:9.6.1-alpine RUN npm install -g mocha -RUN npm install -g istanbul +#RUN npm install -g istanbul RUN npm install -g gulp COPY ./package.json /src/package.json From 6a6ad711749cc522389d284d60e27b9612fc9045 Mon Sep 17 00:00:00 2001 From: denys-codefresh <41425204+denys-codefresh@users.noreply.github.com> Date: Wed, 12 Sep 2018 13:28:49 +0300 Subject: [PATCH 07/18] Update Dockerfile --- Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 4a3b5d2..c111963 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,6 @@ FROM node:9.6.1-alpine RUN npm install -g mocha -#RUN npm install -g istanbul RUN npm install -g gulp COPY ./package.json /src/package.json From 1d2f0563cbaff700080f3f6f41670b3a07cca7f3 Mon Sep 17 00:00:00 2001 From: denys-codefresh <41425204+denys-codefresh@users.noreply.github.com> Date: Fri, 14 Sep 2018 11:11:28 +0300 Subject: [PATCH 08/18] Update Dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index c111963..9612f95 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ FROM node:9.6.1-alpine - +MAINTAINER test@.com RUN npm install -g mocha RUN npm install -g gulp From 7c9c586e89950db6ef64eb892ec99f829ee367b0 Mon Sep 17 00:00:00 2001 From: denys-codefresh <41425204+denys-codefresh@users.noreply.github.com> Date: Mon, 17 Sep 2018 11:14:49 +0300 Subject: [PATCH 09/18] Update Dockerfile --- Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 9612f95..f6c0e84 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,5 +10,4 @@ COPY ./ /src WORKDIR /src #ENV DEBUG=* - CMD ["npm", "start"] From 242e0181710c2c64697cf48c1209906c233ee798 Mon Sep 17 00:00:00 2001 From: denys-codefresh <41425204+denys-codefresh@users.noreply.github.com> Date: Wed, 26 Sep 2018 16:38:01 +0300 Subject: [PATCH 10/18] Update Dockerfile --- Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index f6c0e84..d60ce21 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,6 +8,5 @@ RUN cd /src && npm install COPY ./ /src WORKDIR /src -#ENV DEBUG=* CMD ["npm", "start"] From b87f31e9491ddc6e03115ad3169c362184ad3556 Mon Sep 17 00:00:00 2001 From: denys Date: Tue, 2 Oct 2018 09:57:24 +0300 Subject: [PATCH 11/18] add custom reporter --- gulpfile.js | 2 +- package.json | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/gulpfile.js b/gulpfile.js index 9868162..4635ce8 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -16,7 +16,7 @@ gulp.task('test', function () { console.log('test task') return gulp.src(['app/tests/*.js']) // .pipe(debug({title: 'unicorn:'})) - .pipe(mocha({ timeout:10000, reporter: 'mocha-allure-reporter' })) + .pipe(mocha({ timeout:10000, reporter: 'mochawesome' })) // Creating the reports after tests ran // .pipe(istanbul.writeReports()) // Enforce a coverage of at least 90% diff --git a/package.json b/package.json index 3b985f8..73af933 100644 --- a/package.json +++ b/package.json @@ -110,6 +110,7 @@ "gulp-mocha": "^2.2.0", "istanbul": "^0.4.2", "mocha": "^2.3.4", + "mochawesome": "^3.0.3", "shortid": "^2.2.4" } } From 2c737bb95bff3337c8be3e2c613b1c19bd44af78 Mon Sep 17 00:00:00 2001 From: denys Date: Tue, 2 Oct 2018 10:06:52 +0300 Subject: [PATCH 12/18] return allure --- gulpfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gulpfile.js b/gulpfile.js index 4635ce8..ef52e12 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -16,7 +16,7 @@ gulp.task('test', function () { console.log('test task') return gulp.src(['app/tests/*.js']) // .pipe(debug({title: 'unicorn:'})) - .pipe(mocha({ timeout:10000, reporter: 'mochawesome' })) + .pipe(mocha({ timeout:10000, reporter: 'mocha-allure-reporter' })) // mocha-allure-reporter , mochawesome // Creating the reports after tests ran // .pipe(istanbul.writeReports()) // Enforce a coverage of at least 90% From 75b0ef07e504baf15e6dedd1e4fcb6fd9d497eb2 Mon Sep 17 00:00:00 2001 From: denys Date: Tue, 2 Oct 2018 10:12:57 +0300 Subject: [PATCH 13/18] add awesome reporter --- gulpfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gulpfile.js b/gulpfile.js index ef52e12..8c9a1d6 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -16,7 +16,7 @@ gulp.task('test', function () { console.log('test task') return gulp.src(['app/tests/*.js']) // .pipe(debug({title: 'unicorn:'})) - .pipe(mocha({ timeout:10000, reporter: 'mocha-allure-reporter' })) // mocha-allure-reporter , mochawesome + .pipe(mocha({ timeout:10000, reporter: 'mochawesome' })) // mocha-allure-reporter , mochawesome // Creating the reports after tests ran // .pipe(istanbul.writeReports()) // Enforce a coverage of at least 90% From ab303b460b1cd4afb99df12bfe4adc404c49a620 Mon Sep 17 00:00:00 2001 From: denys Date: Tue, 2 Oct 2018 11:08:37 +0300 Subject: [PATCH 14/18] remove global mocha --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index d60ce21..fefbbae 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM node:9.6.1-alpine MAINTAINER test@.com -RUN npm install -g mocha +#RUN npm install -g mocha RUN npm install -g gulp COPY ./package.json /src/package.json From fb676fabe916cd9365cbb3a7e28a725c54ba5a89 Mon Sep 17 00:00:00 2001 From: denys Date: Tue, 2 Oct 2018 11:13:49 +0300 Subject: [PATCH 15/18] try to fix npm bug --- Dockerfile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index fefbbae..c056b28 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,7 @@ -FROM node:9.6.1-alpine -MAINTAINER test@.com -#RUN npm install -g mocha +FROM node:10.3.0-alpine + +RUN npm config set unsafe-perm true +RUN npm install -g mocha RUN npm install -g gulp COPY ./package.json /src/package.json From 21b76225eb090f9ab9d3a8cb7c62c0124f855eec Mon Sep 17 00:00:00 2001 From: denys Date: Mon, 29 Oct 2018 11:37:54 +0200 Subject: [PATCH 16/18] aluure reporter --- gulpfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gulpfile.js b/gulpfile.js index 8c9a1d6..ef52e12 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -16,7 +16,7 @@ gulp.task('test', function () { console.log('test task') return gulp.src(['app/tests/*.js']) // .pipe(debug({title: 'unicorn:'})) - .pipe(mocha({ timeout:10000, reporter: 'mochawesome' })) // mocha-allure-reporter , mochawesome + .pipe(mocha({ timeout:10000, reporter: 'mocha-allure-reporter' })) // mocha-allure-reporter , mochawesome // Creating the reports after tests ran // .pipe(istanbul.writeReports()) // Enforce a coverage of at least 90% From ab5a1a4b720fb7a1811720956dd382fc3866217f Mon Sep 17 00:00:00 2001 From: denys Date: Wed, 2 Jan 2019 10:54:45 +0200 Subject: [PATCH 17/18] add test --- app/tests/test.spec.js | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 app/tests/test.spec.js diff --git a/app/tests/test.spec.js b/app/tests/test.spec.js new file mode 100644 index 0000000..9fde97e --- /dev/null +++ b/app/tests/test.spec.js @@ -0,0 +1,5 @@ +describe('test', function(){ + it('test ', (done) => { + done() + }); +}) From 8c0c2a77f19e4665d95c65cae7d2efc3a1ad6c9b Mon Sep 17 00:00:00 2001 From: denys Date: Mon, 29 Jul 2019 16:25:33 +0300 Subject: [PATCH 18/18] add test --- app/tests/room.unit.spec.js | 3 +++ coverage/index.html | 10 ++++++++++ package.json | 1 + 3 files changed, 14 insertions(+) create mode 100644 coverage/index.html diff --git a/app/tests/room.unit.spec.js b/app/tests/room.unit.spec.js index 580434e..bccd9fd 100644 --- a/app/tests/room.unit.spec.js +++ b/app/tests/room.unit.spec.js @@ -2,4 +2,7 @@ describe('entity tests', function(){ it('create user', function(done){ done(); }) + it('should ', (done) => { + done() + }); }) diff --git a/coverage/index.html b/coverage/index.html new file mode 100644 index 0000000..3b4c6b2 --- /dev/null +++ b/coverage/index.html @@ -0,0 +1,10 @@ + + + + + Title + + +

Report

+ + \ No newline at end of file diff --git a/package.json b/package.json index 73af933..ff367b3 100644 --- a/package.json +++ b/package.json @@ -90,6 +90,7 @@ "node-xmpp-server": "2.1.0", "node_hash": "^0.2.0", "nunjucks": "^1.3.4", + "nyc": "^13.1.0", "on-finished": "^2.3.0", "passport": "0.2.2", "passport-http": "0.2.2",