Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/smoke-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Smoke Test

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
smoke:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2"

# The gemspec pins bundler ~> 2.3.20, which conflicts with newer
# system bundler versions during dependency resolution.
- name: Install pinned bundler version
run: gem install bundler -v 2.3.27 --no-document

- name: Install dependencies
run: bundle _2.3.27_ install

# Uses the same connection options flywheel-app actually configures in
# production (request: :basic_auth) rather than this gem's own broken
# defaults - see README "Known Issues".
- name: Verify the gem builds a working connection
run: |
bundle _2.3.27_ exec ruby -Ilib -e '
require "webpagetest"
options = {
request: :basic_auth,
response: :logger,
adapter: :net_http,
url: "https://example.com",
user: "smoke-test-user",
pass: "smoke-test-pass"
}
client = Webpagetest::Client.new(k: "demo", options: options)
raise "connection not built" unless client.connection.is_a?(Faraday::Connection)
puts "Loaded OK, connection built with production-style options"
'
5 changes: 5 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@ source 'https://rubygems.org'

# Specify your gem's dependencies in webpagetest.gemspec
gemspec

# Faraday 2.x removed :basic_auth from core, which this gem's supported usage
# pattern depends on (see README "Known Issues"). Pinned here (dev/test only,
# not the gemspec) so CI reflects the version actually used in production.
gem "faraday", "~> 1.0"
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ Features included on the original gem (as of 2015):

This gem is inspired by [Susuwatari](https://github.com/moviepilot/susuwatari) gem, so several ideas were taken from there (it's like a rewrite with some modifications).

## Known Issues

`Webpagetest::Connection#get_connection` always calls `faraday.request options.request, options.user, options.pass`, passing `user`/`pass` as positional arguments regardless of which Faraday request middleware is configured. This is only valid for `:basic_auth`-style middleware; other middleware (including this gem's own default, `:url_encoded`) doesn't accept those extra arguments and raises `ArgumentError: wrong number of arguments`.

**In practice:** as long as you always pass connection options with `request: :basic_auth` and real `user`/`pass` values (as shown in [Set up connection options for request](#set-up-connection-options-for-request) below), you won't hit this. It only breaks if you instantiate `Webpagetest::Client`/`Webpagetest.new` without custom `options:` (falling back to this gem's own defaults), or otherwise configure a request middleware other than `:basic_auth`.

## Installation

Expand Down
Loading