Skip to content

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

@AnkeshThakur

Description

@AnkeshThakur

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions