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

Passing tests appear to have failed #24

Open
jar349 opened this issue Mar 20, 2024 · 3 comments
Open

Passing tests appear to have failed #24

jar349 opened this issue Mar 20, 2024 · 3 comments

Comments

@jar349
Copy link

jar349 commented Mar 20, 2024

In a terminal, running: bundle exec rspec runs all my tests in ./spec and they all pass.

In the Testing pane of VS Code, I run some tests and they pass but appear visibly to have failed. See the image below and note the 1 example, 0 failures

Image

I have this in the development group of my Gemfile:

  gem "ruby-lsp", "~> 0.14.3"
  gem "ruby-lsp-rspec", "~> 0.1.10"
@jar349
Copy link
Author

jar349 commented Mar 20, 2024

I suspect that this may be due to this:

Image

note:

Line coverage (27.16%) is below the expected minimum coverage (100.00%).
SimpleCov failed with exit 2 due to a coverage related error

The problem I have is that SimpleCov is configured in ./specs/spec_helper.rb to require full coverage:

SimpleCov.minimum_coverage 100

But with ruby-lsp-rspec, there doesn't seem to be a way to just run all tests? The code lenses are contextual in a single file. I need a way to run all tests so that my coverage will be at 100% and rspec will exit with code zero.

@jar349
Copy link
Author

jar349 commented Apr 4, 2024

So the problem I have with only being able to run the tests from a code lens is that I don't have a way to run ALL the tests in my repo at once, which means my coverage metrics will always fail my tests.

Would it be possible to add a way to run all the tests in a repo?

@malcolmohare
Copy link

Is there a way to provide an ENV for the CodeLens to include in the test invocation? Then you could gate the simplecov config with something like ENV['SIMPLECOV_DISABLED'] == true. Right now I've just done that via .env file that differs from my CI one, but it'd be cleaner if its something I could configure for the VS Code workspace instead.

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

No branches or pull requests

2 participants