titusfortner / webdrivers

Keep your Selenium WebDrivers updated automatically
MIT License
593 stars 111 forks source link

UnhandledHTTPRequestError for geckodriver-v0.29.0-linux64.tar.gz #204

Closed jankeesvw closed 3 years ago

jankeesvw commented 3 years ago

Summary

When I'm running our test suite on GitHub actions VCR halts with this error:

VCR::Errors::UnhandledHTTPRequestError:

  ================================================================================
  An HTTP request has been made that VCR does not know how to handle:
    GET https://github-releases.githubusercontent.com/25354393/37547e00-5662-***eb-95f2-d6546c8***4ac9?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A/202***0***28/us-east-***/s3/aws4_request&X-Amz-Date=202***0***28T202626Z&X-Amz-Expires=300&X-Amz-Signature=0c06866d2aeee4f***3***ae8***38ac55322d***995cd3***9***aaff44b6489bcd782ac66e&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=25354393&response-content-disposition=attachment%3B%20filename=geckodriver-v0.29.0-linux64.tar.gz&response-content-type=application/octet-stream

Debug Info

Please provide the following information for bug reports:

Expected Behavior

I would expect the tests to pass.

Currently applied patch:

driver_hosts = Webdrivers::Common.subclasses.map { |driver| URI(driver.base_url).host }
driver_hosts += ["github-releases.githubusercontent.com"] # this is added
VCR.configure { |config| config.ignore_hosts(*driver_hosts) }

driver_urls = Webdrivers::Common.subclasses.map(&:base_url)
WebMock.disable_net_connect!(allow_localhost: true, allow: driver_urls)

I would love to patch this myself, can anyone tell me where to provide this URL?

I suspect it's here:

https://github.com/titusfortner/webdrivers/blob/06b2a4a3ce95f17b27c4678ecdcae3f78297b02b/lib/webdrivers/geckodriver.rb#L35-L37

titusfortner commented 3 years ago

I think you're just getting a redirect from: https://github.com/mozilla/geckodriver/releases/download/v0.29.0/geckodriver-v0.29.0-linux64.tar.gz

You can turn on logging Webdrivers.logger.level = :debug and it should output exactly which network calls are getting made.

jankeesvw commented 3 years ago

That sounds very plausible. Should your gem accommodate for this behavior?

kapoorlakshya commented 3 years ago

@jankeesvw I don't think supporting WebMock is within the direct scope of this project, so we would appreciate it if you could update the Wiki page with your patch: https://github.com/titusfortner/webdrivers/wiki/Using-with-VCR-or-WebMock (should be publicly editable)

jankeesvw commented 3 years ago

@jankeesvw I don't think supporting WebMock is within the direct scope of this project, so we would appreciate it if you could update the Wiki page with your patch: https://github.com/titusfortner/webdrivers/wiki/Using-with-VCR-or-WebMock (should be publicly editable)

I will, thanks.