Skip to content

Conversation

pirj
Copy link
Member

@pirj pirj commented Aug 6, 2025

We used to sandbox everything, but it turns out that deprecations (RSpec.deprecate("anything")) were swallowed, as the temporary config has no deprecation stream set, or stderr is masked.
Found here #2849 (comment)

We're almost back to square one with deprecations as we were before #2365

However, I'm not entirely happy with this approach. We still mute deprecations for those Rails-related example group specs and a few others, and there are chances deprecations will pop up there eventually.

❓ Would it be better to replay the configuration block on top of the sandboxed configuration? Probably not, and it might not work if stderr is intercepted.

Please consider this WIP

@JonRowe
Copy link
Member

JonRowe commented Aug 8, 2025

I'm on the fence as to which is better, sandboxing examples we know are examples or just everything, but we should at least extend the sandboxed config to not swallow output...

pirj added 3 commits September 3, 2025 22:37
We used to sandbox everything, but it turns out that deprecations were
swallowed, as the temporary config has no deprecation stream set, or
stderr is masked.
    RuntimeError:
       Warnings were generated: /home/runner/work/rspec-rails/rspec-rails/lib/rspec/rails/matchers/have_http_status.rb:219: warning: Status code :unprocessable_entity is deprecated and will be removed in a future version of Rack. Please use :unprocessable_content instead.
Alternatively, we can set

  sandbox_config.deprecation_stream = real_deprecation_stream

but this seems unnecessary.
@pirj pirj force-pushed the reduce-sandboxing-to-fix-missed-deprecation-reports branch from 3086f85 to c886a46 Compare September 3, 2025 19:37
@pirj
Copy link
Member Author

pirj commented Sep 3, 2025

we should at least extend the sandboxed config to not swallow output

@JonRowe Done

@pirj pirj self-assigned this Sep 3, 2025
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