Compare commits

..

No commits in common. "84f5b303f268f721d0f98d2864544715dc4abc67" and "2eb81851232478f724685dd7fdd84059276737b8" have entirely different histories.

5 changed files with 14 additions and 59 deletions

View File

@ -27,6 +27,11 @@ variables:
paths: paths:
- coverage/ - coverage/
.jit_matrix: &jit_matrix
parallel:
matrix:
- RUBYOPT: ["", "--jit --jit-warnings --jit-wait"]
.yjit_matrix: &yjit_matrix .yjit_matrix: &yjit_matrix
parallel: parallel:
matrix: matrix:
@ -71,16 +76,19 @@ test ruby 2/5:
./spec.sh ruby 2.5 ./spec.sh ruby 2.5
test ruby 2/6: test ruby 2/6:
<<: *test_settings <<: *test_settings
<<: *jit_matrix
only: only:
- master - master
script: script:
./spec.sh ruby 2.6 ./spec.sh ruby 2.6
test ruby 2/7: test ruby 2/7:
<<: *test_settings <<: *test_settings
<<: *jit_matrix
script: script:
./spec.sh ruby 2.7 ./spec.sh ruby 2.7
test ruby 3/0: test ruby 3/0:
<<: *test_settings <<: *test_settings
<<: *jit_matrix
script: script:
./spec.sh ruby 3.0 ./spec.sh ruby 3.0
test ruby 3/1: test ruby 3/1:
@ -88,11 +96,6 @@ test ruby 3/1:
<<: *yjit_matrix <<: *yjit_matrix
script: script:
./spec.sh ruby 3.1 ./spec.sh ruby 3.1
test ruby 3/2:
<<: *test_settings
<<: *yjit_matrix
script:
./spec.sh ruby 3.2
test truffleruby: test truffleruby:
<<: *test_settings <<: *test_settings
script: script:
@ -105,7 +108,7 @@ coverage:
variables: variables:
BUNDLE_WITHOUT: test:assorted BUNDLE_WITHOUT: test:assorted
image: "ruby:3.2" image: "ruby:3.1"
script: script:
- gem install simplecov --no-doc - gem install simplecov --no-doc
# this is a workaround, because simplecov doesn't support relative paths. # this is a workaround, because simplecov doesn't support relative paths.
@ -127,7 +130,7 @@ docs:
stage: deploy stage: deploy
needs: needs:
- coverage - coverage
image: "ruby:3.2" image: "ruby:3.1"
before_script: before_script:
- gem install hanna-nouveau - gem install hanna-nouveau
script: script:

View File

@ -1,27 +0,0 @@
version: '3'
services:
httpx:
image: ruby:3.1
environment:
- HTTPBIN_COALESCING_HOST=another
- HTTPX_RESOLVER_URI=https://doh/dns-query
links:
- "nghttp2:another"
depends_on:
- doh
doh:
image: registry.gitlab.com/os85/httpx/nghttp2:1
depends_on:
- doh-proxy
entrypoint:
/usr/local/bin/nghttpx
volumes:
- ./test/support/ci:/home
command:
--conf /home/doh-nghttp.conf --no-ocsp --frontend '*,443'
doh-proxy:
image: publicarray/doh-proxy
environment:
- "UNBOUND_SERVICE_HOST=127.0.0.11"

View File

@ -210,13 +210,9 @@ module Faraday
if parallel?(env) if parallel?(env)
handler = env[:parallel_manager].enqueue(env) handler = env[:parallel_manager].enqueue(env)
handler.on_response do |response| handler.on_response do |response|
if response.is_a?(::HTTPX::Response) response.raise_for_status
save_response(env, response.status, response.body.to_s, response.headers, response.reason) do |response_headers| save_response(env, response.status, response.body.to_s, response.headers, response.reason) do |response_headers|
response_headers.merge!(response.headers) response_headers.merge!(response.headers)
end
else
env[:error] = response.error
save_response(env, 0, "", {}, nil)
end end
end end
return handler return handler
@ -233,7 +229,6 @@ module Faraday
request.response_on_data = env.request.on_data if env.request.stream_response? request.response_on_data = env.request.on_data if env.request.stream_response?
response = session.request(request) response = session.request(request)
# do not call #raise_for_status for HTTP 4xx or 5xx, as faraday has a middleware for that.
response.raise_for_status unless response.is_a?(::HTTPX::Response) response.raise_for_status unless response.is_a?(::HTTPX::Response)
save_response(env, response.status, response.body.to_s, response.headers, response.reason) do |response_headers| save_response(env, response.status, response.body.to_s, response.headers, response.reason) do |response_headers|
response_headers.merge!(response.headers) response_headers.merge!(response.headers)

View File

@ -29,22 +29,6 @@ class FaradayTest < Minitest::Test
assert_equal "OK", resp2.reason_phrase assert_equal "OK", resp2.reason_phrase
end end
def test_adapter_in_parallel_errors
resp1 = nil
connection = create_connection
connection.in_parallel do
resp1 = connection.get("http://wfijojsfsoijf")
assert connection.in_parallel?
assert_nil resp1.reason_phrase
end
assert !connection.in_parallel?
assert_equal 0, resp1.status
assert_nil resp1.reason_phrase
assert_equal "", resp1.body
refute_nil resp1.env[:error]
end
def test_adapter_get_handles_compression def test_adapter_get_handles_compression
res = get(build_path("/gzip")) res = get(build_path("/gzip"))
assert JSON.parse(res.body.to_s)["gzipped"] assert JSON.parse(res.body.to_s)["gzipped"]

View File

@ -82,7 +82,7 @@ if [[ ${RUBY_VERSION:0:1} = "3" ]] && [[ ! $RUBYOPT =~ "jit" ]]; then
fi fi
# Lint first # Lint first
if [[ ${RUBY_VERSION:0:3} = "3.2" ]] && [[ "$RUBY_ENGINE" = "ruby" ]]; then if [[ ${RUBY_VERSION:0:3} = "3.1" ]] && [[ "$RUBY_ENGINE" = "ruby" ]]; then
bundle exec rake rubocop bundle exec rake rubocop
fi fi