Skip to content

Commit

Permalink
Fixed tests, added minitest-retry to make DNSLookupTest more stable.
Browse files Browse the repository at this point in the history
  • Loading branch information
jclusso committed Feb 16, 2024
1 parent 3330dd9 commit f8b1718
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,4 @@ gem "tailwindcss-rails", "~> 2.3"

gem "dockerfile-rails", ">= 1.6", group: :development
gem "dnsruby"
gem "minitest-retry"
3 changes: 3 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ GEM
matrix (0.4.2)
mini_mime (1.1.5)
minitest (5.21.2)
minitest-retry (0.2.2)
minitest (>= 5.0)
msgpack (1.7.2)
net-imap (0.4.10)
date
Expand Down Expand Up @@ -314,6 +316,7 @@ DEPENDENCIES
dnsruby
dockerfile-rails (>= 1.6)
importmap-rails
minitest-retry
pg (~> 1.1)
puma (>= 5.0)
rails!
Expand Down
6 changes: 3 additions & 3 deletions test/lib/dns_lookup_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def test_cert

def test_cname
assert_equal(
[{ type: 'CNAME', address: 'cnamev.testing.d53.co' }],
[{ type: 'CNAME', name: 'cnamev.testing.d53.co' }],
get_answer('cname.testing.d53.co', 'CNAME')
)
end
Expand Down Expand Up @@ -119,14 +119,14 @@ def test_ns

def test_ptr_domain
assert_equal(
[{ type: 'PTR', address: 'ptrv.testing.d53.co' }],
[{ type: 'PTR', name: 'ptrv.testing.d53.co' }],
get_answer('ptr.testing.d53.co', 'PTR')
)
end

def test_ptr_ip
assert_equal(
[{ type: 'PTR', address: 'dns.google' }],
[{ type: 'PTR', name: 'dns.google' }],
get_answer('8.8.4.4', 'PTR')
)
end
Expand Down
2 changes: 2 additions & 0 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
ENV["RAILS_ENV"] ||= "test"
require_relative "../config/environment"
require "rails/test_help"
require "minitest/retry"
Minitest::Retry.use!

module ActiveSupport
class TestCase
Expand Down

0 comments on commit f8b1718

Please sign in to comment.