GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Rely on derived metadata for integration specs · lostisland/faraday@161010c

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • .ai
    • guidelines.md
  • .github
    • CONTRIBUTING.md
  • spec/integration/options
    • connection_options_integration_spec.rb
    • env_integration_spec.rb
    • proxy_options_integration_spec.rb
    • request_options_integration_spec.rb
    • ssl_options_integration_spec.rb
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎.ai/guidelines.md‎

Copy file name to clipboardExpand all lines: .ai/guidelines.md
+1-1Lines changed: 1 addition & 1 deletion
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ These guidelines ensure all AI agents (Copilot, Claude, Cursor, etc.) contribute
3232

3333
### Integration Tests
3434
Specs under `spec/integration/` exercise the Options classes (`RequestOptions`, `SSLOptions`, `ProxyOptions`, `ConnectionOptions`, `Env`) with real HTTP requests, to catch behavior changes when the options are refactored (see `docs/options-detach-plan.md`). Details for humans are in `.github/CONTRIBUTING.md`.
35-
- One file per class in `spec/integration/options/<name>_integration_spec.rb`. Files in `spec/integration/` are automatically tagged `type: :integration`, which includes `Faraday::IntegrationHelpers` and disables WebMock.
35+
- One file per class in `spec/integration/options/<name>_integration_spec.rb`. Files in `spec/integration/` are automatically tagged `type: :integration`, which includes `Faraday::IntegrationHelpers` and disables WebMock. Never add `type: :integration` explicitly to the spec files.
3636
- Run them with `bin/integration-tests [rspec args]` (needs Docker), which starts the same service containers as `.github/workflows/integration-tests.yml`. Specs that only need httpbin can run with `HTTPBIN_URL=... COVERAGE=false bundle exec rspec spec/integration`. `act` cannot run the workflow.
3737
- Off-the-shelf servers run as **service containers** in the workflow's container job (`httpbin`, and the mitmproxy forward proxies `proxy` and `auth-proxy`), reached by service name through `HTTPBIN_URL`, `PROXY_URL` and `AUTH_PROXY_URL` (defined in `spec/support/integration_helper.rb`). Service containers can't be built from the repository, so avoid scenarios needing custom images. When adding or changing one, also update the readiness checks in the workflow and `bin/integration-tests`.
3838
- Anything needing per-run configuration is an in-process helper in `spec/support/integration/` (e.g. `TestPKI` and `TLSServer` for TLS and mutual TLS). Start it in `before(:context)` and stop it in `after(:context)`. Do not implement servers we would have to maintain (such as a proxy) when a service container can do the job, and never commit certificates or keys.
Collapse file

‎.github/CONTRIBUTING.md‎

Copy file name to clipboardExpand all lines: .github/CONTRIBUTING.md
+3-2Lines changed: 3 additions & 2 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,9 @@ $ HTTPBIN_URL=http://localhost:8099 COVERAGE=false bundle exec rspec spec/integr
8787

8888
#### Adding integration tests
8989

90-
1. Add a `spec/integration/options/<name>_integration_spec.rb` file with `type: :integration`
91-
(files in `spec/integration/` are tagged automatically, which also disables WebMock for them).
90+
1. Add a `spec/integration/options/<name>_integration_spec.rb` file. Don't add
91+
`type: :integration` yourself: files in `spec/integration/` are tagged automatically from their location,
92+
which also includes the helpers and disables WebMock for them.
9293
2. Use the helpers from `spec/support/integration_helper.rb`, e.g. `httpbin_connection(options)`.
9394
3. Test behavior through real requests and assert on what the server saw (httpbin echoes the request),
9495
not on Faraday internals. Each example must be independent of the others.
Collapse file

‎spec/integration/options/connection_options_integration_spec.rb‎

Copy file name to clipboardExpand all lines: spec/integration/options/connection_options_integration_spec.rb
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# frozen_string_literal: true
22

3-
RSpec.describe Faraday::ConnectionOptions, type: :integration do
3+
RSpec.describe Faraday::ConnectionOptions do
44
# Generating RSA keys is slow, so the PKI and HTTPS server are shared by the group.
55
before(:context) do
66
@pki = Faraday::IntegrationHelpers::TestPKI.new
Collapse file

‎spec/integration/options/env_integration_spec.rb‎

Copy file name to clipboardExpand all lines: spec/integration/options/env_integration_spec.rb
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# frozen_string_literal: true
22

3-
RSpec.describe Faraday::Env, type: :integration do
3+
RSpec.describe Faraday::Env do
44
# Middleware that hands the env to a block when the request goes out and when
55
# the response comes back.
66
def env_middleware(on_request: nil, on_complete: nil)
Collapse file

‎spec/integration/options/proxy_options_integration_spec.rb‎

Copy file name to clipboardExpand all lines: spec/integration/options/proxy_options_integration_spec.rb
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# The proxies run as service containers (see .github/workflows/integration-tests.yml).
44
# Specs check that a request went through a proxy by the address its target saw:
55
# httpbin echoes it as `origin`, TLSServer as `remote_ip`.
6-
RSpec.describe Faraday::ProxyOptions, type: :integration do
6+
RSpec.describe Faraday::ProxyOptions do
77
# Generating RSA keys is slow, so the PKI and HTTPS server are shared by the group.
88
# The HTTPS server is addressed by the hostname of the job container, which the
99
# proxies can reach. It is not a loopback address either, which matters because
Collapse file

‎spec/integration/options/request_options_integration_spec.rb‎

Copy file name to clipboardExpand all lines: spec/integration/options/request_options_integration_spec.rb
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# frozen_string_literal: true
22

3-
RSpec.describe Faraday::RequestOptions, type: :integration do
3+
RSpec.describe Faraday::RequestOptions do
44
describe 'timeout option' do
55
it 'raises TimeoutError when request exceeds timeout' do
66
conn = httpbin_connection(request: { timeout: 1 })
Collapse file

‎spec/integration/options/ssl_options_integration_spec.rb‎

Copy file name to clipboardExpand all lines: spec/integration/options/ssl_options_integration_spec.rb
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# frozen_string_literal: true
22

3-
RSpec.describe Faraday::SSLOptions, type: :integration do
3+
RSpec.describe Faraday::SSLOptions do
44
# Generating RSA keys is slow, so the PKI and servers are shared by the group.
55
before(:context) do
66
@pki = Faraday::IntegrationHelpers::TestPKI.new

0 commit comments

Comments
0 (0)
You are visitor 01402605 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.