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

Fix the bisect runner breaking the output expectation #3113

Closed
wants to merge 1 commit into from

Conversation

jdelStrother
Copy link

The bisect runner sets $stdout & $stderr to a StringIO. If your specs include output.to_stdout_from_any_process or output.to_stderr_from_any_process, CaptureStreamToTempfile would then introduce new errors during the bisect run, failing with can't convert Tempfile into StringIO here

Here's one approach, which instead sets $stdout & $stderr to a Tempfile. WDYT? I know previously we've wanted to avoid adding a dependency on tempfile ... we could instead try fixing this at the rspec-expectations level, though not sure how feasible that is.

When using `output.to_std{out,err}_from_any_process`,
CaptureStreamToTempfile would fail under the bisect runner with `can't convert Tempfile into StringIO`
@JonRowe
Copy link
Member

JonRowe commented Sep 19, 2024

I would rather fix this in the matcher, as hard as that might be to test, if we go down this route I'd also want to benchmark the performance given I suspect a file is slower than an in memory string

@jdelStrother
Copy link
Author

Fair enough. See what you think to rspec/rspec-expectations#1486

@JonRowe JonRowe closed this Sep 20, 2024
@JonRowe
Copy link
Member

JonRowe commented Sep 20, 2024

I'm closing this PR because of my earlier concerns, especially given the comment on the matcher itself about being 30x slower and the ever present desire not to require things, I will continue feedback on the other PR, thanks!

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.

2 participants