From e901d77b349d712692b3cdd85bc032eb0e24ecea Mon Sep 17 00:00:00 2001 From: Arturs Sosins Date: Mon, 16 Jan 2023 21:19:28 +0200 Subject: [PATCH 1/5] [tests] do not enable all plugins --- .github/workflows/main.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index aa62fd4c609..b3ad754b652 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -44,10 +44,6 @@ jobs: shell: bash run: mongo --version - - name: Enable all plugins - shell: bash - run: sudo bash ./bin/scripts/countly.enable.all.plugins.sh - - name: Reinstall plugins shell: bash run: sudo bash ./bin/scripts/countly.install.plugins.sh From 6b4a181f891658d392a8eea6725786eb48232d09 Mon Sep 17 00:00:00 2001 From: Arturs Sosins Date: Mon, 16 Jan 2023 21:24:49 +0200 Subject: [PATCH 2/5] [tests] wait for Countly --- .github/workflows/main.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b3ad754b652..ce507d3598e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -44,6 +44,10 @@ jobs: shell: bash run: mongo --version + - name: Wait for Countly + shell: bash + run: until nc -z 127.0.0.1 3001; do echo Waiting for Countly; sleep 1; done + - name: Reinstall plugins shell: bash run: sudo bash ./bin/scripts/countly.install.plugins.sh From 1f5c3bd1607492a9f25cf7c469db84af68cecf42 Mon Sep 17 00:00:00 2001 From: Arturs Sosins Date: Mon, 16 Jan 2023 22:22:11 +0200 Subject: [PATCH 3/5] [tests] wait for countly after restart --- .github/workflows/main.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ce507d3598e..dde01f05e71 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -44,10 +44,6 @@ jobs: shell: bash run: mongo --version - - name: Wait for Countly - shell: bash - run: until nc -z 127.0.0.1 3001; do echo Waiting for Countly; sleep 1; done - - name: Reinstall plugins shell: bash run: sudo bash ./bin/scripts/countly.install.plugins.sh @@ -64,6 +60,10 @@ jobs: shell: bash run: sudo countly task dist-all + - name: Wait for Countly + shell: bash + run: until nc -z 127.0.0.1 3001; do echo Waiting for Countly; sleep 1; done + - name: Tests shell: bash run: sudo countly test From c05f4c58eafaf55e19e103785d1649c06381becf Mon Sep 17 00:00:00 2001 From: Arturs Sosins Date: Mon, 16 Jan 2023 22:39:48 +0200 Subject: [PATCH 4/5] [tests] wait after restart --- .github/workflows/main.yml | 8 -------- bin/commands/scripts/countly.run.tests.sh | 2 ++ 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index dde01f05e71..7f54991fa72 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -44,10 +44,6 @@ jobs: shell: bash run: mongo --version - - name: Reinstall plugins - shell: bash - run: sudo bash ./bin/scripts/countly.install.plugins.sh - - name: ShellCheck shell: bash run: countly shellcheck @@ -60,10 +56,6 @@ jobs: shell: bash run: sudo countly task dist-all - - name: Wait for Countly - shell: bash - run: until nc -z 127.0.0.1 3001; do echo Waiting for Countly; sleep 1; done - - name: Tests shell: bash run: sudo countly test diff --git a/bin/commands/scripts/countly.run.tests.sh b/bin/commands/scripts/countly.run.tests.sh index 65b39c5804e..fa8df86443e 100644 --- a/bin/commands/scripts/countly.run.tests.sh +++ b/bin/commands/scripts/countly.run.tests.sh @@ -8,6 +8,8 @@ countly config "drill.record_meta" "true" countly restart +until nc -z 127.0.0.1 3001; do echo Waiting for Countly; sleep 1; done + #install test dependencies ( cd "$DIR/../../../" ; sudo npm install --unsafe-perm ) #run tests From 14d8d57acee22ecf1ad2d28546ff5c7ff9c0f2b9 Mon Sep 17 00:00:00 2001 From: Arturs Sosins Date: Tue, 17 Jan 2023 10:17:11 +0200 Subject: [PATCH 5/5] [tests] clear reports test --- plugins/reports/tests.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/plugins/reports/tests.js b/plugins/reports/tests.js index d216604f571..a09f94c23ab 100644 --- a/plugins/reports/tests.js +++ b/plugins/reports/tests.js @@ -164,6 +164,22 @@ describe('Testing Reports', function() { }); }); + describe('reset app', function() { + it('should reset data', function(done) { + var params = {app_id: testUtils.get("APP_ID"), "period": "reset"}; + request + .get(getRequestURL('/i/apps/reset') + "&args=" + JSON.stringify(params)) + .expect(200) + .end(function(err, res) { + if (err) { + return done(err); + } + var ob = JSON.parse(res.text); + ob.should.have.property('result', 'Success'); + setTimeout(done, 500 * testUtils.testScalingFactor); + }); + }); + }); }); });