mirror of
https://github.com/HoneyryderChuck/httpx.git
synced 2025-10-04 00:00:37 -04:00
adding smoke tests layer
mostly testing ipv6 connectivity now
This commit is contained in:
parent
ec27524a3a
commit
8fd2f4316a
@ -121,6 +121,22 @@ regression tests:
|
||||
- bundle install
|
||||
script:
|
||||
- bundle exec rake regression_tests
|
||||
smoke_tests:
|
||||
image: "ruby:3.3"
|
||||
variables:
|
||||
BUNDLE_WITHOUT: lint:assorted
|
||||
CI: 1
|
||||
COVERAGE_KEY: "$RUBY_ENGINE-$RUBY_VERSION-smoke-tests"
|
||||
artifacts:
|
||||
paths:
|
||||
- coverage/
|
||||
stage: test
|
||||
before_script:
|
||||
- host example.com
|
||||
- apt-get update && apt-get install -y libmagic-dev shared-mime-info
|
||||
- bundle install
|
||||
script:
|
||||
- bundle exec rake smoke_tests
|
||||
|
||||
coverage:
|
||||
coverage: '/Coverage: \d+.\d+\%/'
|
||||
|
@ -14,6 +14,7 @@ AllCops:
|
||||
- regression_tests/**/*.rb
|
||||
- integration_tests/**/*.rb
|
||||
- standalone_tests/**/*.rb
|
||||
- smoke_tests/**/*.rb
|
||||
- Rakefile
|
||||
- httpx.gemspec
|
||||
- profiler/**/*
|
||||
|
7
Rakefile
7
Rakefile
@ -24,6 +24,13 @@ Rake::TestTask.new(:regression_tests) do |t|
|
||||
t.warning = false
|
||||
end
|
||||
|
||||
desc "smoke tests for core features not in main tests"
|
||||
Rake::TestTask.new(:smoke_tests) do |t|
|
||||
t.libs = %w[lib test]
|
||||
t.pattern = "smoke_tests/**/*_test.rb"
|
||||
t.warning = false
|
||||
end
|
||||
|
||||
RUBY_MAJOR_MINOR = RUBY_VERSION.split(".").first(2).join(".")
|
||||
|
||||
begin
|
||||
|
26
smoke_tests/happy_eyeballs_test.rb
Normal file
26
smoke_tests/happy_eyeballs_test.rb
Normal file
@ -0,0 +1,26 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "test_helper"
|
||||
require "support/http_helpers"
|
||||
|
||||
# https://test-ipv6.com/
|
||||
class HappyEyeballsTest < Minitest::Test
|
||||
include HTTPHelpers
|
||||
|
||||
IPV6_HOST = "https://ipv6.test-ipv6.com"
|
||||
IPV4_HOST = "https://ipv4.test-ipv6.com"
|
||||
|
||||
def test_happy_eyeballs_prefer_ipv6
|
||||
response = HTTPX.get(IPV6_HOST)
|
||||
verify_status(response, 200)
|
||||
peer_address = response.peer_address
|
||||
assert peer_address.ipv6?
|
||||
end
|
||||
|
||||
def test_happy_eyeballs_prefer_ipv4
|
||||
response = HTTPX.get(IPV4_HOST)
|
||||
verify_status(response, 200)
|
||||
peer_address = response.peer_address
|
||||
assert peer_address.ipv4?
|
||||
end
|
||||
end
|
Loading…
x
Reference in New Issue
Block a user