Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrading dependencies broke the coverage report #5101

Closed
6 tasks done
Aragur opened this issue Feb 2, 2024 · 7 comments
Closed
6 tasks done

Upgrading dependencies broke the coverage report #5101

Aragur opened this issue Feb 2, 2024 · 7 comments
Labels
feat: coverage Issues and PRs related to the coverage feature

Comments

@Aragur
Copy link

Aragur commented Feb 2, 2024

Describe the bug

Upgrading my dependencies broke the coverage file write.

> twogo-webapp@0.0.1 test:unit {{path_removed}}
> vitest "--run" "--coverage"


 RUN  v0.34.6 {{path_removed}}
      Coverage enabled with v8

 ✓ tests/unit/views/ErrorView.spec.ts (1)
 ✓ tests/unit/views/LoggedOutView.spec.ts (2)
 ✓ tests/unit/App.spec.ts (1)
 ✓ tests/unit/main.spec.ts (5)
SonarQube report written to {{path_removed}}/coverage/sonar-report.xml

 Test Files  4 passed (4)
      Tests  9 passed (9)
   Start at  10:10:20
   Duration  2.20s (transform 1.08s, setup 418ms, collect 5.63s, tests 71ms, environment 563ms, prepare 287ms)

JUNIT report written to {{path_removed}}/coverage/junit.xml

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Unhandled Error ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
TypeError: The argument 'path' must be a string, Uint8Array, or URL without null bytes. Received '{{path_removed}}/coverage/lcov-report/\x00vite'
 ❯ Object.mkdirSync node:fs:1371:10
 ❯ module.exports.sync node_modules/.pnpm/make-dir@4.0.0/node_modules/make-dir/index.js:113:6
 ❯ FileWriter.writeFile node_modules/.pnpm/istanbul-lib-report@3.0.1/node_modules/istanbul-lib-report/lib/file-writer.js:184:16
 ❯ HtmlReport.onSummary node_modules/.pnpm/istanbul-reports@3.1.6/node_modules/istanbul-reports/lib/html/index.js:364:44
 ❯ LcovReport.<computed> [as onSummary] node_modules/.pnpm/istanbul-reports@3.1.6/node_modules/istanbul-reports/lib/lcov/index.js:28:23
 ❯ Visitor.value node_modules/.pnpm/istanbul-lib-report@3.0.1/node_modules/istanbul-lib-report/lib/tree.js:38:38
 ❯ ReportNode.visit node_modules/.pnpm/istanbul-lib-report@3.0.1/node_modules/istanbul-lib-report/lib/tree.js:86:21
 ❯ node_modules/.pnpm/istanbul-lib-report@3.0.1/node_modules/istanbul-lib-report/lib/tree.js:92:19
 ❯ ReportNode.visit node_modules/.pnpm/istanbul-lib-report@3.0.1/node_modules/istanbul-lib-report/lib/tree.js:91:28

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: { code: 'ERR_INVALID_ARG_VALUE' }

Reproduction

https://github.com/Aragur/vitest-bug-2024_01

System Info

System:
    OS: macOS 14.3
    CPU: (10) arm64 Apple M1 Pro
    Memory: 118.75 MB / 16.00 GB
    Shell: 3.7.0 - /opt/homebrew/bin/fish
  Binaries:
    Node: 21.6.1 - /opt/homebrew/bin/node
    npm: 10.2.4 - /opt/homebrew/bin/npm
    pnpm: 8.15.1 - /opt/homebrew/bin/pnpm
    bun: 1.0.25 - /opt/homebrew/bin/bun
  Browsers:
    Chrome: 121.0.6167.85
    Safari: 17.3
  npmPackages:
    @vitejs/plugin-vue: ~5.0.3 => 5.0.3 
    @vitest/coverage-v8: ~0.34.4 => 0.34.6 
    vite: ~5.0.12 => 5.0.12 
    vitest: ~0.34.4 => 0.34.6

Used Package Manager

pnpm

Validations

Copy link

github-actions bot commented Feb 2, 2024

Hello @Aragur. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with need reproduction will be closed if they have no activity within 3 days.

@Aragur
Copy link
Author

Aragur commented Feb 2, 2024

@AriPerkkio
Copy link
Member

Upgrading my dependencies broke the coverage file write.

Which dependency upgrades caused this?

@Aragur
Copy link
Author

Aragur commented Feb 2, 2024

Upgrading my dependencies broke the coverage file write.

Which dependency upgrades caused this?

Unfortunately I don't know.
Downgrading now results in the same crash.

@AriPerkkio
Copy link
Member

In the configuration file the coverage.excludes is overwritten with custom value. You should rather extend the default values:

+import { coverageConfigDefaults } from "vitest/config";

export default defineConfig(({ mode }) => ({
    coverage: {
-      exclude: ["**/*.stories.*", "src/api"],
+      exclude: [...coverageConfigDefaults.exclude, "**/*.stories.*", "src/api"],
    },
  },
}));

Right now the configuration is overriding virtual modules' exclusion: #3794.

@AriPerkkio AriPerkkio added feat: coverage Issues and PRs related to the coverage feature and removed pending triage labels Feb 3, 2024
@Aragur
Copy link
Author

Aragur commented Feb 3, 2024

@AriPerkkio thanks a lot. That resolved my issue.

@yevhendevbox
Copy link

@AriPerkkio thank you a lot! Literally finally fixed my problem!

@github-actions github-actions bot locked and limited conversation to collaborators Feb 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feat: coverage Issues and PRs related to the coverage feature
Projects
None yet
Development

No branches or pull requests

4 participants