Skip to content

Commit 1b035d0

Browse files
am1r021acolytec3holgerd77
authored
Codecov tuning (#3207)
* Add coverage checking and reporting for wallet CI runs * Add coverage checking and reporting for genesis CI runs * Add coverage run to rlp package workflow * Use coverage script for CI coverage report generation * Just run node tests for RLP * Increase wallet test timeouts * Increase wallet test timeout * Only run node tests for coverage * Comment out tests to see how codecov handles report generation and processing * Add arguments for codecov upload action * Add arguments for codecov upload action * Revert "Comment out tests to see how codecov handles report generation and processing" This reverts commit 783dae0. * Revert "Add arguments for codecov upload action" This reverts commit 553bcd5. * Revert "Add arguments for codecov upload action" This reverts commit dff18e5. --------- Co-authored-by: acolytec3 <[email protected]> Co-authored-by: Holger Drewes <[email protected]>
1 parent 9a7d6ac commit 1b035d0

File tree

8 files changed

+66
-47
lines changed

8 files changed

+66
-47
lines changed

.github/workflows/genesis-build.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,11 @@ jobs:
3939
working-directory: ${{github.workspace}}
4040

4141
- run: npm run lint
42+
43+
- run: npm run coverage
44+
- uses: codecov/codecov-action@v3
45+
with:
46+
files: ${{ env.cwd }}/coverage/lcov.info
47+
flags: genesis
48+
4249
- run: npm run test:node # Only run node tests for now until vitest browser test issues are sorted out

.github/workflows/rlp-build.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,8 @@ jobs:
3838

3939
- run: npm run lint
4040

41+
- run: npm run coverage
42+
- uses: codecov/codecov-action@v3
43+
with:
44+
files: ${{ env.cwd }}/coverage/lcov.info
45+
flags: rlp

.github/workflows/wallet-build.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,11 @@ jobs:
3939
working-directory: ${{github.workspace}}
4040

4141
- run: npm run lint
42+
43+
- run: npm run coverage
44+
- uses: codecov/codecov-action@v3
45+
with:
46+
files: ${{ env.cwd }}/coverage/lcov.info
47+
flags: wallet
48+
4249
- run: npm run test:node # Only run node tests for now until vitest browser test issues are sorted out

packages/ethash/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"scripts": {
3434
"build": "../../config/cli/ts-build.sh",
3535
"clean": "../../config/cli/clean-package.sh",
36-
"coverage": "DEBUG=ethjs npx vitest run --coverage.enabled --coverage.reporter=lcov",
36+
"coverage": "../../config/cli/coverage.sh",
3737
"docs:build": "typedoc --options typedoc.cjs",
3838
"examples": "ts-node ../../scripts/examples-runner.ts -- ethash",
3939
"lint": "../../config/cli/lint.sh",

packages/rlp/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"scripts": {
4545
"build": "../../config/cli/ts-build.sh node",
4646
"clean": "../../config/cli/clean-package.sh",
47-
"coverage": "DEBUG=ethjs npx vitest run --coverage.enabled --coverage.reporter=lcov",
47+
"coverage": "c8 --all --reporter=lcov --reporter=text npm run test:node",
4848
"examples": "ts-node ../../scripts/examples-runner.ts -- rlp",
4949
"lint": "../../config/cli/lint.sh",
5050
"lint:diff": "../../config/cli/lint-diff.sh",

packages/wallet/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"scripts": {
3434
"build": "../../config/cli/ts-build.sh",
3535
"clean": "../../config/cli/clean-package.sh",
36-
"coverage": "npm run build && nyc --reporter=lcov npm run test:unit",
36+
"coverage": "c8 --all --reporter=lcov --reporter=text npm run test:node",
3737
"docs:build": "npx typedoc --options typedoc.cjs",
3838
"examples": "ts-node ../../scripts/examples-runner.ts -- wallet",
3939
"lint": "../../config/cli/lint.sh",

packages/wallet/test/hdkey.spec.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ describe('HD Key tests', () => {
1616
assert.doesNotThrow(function () {
1717
EthereumHDKey.fromMasterSeed(fixtureseed)
1818
})
19-
})
19+
}, 30000)
2020

2121
it('.fromMnemonic()', () => {
2222
const path = "m/44'/60'/0'/0/0"
@@ -25,21 +25,21 @@ describe('HD Key tests', () => {
2525

2626
assert.strictEqual(wallet.getPrivateKeyString(), fixturePrivateKey)
2727
assert.strictEqual(wallet.getAddressString(), fixtureAddress)
28-
})
28+
}, 30000)
2929

3030
it('.privateExtendedKey()', () => {
3131
assert.deepEqual(
3232
fixturehd.privateExtendedKey(),
3333
'xprv9s21ZrQH143K4KqQx9Zrf1eN8EaPQVFxM2Ast8mdHn7GKiDWzNEyNdduJhWXToy8MpkGcKjxeFWd8oBSvsz4PCYamxR7TX49pSpp3bmHVAY'
3434
)
35-
})
35+
}, 30000)
3636

3737
it('.publicExtendedKey()', () => {
3838
assert.deepEqual(
3939
fixturehd.publicExtendedKey(),
4040
'xpub661MyMwAqRbcGout4B6s29b6gGQsowyoiF6UgXBEr7eFCWYfXuZDvRxP9zEh1Kwq3TLqDQMbkbaRpSnoC28oWvjLeshoQz1StZ9YHM1EpcJ'
4141
)
42-
})
42+
}, 30000)
4343

4444
it('.fromExtendedKey()', () => {
4545
const onlyPublicExtendedKey = EthereumHDKey.fromExtendedKey(
@@ -69,15 +69,15 @@ describe('HD Key tests', () => {
6969
'xprv9s21ZrQH143K4KqQx9Zrf1eN8EaPQVFxM2Ast8mdHn7GKiDWzNEyNdduJhWXToy8MpkGcKjxeFWd8oBSvsz4PCYamxR7TX49pSpp3bmHVAY',
7070
'successfully generated key from extended private key'
7171
)
72-
})
72+
}, 30000)
7373

7474
it('.deriveChild()', () => {
7575
const hdnode = fixturehd.deriveChild(1)
7676
assert.deepEqual(
7777
hdnode.privateExtendedKey(),
7878
'xprv9vYSvrg3eR5FaKbQE4Ao2vHdyvfFL27aWMyH6X818mKWMsqqQZAN6HmRqYDGDPLArzaqbLExRsxFwtx2B2X2QKkC9uoKsiBNi22tLPKZHNS'
7979
)
80-
})
80+
}, 30000)
8181

8282
it('.derivePath()', () => {
8383
const hdnode1 = fixturehd.derivePath('m')
@@ -92,7 +92,7 @@ describe('HD Key tests', () => {
9292
'xprvA1ErCzsuXhpB8iDTsbmgpkA2P8ggu97hMZbAXTZCdGYeaUrDhyR8fEw47BNEgLExsWCVzFYuGyeDZJLiFJ9kwBzGojQ6NB718tjVJrVBSrG',
9393
"should work with m/44'/0'/0/1"
9494
)
95-
})
95+
}, 30000)
9696

9797
it('.getWallet()', () => {
9898
assert.deepEqual(
@@ -114,5 +114,5 @@ describe('HD Key tests', () => {
114114
'0x0639797f6cc72aea0f3d309730844a9e67d9f1866e55845c5f7e0ab48402973defa5cb69df462bcc6d73c31e1c663c225650e80ef14a507b203f2a12aea55bc1',
115115
'should work with public nodes'
116116
)
117-
})
117+
}, 30000)
118118
})

0 commit comments

Comments
 (0)