From 27bb79a29a514ee57be389f8032a60fd2cddd8c4 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 3 Nov 2022 13:47:36 +0000 Subject: [PATCH] Switch to @casualbot/jest-sonar-reporter --- .github/workflows/sonarqube.yml | 4 ++-- package.json | 11 ++++++----- sonar-project.properties | 2 +- yarn.lock | 22 ++++++++++++---------- 4 files changed, 21 insertions(+), 18 deletions(-) diff --git a/.github/workflows/sonarqube.yml b/.github/workflows/sonarqube.yml index bfb8480d1..95035deed 100644 --- a/.github/workflows/sonarqube.yml +++ b/.github/workflows/sonarqube.yml @@ -30,8 +30,8 @@ jobs: run: | coverage=$(find coverage -type f -name '*lcov.info' | tr '\n' ',') echo "reportPaths=$coverage" >> $GITHUB_OUTPUT - testResults=$(find coverage -type f -name '*test-report.xml' | tr '\n' ',') - echo "testExecutionReportPaths=$testResults" >> $GITHUB_OUTPUT + reports=$(find coverage -type f -name 'jest-sonar-report*.xml' | tr '\n' ',') + echo "testExecutionReportPaths=$reports" >> $GITHUB_OUTPUT sonarqube: name: 🩻 SonarQube diff --git a/package.json b/package.json index 262cbecc4..3fcea052a 100644 --- a/package.json +++ b/package.json @@ -77,6 +77,7 @@ "@babel/preset-env": "^7.12.11", "@babel/preset-typescript": "^7.12.7", "@babel/register": "^7.12.10", + "@casualbot/jest-sonar-reporter": "^2.2.5", "@matrix-org/olm": "https://gitlab.matrix.org/api/v4/projects/27/packages/npm/@matrix-org/olm/-/@matrix-org/olm-3.2.13.tgz", "@types/bs58": "^4.0.1", "@types/content-type": "^1.1.5", @@ -103,7 +104,6 @@ "jest": "^29.0.0", "jest-localstorage-mock": "^2.4.6", "jest-mock": "^29.0.0", - "jest-sonar-reporter": "^2.0.0", "jsdoc": "^3.6.6", "matrix-mock-request": "^2.5.0", "patch-package": "^6.5.0", @@ -128,10 +128,11 @@ "text-summary", "lcov" ], - "testResultsProcessor": "jest-sonar-reporter" + "testResultsProcessor": "@casualbot/jest-sonar-reporter" }, - "jestSonar": { - "reportPath": "coverage", - "sonar56x": true + "@casualbot/jest-sonar-reporter": { + "outputDirectory": "coverage", + "outputName": "jest-sonar-report.xml", + "relativePaths": true } } diff --git a/sonar-project.properties b/sonar-project.properties index 4f5b65e38..5cfec433c 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -11,6 +11,6 @@ sonar.exclusions=docs,examples,git-hooks sonar.typescript.tsconfigPath=./tsconfig.json sonar.javascript.lcov.reportPaths=coverage/lcov.info sonar.coverage.exclusions=spec/**/* -sonar.testExecutionReportPaths=coverage/test-report.xml +sonar.testExecutionReportPaths=coverage/jest-sonar-report.xml sonar.lang.patterns.ts=**/*.ts,**/*.tsx diff --git a/yarn.lock b/yarn.lock index 67db5e346..6daa4bbc9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1092,6 +1092,15 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== +"@casualbot/jest-sonar-reporter@^2.2.5": + version "2.2.5" + resolved "https://registry.yarnpkg.com/@casualbot/jest-sonar-reporter/-/jest-sonar-reporter-2.2.5.tgz#23d187ddb8d65129a3c8d8239b0540a52c4dc82a" + integrity sha512-Pmb4aEtJudz9G0VsmEUzuDm5iWGOCDsmulzi6AP/RgAXEcmsSxVdxjcgA+2SHC005diU4mXnPLiQyiiMIAtUjA== + dependencies: + mkdirp "1.0.4" + uuid "8.3.2" + xml "1.0.1" + "@eslint/eslintrc@^1.3.3": version "1.3.3" resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.3.3.tgz#2b044ab39fdfa75b4688184f9e573ce3c5b0ff95" @@ -4597,13 +4606,6 @@ jest-snapshot@^29.2.2: pretty-format "^29.2.1" semver "^7.3.5" -jest-sonar-reporter@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/jest-sonar-reporter/-/jest-sonar-reporter-2.0.0.tgz#faa54a7d2af7198767ee246a82b78c576789cf08" - integrity sha512-ZervDCgEX5gdUbdtWsjdipLN3bKJwpxbvhkYNXTAYvAckCihobSLr9OT/IuyNIRT1EZMDDwR6DroWtrq+IL64w== - dependencies: - xml "^1.0.1" - jest-util@^28.1.3: version "28.1.3" resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-28.1.3.tgz#f4f932aa0074f0679943220ff9cbba7e497028b0" @@ -5095,7 +5097,7 @@ mkdirp-classic@^0.5.2: resolved "https://registry.yarnpkg.com/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz#fa10c9115cc6d8865be221ba47ee9bed78601113" integrity sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A== -mkdirp@^1.0.4: +mkdirp@1.0.4, mkdirp@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== @@ -6806,7 +6808,7 @@ util@~0.12.0: is-typed-array "^1.1.3" which-typed-array "^1.1.2" -uuid@^8.3.2: +uuid@8.3.2, uuid@^8.3.2: version "8.3.2" resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== @@ -6995,7 +6997,7 @@ write-file-atomic@^4.0.1: imurmurhash "^0.1.4" signal-exit "^3.0.7" -xml@^1.0.1: +xml@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/xml/-/xml-1.0.1.tgz#78ba72020029c5bc87b8a81a3cfcd74b4a2fc1e5" integrity sha512-huCv9IH9Tcf95zuYCsQraZtWnJvBtLVE0QHMOs8bWyZAFZNDcYjsPq1nEx8jKA9y+Beo9v+7OBPRisQTjinQMw==