From 5be907b63aa95474eeebfa77b07a8adaa7451fdd Mon Sep 17 00:00:00 2001 From: Aaron Brethorst Date: Thu, 16 Jan 2025 12:15:11 -0800 Subject: [PATCH 1/3] Optimize coverage configuration * Remove text reporter * Exclude tests from the coverage report --- vite.config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vite.config.js b/vite.config.js index b69a6fe..0d082ad 100644 --- a/vite.config.js +++ b/vite.config.js @@ -8,9 +8,9 @@ export default defineConfig({ coverage: { provider: 'v8', reportsDirectory: './coverage', - reporter: ['text', 'html'], + reporter: ['html'], all: true, - exclude: ['node_modules', 'coverage', '.svelte-kit', 'build'] + exclude: ['**/tests', '.svelte-kit', 'build', 'coverage', 'node_modules'] } } }); From c8adb4575e67a8ccc5c21093276701f0bd9c30b7 Mon Sep 17 00:00:00 2001 From: Aaron Brethorst Date: Thu, 16 Jan 2025 15:14:54 -0800 Subject: [PATCH 2/3] Add code coverage to CI suite --- .github/workflows/test.yml | 10 ++++++++-- vite.config.js | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0e40174..4bb8396 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -27,16 +27,22 @@ jobs: - name: Set up Node.js uses: actions/setup-node@v4 with: - node-version: 18 + node-version: 20 - name: Install dependencies run: npm install - name: Run tests - run: npm run test + run: npx vitest run --coverage env: CI: true + - name: Upload coverage to Coveralls + uses: coverallsapp/github-action@v2 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + files: ./coverage/lcov.info + - name: Display test results if: failure() run: | diff --git a/vite.config.js b/vite.config.js index 0d082ad..340cf26 100644 --- a/vite.config.js +++ b/vite.config.js @@ -8,7 +8,7 @@ export default defineConfig({ coverage: { provider: 'v8', reportsDirectory: './coverage', - reporter: ['html'], + reporter: ['html', 'lcov'], all: true, exclude: ['**/tests', '.svelte-kit', 'build', 'coverage', 'node_modules'] } From ff246a2e56846ecdc4399bcba2c046ff5c171f77 Mon Sep 17 00:00:00 2001 From: Aaron Brethorst Date: Thu, 16 Jan 2025 15:37:03 -0800 Subject: [PATCH 3/3] Add code coverage badge to README --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 7afbab8..e3a2d04 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Wayfinder +[![Coverage Status](https://coveralls.io/repos/github/OneBusAway/wayfinder/badge.svg)](https://coveralls.io/github/OneBusAway/wayfinder) + This is the next-generation OneBusAway web application, built on top of [SvelteKit](https://kit.svelte.dev). It is designed to replace the [onebusaway-enterprise-webapp](https://github.com/OneBusAway/onebusaway-application-modules) project. This project is under active development! ## Developing