Skip to content

Commit 1ed41b9

Browse files
authored
Update Sonar configuration: duplications, downloading correct test report and add retry for integration tests
2 parents 277d48f + 373510a commit 1ed41b9

5 files changed

Lines changed: 7 additions & 3 deletions

File tree

.github/workflows/sonar-scan.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
- name: Download tests report
5151
uses: dawidd6/action-download-artifact@v2.28.0
5252
with:
53-
workflow: unit-test.yaml
53+
workflow: test.yaml
5454
workflow_conclusion: ''
5555
name: unit-tests-coverage
5656
if_no_artifact_found: warn

jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ module.exports = {
66
testTimeout: 5 * 60 * 1000,
77

88
coverageReporters: ['html', 'lcov'],
9-
collectCoverageFrom: ['src/**/*.ts', '!src/test/*.ts', '!src/simulateScript/deno-sandbox/*.ts'],
9+
collectCoverageFrom: ['src/**/*.ts', '!src/simulateScript/deno-sandbox/*.ts'],
1010
coverageThreshold: {
1111
global: {
1212
branches: 95,

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"build": "rimraf dist && tsc -P tsconfig.build.json && cpy src/simulateScript/deno-sandbox/**/* dist/simulateScript/deno-sandbox",
99
"build:browser": "webpack && browserify dist/simulateScript.bundle.js -o dist/simulateScript.browser.js -p esmify --standalone simulateScript && rm dist/simulateScript.bundle.js",
1010
"test": "jest",
11-
"test:ci": "jest --silent --coverage --ci",
11+
"test:ci": "jest --silent --ci --coverage",
1212
"test:package": "jest --config jest.config.package.js",
1313
"lint:check": "eslint '{src,test}/**/*.ts'",
1414
"lint:fix": "eslint '{src,test}/**/*.ts' --fix",

sonar-project.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ sonar.sources=.
55
sonar.exclusions=**/node_modules/**/*, **/mocks/**/*, **/testdata/**/*, **/demo/**/*, **/contracts/**/*, **/generated/**/*, **/fixtures/**/*, **/docs/**/*, **/tools/**/*, **/*.fixtures.ts, **/apiFixture.ts, **/*report.xml, **/*.config.ts, **/*.config.js, **/*.config.package.js, **/*.txt, **/*.abi, **/*.bin
66
# Coverage exclusions
77
sonar.coverage.exclusions=**/*.test.ts, **/test/**/*, **/src/simulateScript/deno-sandbox/**/*, **/index.ts
8+
# Duplications exclusions
9+
sonar.cpd.exclusions=**/src/v1_contract_sources/**/*
810

911
# Tests' root folder, inclusions (tests to check and count) and exclusions
1012
sonar.tests=.

test/integration/integration.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import { setupLocalTestnetFixture } from '../utils'
1111

1212
import { BigNumber, Contract, Wallet, utils } from 'ethers'
1313

14+
jest.retryTimes(2, { logErrorsBeforeRetry: true })
15+
1416
describe('Functions toolkit classes', () => {
1517
let donId = simulatedDonId
1618
let linkTokenContract: Contract

0 commit comments

Comments
 (0)