Skip to content

Commit

Permalink
🔧 chore: Add autoupdate to coverage thresholds (#379)
Browse files Browse the repository at this point in the history
## Description

Add autoupdate to vitest tests that will always update coverage min
thresholds to current coverage

## Testing

Explain the quality checks that have been done on the code changes

## Additional Information

- [ ] I read the [contributing docs](../docs/contributing.md) (if this
is your first contribution)

Your ENS/address:

---------

Co-authored-by: Will Cory <[email protected]>
  • Loading branch information
roninjin10 and Will Cory authored Jul 24, 2023
1 parent 56dfb3b commit 0ff53e7
Show file tree
Hide file tree
Showing 9 changed files with 62 additions and 12 deletions.
15 changes: 15 additions & 0 deletions .changeset/mighty-tigers-drive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
"@evmts/esbuild-plugin": patch
"@evmts/webpack-plugin": patch
"@evmts/rollup-plugin": patch
"@evmts/rspack-plugin": patch
"@evmts/vite-plugin": patch
"@evmts/language-server": patch
"@evmts/bundler": patch
"@evmts/config": patch
"@evmts/ethers": patch
"@evmts/ts-plugin": patch
"@evmts/core": patch
---

Updated build pipeline to generate .d.ts files
28 changes: 28 additions & 0 deletions .github/workflows/build-types.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
merge_group:

name: Build types

jobs:
build:
name: Build types
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive

- name: "Setup"
uses: ./.github/actions/setup

- name: Run build:types
run: pnpm nx affected --target=build:types
env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}

3 changes: 2 additions & 1 deletion bundlers/bundler/vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ export default defineConfig({
reporter: ['text', 'json-summary', 'json'],
lines: 100,
functions: 100,
branches: 97,
branches: 98.18,
statements: 100,
thresholdAutoUpdate: true,
},
},
})
7 changes: 4 additions & 3 deletions bundlers/config/vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ export default defineConfig({
include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
coverage: {
reporter: ['text', 'json-summary', 'json'],
lines: 95,
statements: 95,
lines: 99.78,
statements: 99.78,
functions: 100,
branches: 80,
branches: 88.05,
thresholdAutoUpdate: true,
},
},
})
7 changes: 4 additions & 3 deletions examples/esbuild/vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ export default defineConfig({
setupFiles: ['./setupVitest.ts'],
coverage: {
reporter: ['text', 'json-summary', 'json'],
lines: 80,
lines: 100,
branches: 50,
functions: 80,
statements: 80,
functions: 100,
statements: 100,
thresholdAutoUpdate: true
},
}
})
2 changes: 1 addition & 1 deletion lsp/ts-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"lint:check": "rome check . --verbose",
"package:up": "pnpm up --latest",
"pretest": "forge build",
"test": "vitest",
"test": "vitest --coverage",
"test:coverage": "vitest run --coverage",
"test:run": "vitest --run"
},
Expand Down
9 changes: 5 additions & 4 deletions lsp/ts-plugin/vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ export default defineConfig({
include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
coverage: {
reporter: ['text', 'json-summary', 'json'],
lines: 90,
branches: 90,
functions: 90,
statements: 90,
lines: 96.65,
branches: 93.75,
functions: 94.44,
statements: 96.65,
thresholdAutoUpdate: true,
},
},
})
1 change: 1 addition & 0 deletions runtime/core/vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export default defineConfig({
statements: 100,
functions: 100,
branches: 100,
thresholdAutoUpdate: true,
},
},
})
2 changes: 2 additions & 0 deletions runtime/ethers/vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ export default defineConfig({
statements: 0,
functions: 0,
branches: 0,
all: true,
thresholdAutoUpdate: true,
},
},
})

0 comments on commit 0ff53e7

Please sign in to comment.