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

Disable the Web::Screenshot#process spec when running under GitHub Actions #179

Open
postmodern opened this issue Sep 3, 2024 · 0 comments
Labels
chore You gotta do, what you gotta do
Milestone

Comments

@postmodern
Copy link
Member

postmodern commented Sep 3, 2024

Apparently sometimes the Web::Screenshot#process spec sometimes fails, likely due to memory constraints.

Ferrum::ProcessTimeoutError:
  Browser did not produce websocket url within 10 seconds, try to increase `:process_timeout`. See https://github.com/rubycdp/ferrum#customization
  ./vendor/bundle/ruby/3.2.0/gems/ferrum-0.15/lib/ferrum/browser/process.rb:172:in `parse_ws_url'
  ./vendor/bundle/ruby/3.2.0/gems/ferrum-0.15/lib/ferrum/browser/process.rb:106:in `start'
  ./vendor/bundle/ruby/3.2.0/gems/ferrum-0.15/lib/ferrum/browser.rb:247:in `start'
  ./vendor/bundle/ruby/3.2.0/gems/ferrum-0.15/lib/ferrum/browser.rb:132:in `initialize'
  ./vendor/bundle/ruby/3.2.0/gems/ronin-web-browser-0.1.0/lib/ronin/web/browser/agent.rb:85:in `initialize'
  ./vendor/bundle/ruby/3.2.0/gems/ronin-web-browser-0.1.0/lib/ronin/web/browser.rb:127:in `new'
  ./vendor/bundle/ruby/3.2.0/gems/ronin-web-browser-0.1.0/lib/ronin/web/browser.rb:127:in `new'
  ./lib/ronin/recon/builtin/web/screenshot.rb:71:in `initialize'
  ./spec/builtin/web/screenshot_spec.rb:9:in `new'
  ./spec/builtin/web/screenshot_spec.rb:9:in `block (2 levels) in <top (required)>'
  ./spec/builtin/web/screenshot_spec.rb:25:in `block (3 levels) in <top (required)>'
  ./vendor/bundle/ruby/3.2.0/gems/webmock-3.23.1/lib/webmock/rspec.rb:39:in `block (2 levels) in <top (required)>'

We should check if the specs are currently running under GitHub Actions by checking for an ENV variable (GITHUB_TOKEN?) and call skip "<message here>".

    it "must visit a website and take a screenshot of it" do
      skip "GitHub Actions causes the Ferrum process to timeout sometimes" if ENV['GITHUB_TOKEN']
      ...
    end
@postmodern postmodern added the chore You gotta do, what you gotta do label Sep 3, 2024
@postmodern postmodern added this to the 0.2.0 milestone Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore You gotta do, what you gotta do
Projects
None yet
Development

No branches or pull requests

1 participant