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

Error is not getting identified. How to detect if there is any error #991

Open
AnkeshThakur opened this issue Feb 24, 2025 · 1 comment
Open

Comments

@AnkeshThakur
Copy link

I have a spec whic is invalid and leads to error. Parallel tests is not able to give the exit code as error. Exit code is same as failure whereas it should be different.

bundle exec parallel_test ./spec/models/category_theme_product_spec.rb -t rspec --verbose --failure-exit-code 5; echo $?
1 process for 1 spec, ~ 1 spec per process
TEST_ENV_NUMBER= PARALLEL_TEST_GROUPS=8 bin/rspec --color --tty -O .rspec_parallel spec/models/category_theme_product_spec.rb
/Users/*/*/*/config/environments/test.rb:76: warning: already initialized constant OpenSSL::SSL::VERIFY_PEER

Finished in 0.00005 seconds (files took 9.77 seconds to load)
0 examples, 0 failures, 1 error occurred outside of examples
Stopped processing SimpleCov as a previous error not related to SimpleCov has been detected
Coverage report generated for (1/8) to /Users/*/*/*/coverage. 22418 / 32318 LOC (69.37%) covered.

1 error, 0 examples, 0 failures


Tests have failed for a parallel_test group. Use the following command to run the group again:

TEST_ENV_NUMBER= PARALLEL_TEST_GROUPS=8 bin/rspec --color --tty -O .rspec_parallel spec/models/category_theme_product_spec.rb

Took 12 seconds
Tests Failed
5

It should give different exit code because it is erroring. Trying with --highest-exit-status is not useful

 bundle exec parallel_test ./spec/models/category_theme_product_spec.rb -t rspec --highest-exit-status; echo $?
1 process for 1 spec, ~ 1 spec per process
/Users/*/*/*/config/environments/test.rb:76: warning: already initialized constant OpenSSL::SSL::VERIFY_PEER

Finished in 0.00006 seconds (files took 10.04 seconds to load)
0 examples, 0 failures, 1 error occurred outside of examples
Stopped processing SimpleCov as a previous error not related to SimpleCov has been detected
Coverage report generated for (1/8) to /Users/*/*/*/coverage. 22418 / 32318 LOC (69.37%) covered.

1 error, 0 examples, 0 failures

Took 12 seconds
Tests Failed
1
@grosser
Copy link
Owner

grosser commented Feb 25, 2025

not sure why that happens, would recommend bundle open parallel_tests and then poke around here

or maybe even simpler write a failed test-case and see if you can reproduce it here

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