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

Add test.coveragePathIgnorePatterns option #12238

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

jakeboone02
Copy link
Contributor

What does this PR do?

Adds a coveragePathIgnorePatterns option to bunfig.toml similar to Jest's option of the same name.

Per #4021 (comment), the value can be a glob pattern or an array of glob patterns. File paths matching any of the globs will be ignored for the purpose of coverage % calculation and reporting.

I do have a couple of questions/concerns:

  • If all tested file paths are ignored (e.g., "**") and the coverage reporter is "lcov", the lcov.info file is created but left empty. Seems maybe technically correct, but LCOV processing tools might error (genhtml definitely errors; I'm not sure about others).

  • The glob matcher seems strict to me, at least in this context. For example, "*.js" won't match anything but "**/*.js" will. Probably not a big deal, but we might consider relaxing it a little. I don't have an opinion either way.

  • Documentation or TypeScript types

  • Code changes

How did you verify your code works?

I wrote automated tests.

  • I checked the lifetime of memory allocated to verify it's (1) freed and (2) only freed when it should be
  • I included a test for the new code, or an existing test covers it
  • (I'm pretty sure this is N/A) JSValue used outside outside of the stack is either wrapped in a JSC.Strong or is JSValueProtect'ed

Copy link
Contributor

github-actions bot commented Jul 3, 2024

@Jarred-Sumner, your commit has failing tests :(

💪 1 failing tests Darwin AARCH64

  • test/cli/test/coverage.test.ts 2 failing

💻 1 failing tests Darwin x64 baseline

  • test/cli/test/coverage.test.ts 2 failing

💻 1 failing tests Darwin x64

  • test/cli/test/coverage.test.ts 2 failing

🐧💪 1 failing tests Linux AARCH64

  • test/cli/test/coverage.test.ts 2 failing

🐧🖥 1 failing tests Linux x64 baseline

  • test/cli/test/coverage.test.ts 2 failing

🐧🖥 1 failing tests Linux x64

  • test/cli/test/coverage.test.ts 2 failing

🪟💻 3 failing tests Windows x64 baseline

  • test/cli/install/registry/bun-install-registry.test.ts 2 failing
  • test/cli/install/registry/bun-install-windowsshim.test.ts code 1
  • test/js/node/child_process/child_process.test.ts 1 failing

🪟💻 3 failing tests Windows x64

  • test/cli/install/registry/bun-install-registry.test.ts 1 failing
  • test/cli/install/registry/bun-install-windowsshim.test.ts code 1
  • test/js/node/child_process/child_process.test.ts 1 failing

View logs

@cuquo
Copy link

cuquo commented Jul 4, 2024

I've asked for an option in Bun Test to ignore certain files (like Jest or Vitest) in bun's discord before. I've even made jokes about that. Thanks @jakeboone02, instead of complaining like I did, you fixed it :)

@jakeboone02
Copy link
Contributor Author

I've asked for an option in Bun Test to ignore certain files (like Jest or Vitest) in bun's discord before. I've even made jokes about that. Thanks @jakeboone02, instead of complaining like I did, you fixed it :)

To be fair, I did complain about it before I did anything about it. :)

Now if I could only get those CI tests passing... I'm not sure what's going on. They pass on my machine!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add bun:test option similar to Jest's coveragePathIgnorePatterns
3 participants