WalletConnect / web3modal

A single Web3 provider solution for all Wallets
https://web3modal.com
Apache License 2.0
4.67k stars 1.28k forks source link

fix: vitest gh actions doesn't throw error #2170

Closed enesozturk closed 3 weeks ago

enesozturk commented 4 weeks ago

Changes

Refactor Scripts and Workflows

Since we are using monorepo and the Vitest coverage tools don't have a proper monorepo setup, we are merging all the generated coverage files from our packages and saving them to another file with a script.

The vitest-coverage-report-action is using these merged coverage reports to generate comments on the PR.

[!NOTE]
A two different scripts like the following prevent workflow to detect issues.

"test": "npm run test; node ./scripts/coverage.js

If the test script fails, when it run the coverage.js script, the CI thinks that the job is OK.

Upgrade Vitest

Vitest has many improvements to the GH actions in the recent versions. Upgrading it might help us to raise the error in CI.

Example: https://github.com/vitest-dev/vitest/pull/5093 See recent releases: https://github.com/vitest-dev/vitest/releases

Fix PublicStateController tests

Recently we added the loading state to the PublicStateController. The unit tests needed some updates regarding to this.

*Intentionally, one of the test are still broken to test the GH Action issue.

Add vite.config.ts

The vitest-coverage-report-action requires the Vite config file in the root.

vercel[bot] commented 4 weeks ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
web3modal-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 22, 2024 9:57am
web3modal-gallery ✅ Ready (Inspect) Visit Preview Apr 22, 2024 9:57am
web3modal-laboratory ✅ Ready (Inspect) Visit Preview Apr 22, 2024 9:57am
github-actions[bot] commented 4 weeks ago

Coverage Report for Coverage

Status Category Percentage Covered / Total
🔵 Lines 81.49% 2520 / 14979
🔵 Statements 81.49% 2520 / 14979
🔵 Functions 89.71% 122 / 509
🔵 Branches 119.62% 182 / 484
File Coverage
File Stmts % Branch % Funcs % Lines Uncovered Lines
Changed Files
packages/core/src/controllers/ConvertController.ts 45.66% 45% 34.21% 45.66% 35-38, 143-144, 147-148, 155-156, 172-173, 177-178, 190-191, 198-202, 208-209, 213-220, 227, 230, 237-245, 248-252, 255-263, 266-267, 270-274, 277-288, 291-319, 325-326, 332, 344-354, 357-365, 368-379, 382-394, 397-403, 445-452, 455-465, 468-501, 513, 519-554, 557-582, 585-639, 642-683, 689-693, 714-737
Generated in workflow #3312