From eb7f26a4493f2f8839ee01954c95f535764a449a Mon Sep 17 00:00:00 2001 From: danbao Date: Thu, 20 Jun 2019 21:28:44 +0800 Subject: [PATCH 1/3] ci(WAT-647): Integration the sonarcloud to Enhance TestRing Automated Code Analysis Workflow --- .travis.yml | 9 ++++++++- package.json | 2 +- sonar-project.properties | 11 +++++++++++ 3 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 sonar-project.properties diff --git a/.travis.yml b/.travis.yml index 63d848a9..b791e2f1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,8 +5,13 @@ git: addons: chrome: stable + sonarcloud: + organization: "ringcentral" + token: + secure: "xzS9szSu7A+yzpqf4n/YIB5LFVhySghNPlekW5kFc/t0+xefFBgfYSDr2yXhcbMyL/ZlCmIL8/RSdL83QtgThI4vLQfRp/DQTrap58D3aboCb9yKY57ELzv/jwbH1tJ3ocy/GzTbDDcHb0V/tzElELGWPcKQIbu9T2RisJxpo7P+XGjEV6eDlzsE/rFh6tP7gF2dEE/RcvjGfOamOFLK/XtUPAeO50sKqnDQvmU3GfKtwwnGLFAqIPJOU5m8BJGfZrhDY18EOwLxAOXCCb+//FwiOm0AiR+N0/WnZGP7ZLcOMcVKcje9IGg0+j5B5wziCGuZtJuDh9VyORzrxsgXL/xhUKoMy8yQ5f70ziMFWG/oJexQP+ItDYKkktXEM8PkNrtgxnDcHSDN37Xda9m0vSAwrLInISnG65jIsJO53QY3eemd9DBZMPOGTWYAkMZK8Si1GcXNhfAhTT2e6nKZIYvDy/ADoPSgk1hqyxMZOdmqQQSVPg0qur1lk8Lmvc25UyPqZt8hsldOKfwkg5GEXYC5kLuRJa+ZuaMjWmNlg1DEGhyhE19JhgRIsvPF7u654RKwaTzMndCAR2vuMfspK+YVtPHJVt6EMw+jnjilt4dZb0Qp6CHYgQnSNq+p256oc73MjvA5lq+foTgat89fFgPoPp63sLiaRA8OYLfxQwA=" language: node_js +dist: trusty node_js: - "10" @@ -18,7 +23,9 @@ cache: - $HOME/.npm - node_modules -script: xvfb-run npm run build:ci +script: + - xvfb-run npm run build:ci + - 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then sonar-scanner; fi' # sonar only on non-PRs https://github.com/travis-ci/travis-ci/issues/10062 stages: - test diff --git a/package.json b/package.json index 124dcb5e..eda22df7 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "test:e2e": "lerna run --stream --scope @testring/e2e-test-app e2e", "test:e2e-simple": "lerna run --stream --scope @testring/e2e-test-app e2e-simple", "test:coverage": "nyc npm test", - "test:publish": "coveralls < ./coverage/lcov.info && rimraf ./coverage -G", + "test:publish": "coveralls < ./coverage/lcov.info && rimraf ./coverage/lcov-report -G", "test:ci": "npm run test:coverage && npm run test:e2e && npm run test:publish", "build": "npm run build:main && npm run build:devtool && npm run build:extension", "build:main": "lerna exec --ignore=\"@testring/@(e2e-test-app|devtool-frontend|devtool-extension|ui-kit)\" -- tsc --target es2015", diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 00000000..fd15fe62 --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,11 @@ +sonar.projectKey=ringcentral_testring +sonar.sources=. +sonar.exclusions=**/node_modules/**,**/*.spec.ts +sonar.test.inclusions=packages/**/*.spec.ts +sonar.typescript.lcov.reportPaths=coverage/lcov.info +sonar.typescript.tsconfigPath=tsconfig.json + +sonar.links.homepage=https://github.com/ringcentral/testring +sonar.links.ci=https://travis-ci.org/ringcentral/testring +sonar.links.scm=https://github.com/ringcentral/testring +sonar.links.issue=https://github.com/ringcentral/testring/issues From 0356d310600e3ad438651058611353d8053a4585 Mon Sep 17 00:00:00 2001 From: danbao Date: Thu, 20 Jun 2019 22:03:05 +0800 Subject: [PATCH 2/3] ci(WAT-647): fix bug find by sonar --- packages/devtool-extension/static/popup.html | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/devtool-extension/static/popup.html b/packages/devtool-extension/static/popup.html index e69d8014..22f48ead 100644 --- a/packages/devtool-extension/static/popup.html +++ b/packages/devtool-extension/static/popup.html @@ -1,3 +1,4 @@ + Testring popup From 1ce7d331d9f3d525f44cbc427edb44098d486965 Mon Sep 17 00:00:00 2001 From: danbao Date: Thu, 20 Jun 2019 22:40:51 +0800 Subject: [PATCH 3/3] ci(WAT-647): check spec.ts in sonar --- sonar-project.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index fd15fe62..b6d72749 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,6 +1,6 @@ sonar.projectKey=ringcentral_testring sonar.sources=. -sonar.exclusions=**/node_modules/**,**/*.spec.ts +sonar.exclusions=**/node_modules/** sonar.test.inclusions=packages/**/*.spec.ts sonar.typescript.lcov.reportPaths=coverage/lcov.info sonar.typescript.tsconfigPath=tsconfig.json