From b59ed8323950a7f38fe90ee8358a4005291d780f Mon Sep 17 00:00:00 2001 From: Pedro Domingues Date: Tue, 30 Jul 2024 10:39:55 -0300 Subject: [PATCH 1/2] =?UTF-8?q?feat(karma):=20modifica=20configura=C3=A7?= =?UTF-8?q?=C3=B5es=20para=20os=20testes=20em=20CI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 8 ++++---- projects/code-editor/karma.conf.js | 11 +++++++---- projects/portal/karma.conf.js | 12 ++++++++---- projects/storage/karma.conf.js | 11 +++++++---- projects/sync/karma.conf.js | 11 +++++++---- projects/templates/karma.conf.js | 11 +++++++---- projects/ui/karma.conf.js | 10 ++++++---- 7 files changed, 46 insertions(+), 28 deletions(-) diff --git a/package.json b/package.json index 3563a501a..806df1f12 100644 --- a/package.json +++ b/package.json @@ -25,16 +25,16 @@ "test:storage:schematics": "gulp build:schematics --lib storage && jasmine \"dist/ng-storage/schematics/**/*.spec.js\"", "test:sync": "ng test sync --watch=false --code-coverage --browsers=ChromeHeadless --source-map", "test:sync:schematics": "gulp build:schematics --lib sync && jasmine \"dist/ng-sync/schematics/**/*.spec.js\"", - "test:sync:browse": "ng test sync --code-coverage --browsers=Chrome --source-map", + "test:sync:browse": "ng test sync --code-coverage --browsers=Chrome --source-map --watch=false", "test:ui": "ng test ui --watch=false --code-coverage --browsers=ChromeHeadless --source-map", "test:ui:schematics": "gulp build:schematics --lib ui && jasmine \"./dist/ng-components/schematics/**/*.spec.js\"", - "test:ui:browse": "ng test ui --code-coverage --browsers=Chrome --source-map", + "test:ui:browse": "ng test ui --code-coverage --browsers=Chrome --source-map --watch=false", "test:templates": "ng test templates --watch=false --code-coverage --browsers=ChromeHeadless --source-map", "test:templates:schematics": "gulp build:schematics --lib templates && jasmine \"dist/ng-templates/schematics/**/*.spec.js\"", - "test:templates:browse": "ng test templates --code-coverage --browsers=Chrome --source-map", + "test:templates:browse": "ng test templates --code-coverage --browsers=Chrome --source-map --watch=false", "test:code-editor": "ng test code-editor --watch=false --code-coverage --browsers=ChromeHeadless --source-map", "test:code-editor:schematics": "gulp build:schematics --lib code-editor && jasmine \"dist/ng-code-editor/schematics/**/*.spec.js\"", - "test:code-editor:browse": "ng test code-editor --code-coverage --browsers=Chrome --source-map", + "test:code-editor:browse": "ng test code-editor --code-coverage --browsers=Chrome --source-map --watch=false", "test:dev": "ng test --browsers=ChromeHeadless", "build:schematics": "cd ./projects/schematics && npm run build", "build:ui": "ng build ui --configuration production && gulp build:schematics --lib ui && gulp replaceVersion && cd dist/ng-components && npm pack", diff --git a/projects/code-editor/karma.conf.js b/projects/code-editor/karma.conf.js index ca4390247..425683259 100644 --- a/projects/code-editor/karma.conf.js +++ b/projects/code-editor/karma.conf.js @@ -43,8 +43,8 @@ module.exports = function (config) { reporters: ['progress', 'kjhtml'], port: 9876, colors: true, - logLevel: config.LOG_INFO, - autoWatch: true, + logLevel: config.LOG_DEBUG, + autoWatch: false, browsers: ['ChromeHeadless'], customLaunchers: { ChromeHeadless: { @@ -52,8 +52,11 @@ module.exports = function (config) { flags: ['--no-sandbox', '--headless', '--disable-gpu', '--disable-web-security', '--remote-debugging-port=9222'] } }, - singleRun: false, + singleRun: true, restartOnFileChange: true, - browserNoActivityTimeout: 30000 + browserNoActivityTimeout: 30000, + browserDisconnectTimeout: 30000, + captureTimeout: 30000, + browserDisconnectTolerance: 3 }); }; diff --git a/projects/portal/karma.conf.js b/projects/portal/karma.conf.js index 48462374a..2772eb235 100644 --- a/projects/portal/karma.conf.js +++ b/projects/portal/karma.conf.js @@ -23,10 +23,14 @@ module.exports = function (config) { reporters: ['progress', 'kjhtml'], port: 9876, colors: true, - logLevel: config.LOG_INFO, - autoWatch: true, + logLevel: config.LOG_DEBUG, + autoWatch: false, browsers: ['Chrome'], - singleRun: false, - restartOnFileChange: true + singleRun: true, + restartOnFileChange: true, + browserNoActivityTimeout: 30000, + browserDisconnectTimeout: 30000, + captureTimeout: 30000, + browserDisconnectTolerance: 3 }); }; diff --git a/projects/storage/karma.conf.js b/projects/storage/karma.conf.js index b0e66bfa8..69029c9a9 100644 --- a/projects/storage/karma.conf.js +++ b/projects/storage/karma.conf.js @@ -43,8 +43,8 @@ module.exports = function (config) { reporters: ['progress', 'kjhtml'], port: 9876, colors: true, - logLevel: config.LOG_INFO, - autoWatch: true, + logLevel: config.LOG_DEBUG, + autoWatch: false, browsers: ['ChromeHeadless'], customLaunchers: { ChromeHeadless: { @@ -52,8 +52,11 @@ module.exports = function (config) { flags: ['--no-sandbox', '--headless', '--disable-gpu', '--disable-web-security', '--remote-debugging-port=9222'] } }, - singleRun: false, + singleRun: true, restartOnFileChange: true, - browserNoActivityTimeout: 30000 + browserNoActivityTimeout: 30000, + browserDisconnectTimeout: 30000, + captureTimeout: 30000, + browserDisconnectTolerance: 3 }); }; diff --git a/projects/sync/karma.conf.js b/projects/sync/karma.conf.js index 18ef11e7c..3a61f99be 100644 --- a/projects/sync/karma.conf.js +++ b/projects/sync/karma.conf.js @@ -48,8 +48,8 @@ module.exports = function (config) { reporters: ['progress', 'kjhtml'], port: 9876, colors: true, - logLevel: config.LOG_INFO, - autoWatch: true, + logLevel: config.LOG_DEBUG, + autoWatch: false, browsers: ['ChromeHeadless'], customLaunchers: { ChromeHeadless: { @@ -57,8 +57,11 @@ module.exports = function (config) { flags: ['--no-sandbox', '--headless', '--disable-gpu', '--disable-web-security', '--remote-debugging-port=9222'] } }, - singleRun: false, + singleRun: true, restartOnFileChange: true, - browserNoActivityTimeout: 30000 + browserNoActivityTimeout: 30000, + browserDisconnectTimeout: 30000, + captureTimeout: 30000, + browserDisconnectTolerance: 3 }); }; diff --git a/projects/templates/karma.conf.js b/projects/templates/karma.conf.js index 41201f02c..da853c5aa 100644 --- a/projects/templates/karma.conf.js +++ b/projects/templates/karma.conf.js @@ -56,8 +56,8 @@ module.exports = function (config) { reporters: ['progress', 'kjhtml'], port: 9876, colors: true, - logLevel: config.LOG_INFO, - autoWatch: true, + logLevel: config.LOG_DEBUG, + autoWatch: false, browsers: ['ChromeHeadless'], customLaunchers: { ChromeHeadless: { @@ -65,8 +65,11 @@ module.exports = function (config) { flags: ['--no-sandbox', '--headless', '--disable-gpu', '--disable-web-security', '--remote-debugging-port=9222'] } }, - singleRun: false, + singleRun: true, restartOnFileChange: true, - browserNoActivityTimeout: 30000 + browserNoActivityTimeout: 30000, + browserDisconnectTimeout: 50000, + captureTimeout: 50000, + browserDisconnectTolerance: 3 }); }; diff --git a/projects/ui/karma.conf.js b/projects/ui/karma.conf.js index b21c22fd3..cb963079c 100644 --- a/projects/ui/karma.conf.js +++ b/projects/ui/karma.conf.js @@ -43,8 +43,8 @@ module.exports = function (config) { reporters: ['progress', 'kjhtml'], port: 9876, colors: true, - logLevel: config.LOG_INFO, - autoWatch: true, + logLevel: config.LOG_DEBUG, + autoWatch: false, browsers: ['ChromeHeadless'], customLaunchers: { ChromeHeadless: { @@ -52,9 +52,11 @@ module.exports = function (config) { flags: ['--no-sandbox', '--headless', '--disable-gpu', '--disable-web-security', '--remote-debugging-port=9222'] } }, - singleRun: false, + singleRun: true, restartOnFileChange: true, browserNoActivityTimeout: 50000, - browserDisconnectTimeout: 50000 + browserDisconnectTimeout: 50000, + captureTimeout: 50000, + browserDisconnectTolerance: 3 }); }; From 74b01ccf8fa1dfd87e29fd3a49aaed3b61d3930e Mon Sep 17 00:00:00 2001 From: Pedro Domingues Date: Wed, 31 Jul 2024 18:56:42 -0300 Subject: [PATCH 2/2] =?UTF-8?q?feat(karma):=20atualiza=20autoWatch=20para?= =?UTF-8?q?=20Watch=20Conforme=20documenta=C3=A7=C3=A3o=20do=20karma@lates?= =?UTF-8?q?t?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + package.json | 14 +++++++------- projects/code-editor/karma.conf.js | 2 +- projects/portal/karma.conf.js | 2 +- projects/storage/karma.conf.js | 2 +- projects/sync/karma.conf.js | 2 +- projects/templates/karma.conf.js | 2 +- projects/ui/karma.conf.js | 2 +- 8 files changed, 14 insertions(+), 13 deletions(-) diff --git a/.gitignore b/.gitignore index 2d0d9a22e..8597ac88a 100644 --- a/.gitignore +++ b/.gitignore @@ -57,3 +57,4 @@ projects/portal/src/app/menu.service.ts projects/portal/src/assets/json/api-list.json projects/portal/src/assets/json/version.json projects/portal/src/app/documentation/documentation-routing.module.ts +.scannerwork diff --git a/package.json b/package.json index 806df1f12..c20be5427 100644 --- a/package.json +++ b/package.json @@ -25,16 +25,16 @@ "test:storage:schematics": "gulp build:schematics --lib storage && jasmine \"dist/ng-storage/schematics/**/*.spec.js\"", "test:sync": "ng test sync --watch=false --code-coverage --browsers=ChromeHeadless --source-map", "test:sync:schematics": "gulp build:schematics --lib sync && jasmine \"dist/ng-sync/schematics/**/*.spec.js\"", - "test:sync:browse": "ng test sync --code-coverage --browsers=Chrome --source-map --watch=false", + "test:sync:browse": "ng test sync --code-coverage --browsers=ChromeHeadless --source-map --watch=false", "test:ui": "ng test ui --watch=false --code-coverage --browsers=ChromeHeadless --source-map", "test:ui:schematics": "gulp build:schematics --lib ui && jasmine \"./dist/ng-components/schematics/**/*.spec.js\"", - "test:ui:browse": "ng test ui --code-coverage --browsers=Chrome --source-map --watch=false", + "test:ui:browse": "ng test ui --code-coverage --browsers=ChromeHeadless --source-map --watch=false", "test:templates": "ng test templates --watch=false --code-coverage --browsers=ChromeHeadless --source-map", "test:templates:schematics": "gulp build:schematics --lib templates && jasmine \"dist/ng-templates/schematics/**/*.spec.js\"", - "test:templates:browse": "ng test templates --code-coverage --browsers=Chrome --source-map --watch=false", + "test:templates:browse": "ng test templates --code-coverage --browsers=ChromeHeadless --source-map --watch=false", "test:code-editor": "ng test code-editor --watch=false --code-coverage --browsers=ChromeHeadless --source-map", "test:code-editor:schematics": "gulp build:schematics --lib code-editor && jasmine \"dist/ng-code-editor/schematics/**/*.spec.js\"", - "test:code-editor:browse": "ng test code-editor --code-coverage --browsers=Chrome --source-map --watch=false", + "test:code-editor:browse": "ng test code-editor --code-coverage --browsers=ChromeHeadless --source-map --watch=false", "test:dev": "ng test --browsers=ChromeHeadless", "build:schematics": "cd ./projects/schematics && npm run build", "build:ui": "ng build ui --configuration production && gulp build:schematics --lib ui && gulp replaceVersion && cd dist/ng-components && npm pack", @@ -75,6 +75,8 @@ "@capacitor/core": "5.7.2", "@capacitor/network": "^5.0.7", "@po-ui/style": "18.0.0", + "@typescript-eslint/eslint-plugin": "^7.11.0", + "@typescript-eslint/parser": "^7.11.0", "capitalize": "^2.0.4", "colors": "1.4.0", "core-js": "3.33.3", @@ -91,6 +93,7 @@ "run-sequence": "^2.2.1", "rxjs": "~7.8.1", "rxjs-compat": "~6.6.7", + "sonarqube-scanner": "^2.8.0", "tslib": "^2.6.2", "zone.js": "~0.14.4" }, @@ -112,8 +115,6 @@ "@types/node": "^20.10.0", "@types/resize-observer-browser": "^0.1.11", "@types/systemjs": "^6.13.5", - "@typescript-eslint/eslint-plugin": "^7.11.0", - "@typescript-eslint/parser": "^7.11.0", "del": "^6.0.0", "dgeni": "^0.4.14", "dgeni-packages": "0.30.0", @@ -139,7 +140,6 @@ "protractor": "~7.0.0", "rollup": "4.6.0", "sonarjs": "latest", - "sonarqube-scanner": "^2.8.0", "standard-version": "^9.5.0", "ts-node": "~10.9.1", "typemoq": "^2.1.0", diff --git a/projects/code-editor/karma.conf.js b/projects/code-editor/karma.conf.js index 425683259..33d0e1504 100644 --- a/projects/code-editor/karma.conf.js +++ b/projects/code-editor/karma.conf.js @@ -44,7 +44,7 @@ module.exports = function (config) { port: 9876, colors: true, logLevel: config.LOG_DEBUG, - autoWatch: false, + watch: false, browsers: ['ChromeHeadless'], customLaunchers: { ChromeHeadless: { diff --git a/projects/portal/karma.conf.js b/projects/portal/karma.conf.js index 2772eb235..eb6256cab 100644 --- a/projects/portal/karma.conf.js +++ b/projects/portal/karma.conf.js @@ -24,7 +24,7 @@ module.exports = function (config) { port: 9876, colors: true, logLevel: config.LOG_DEBUG, - autoWatch: false, + watch: false, browsers: ['Chrome'], singleRun: true, restartOnFileChange: true, diff --git a/projects/storage/karma.conf.js b/projects/storage/karma.conf.js index 69029c9a9..8f9f74244 100644 --- a/projects/storage/karma.conf.js +++ b/projects/storage/karma.conf.js @@ -44,7 +44,7 @@ module.exports = function (config) { port: 9876, colors: true, logLevel: config.LOG_DEBUG, - autoWatch: false, + watch: false, browsers: ['ChromeHeadless'], customLaunchers: { ChromeHeadless: { diff --git a/projects/sync/karma.conf.js b/projects/sync/karma.conf.js index 3a61f99be..f9f44154f 100644 --- a/projects/sync/karma.conf.js +++ b/projects/sync/karma.conf.js @@ -49,7 +49,7 @@ module.exports = function (config) { port: 9876, colors: true, logLevel: config.LOG_DEBUG, - autoWatch: false, + watch: false, browsers: ['ChromeHeadless'], customLaunchers: { ChromeHeadless: { diff --git a/projects/templates/karma.conf.js b/projects/templates/karma.conf.js index da853c5aa..7f2787bb9 100644 --- a/projects/templates/karma.conf.js +++ b/projects/templates/karma.conf.js @@ -57,7 +57,7 @@ module.exports = function (config) { port: 9876, colors: true, logLevel: config.LOG_DEBUG, - autoWatch: false, + watch: false, browsers: ['ChromeHeadless'], customLaunchers: { ChromeHeadless: { diff --git a/projects/ui/karma.conf.js b/projects/ui/karma.conf.js index cb963079c..c434b1d2a 100644 --- a/projects/ui/karma.conf.js +++ b/projects/ui/karma.conf.js @@ -44,7 +44,7 @@ module.exports = function (config) { port: 9876, colors: true, logLevel: config.LOG_DEBUG, - autoWatch: false, + watch: false, browsers: ['ChromeHeadless'], customLaunchers: { ChromeHeadless: {