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

Remove redundant Capybara config #1128

Merged

Conversation

cpjmcquillan
Copy link
Contributor

Capybara was configured to silence Puma in #981 to prevent Puma
startup messages being output when running specs with js: true.

This configuration has since been updated in rspec-rails, so we can
remove it here.

Capybara was configured to silence Puma in thoughtbot#981 to prevent Puma startup messages
being output when running specs with `js: true`.

This configuration has since been updated in
[rspec-rails](rspec/rspec-rails#2289), so we can remove
it here.
@stevepolitodesign
Copy link
Contributor

@cpjmcquillan thank you for opening this, and for linking to the relevant references. I cloned this branch locally, and spun up a system test, but was surprised to see it's still printing the Puma output.

Capybara starting Puma...
* Version 6.2.2 , codename: Speaking of Now
* Min threads: 0, max threads: 4
* Listening on http://127.0.0.1:61759
.

Finished in 0.97806 seconds (files took 0.90548 seconds to load)
1 example, 0 failures

Randomized with seed 4436


Press ENTER or type command to continue

Are you able to replicate the same behavior locally, too? For context, I ran ./bin/suspenders some_app to generate a new Rails app. Additionally, I tried running bundle exec rspec and rails spec, and both printed the Puma logs.

I can see in the generated Gemfile.lock that the generated app is using rspec-rails v5.1.2, so that change should be in there.

@cpjmcquillan
Copy link
Contributor Author

@stevepolitodesign classic me 😂. Thanks, let me dig into this 👍🏼

@cpjmcquillan
Copy link
Contributor Author

Hey @stevepolitodesign, I haven't been able to reproduce what you describe unfortunately 😢

I'm not sure what's going on, but give me a shout if you want to pair on this some time 👍


I did an experiment of sorts:

  1. Generate a new app using suspenders/main
  2. Add a basic page and system test
# spec/system/test_spec.rb
require "rails_helper"

RSpec.describe "Test", type: :system, js: true do
  it "works!" do
    visit page_path("test")

    expect(page).to have_content("Hello, world!")
  end
end
<%# app/views/pages/test.html.erb %>

Hello, world
  1. Run the test
Randomized with seed 53549
2023-05-26 16:27:26 WARN Selenium [:headless] [DEPRECATION] `Options#headless!` is deprecated. Use `Options#add_argument('--headless=new')` instead.
.

Finished in 1.12 seconds (files took 0.99588 seconds to load)
1 example, 0 failures
  1. Comment out the code in spec/support/capybara_silence_puma.rb
  2. Run the test
Randomized with seed 53238
2023-05-26 16:28:38 WARN Selenium [:headless] [DEPRECATION] `Options#headless!` is deprecated. Use `Options#add_argument('--headless=new')` instead.
.

Finished in 0.91017 seconds (files took 0.82109 seconds to load)
1 example, 0 failures
  1. Change the code in spec/support/capybara_silence_puma.rb
Capybara.server = :puma, {Silent: false}
  1. Run the test
Randomized with seed 59945
2023-05-26 16:29:39 WARN Selenium [:headless] [DEPRECATION] `Options#headless!` is deprecated. Use `Options#add_argument('--headless=new')` instead.
Capybara starting Puma...
* Version 6.2.2 , codename: Speaking of Now
* Min threads: 0, max threads: 4
* Listening on http://127.0.0.1:49878
.

Finished in 1.03 seconds (files took 0.80008 seconds to load)
1 example, 0 failures

@stevepolitodesign stevepolitodesign merged commit cc924a1 into thoughtbot:main May 27, 2023
1 check passed
@stevepolitodesign
Copy link
Contributor

@cpjmcquillan I'm not sure what was the issue on my end, but I just regenerated a new app from this branch, and I did not see the Puma output in the console 🎉

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.

None yet

3 participants