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

rspec crash on test failure #15

Open
pderouen opened this issue Mar 4, 2021 · 7 comments
Open

rspec crash on test failure #15

pderouen opened this issue Mar 4, 2021 · 7 comments
Assignees
Labels

Comments

@pderouen
Copy link
Member

pderouen commented Mar 4, 2021

Rspec crashes when a test fails. Commenting out this line prevents the crash and doesn't appear to affect functionality at all

require "rspec/legacy_formatters"

@info-rchitect
Copy link
Member

@pderouen We shouldn't need legacy formatters, I removed this line in all of my apps. Everyone else agree?

@pderouen
Copy link
Member Author

pderouen commented Mar 4, 2021

It sure seems like it's not necessary. But, I don't know what it's use would be. Unless there's a need to investigate further, I will submit a pull request to remove legacy formatters so that new apps don't start their life with runtime errors when a spec test fails.

@redxeth
Copy link
Member

redxeth commented Jun 28, 2021

Hi all-- am seeing this also in my latest PR on origentesters. Should we comment it out in spec_helper.rb ?

@redxeth
Copy link
Member

redxeth commented Jun 28, 2021

Tried doing what is being done in origen core here, which works fine when running origen specs with a forced failure (fails without crash). But can't run a specific spec now with rspec (e.g. rspec spec/atp/flow_spec.rb) as it doesn't recognize RSpec::Version. Nice to be able to run rspec on individual files when debugging things.

@priyavadan
Copy link
Member

priyavadan commented Jun 28, 2021

# require "rspec/legacy_formatters"
require 'rspec/expectations'
extend RSpec::Matchers
require "#{Origen.top}/spec/format/origen_formatter"

This is probably what needs to happen for things to play nicely with the latest Rspec, can you give it a try @redxeth

@redxeth
Copy link
Member

redxeth commented Jun 28, 2021

Actually figured out that :

require "rspec/legacy_formatters" if Gem::Version.new(RSpec::Core::Version::STRING) < Gem::Version.new('3.0.0')

works great!

Origen core must be loading rspec but most apps don't (they load rspec_core directly?).

redxeth added a commit to Origen-SDK/origen_testers that referenced this issue Jun 28, 2021
for older versions of rspec_core.

This was causing crashes upon spec fail.

refer to Origen-SDK/origen_app_generators#15
@redxeth
Copy link
Member

redxeth commented Jun 28, 2021

@pderouen should we test out my fix on another app before deciding to PR the app generator and update it to support?

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

No branches or pull requests

5 participants