Skip to content

Commit

Permalink
Play nice with the matrix-based Actions workflow running the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yoannchaudet committed Sep 13, 2024
1 parent 9560b2c commit efc04d6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion script/test-redirections
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def start_server(port, location)
client = server.accept

# Append a hit in the file
File.open('/tmp/bad-redirection.log', 'a') do |file|
File.open("/tmp/bad-redirection#{ENV["RUBY_VERSION"]}.log", 'a') do |file|
file.print("HIT #{port} ")
end

Expand Down
7 changes: 4 additions & 3 deletions spec/github_pages_health_check/domain_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -664,11 +664,13 @@
end

context "Protocol redirections" do
let(:log_file) { "/tmp/bad-redirection.log" }
let(:log_file) { "/tmp/bad-redirection#{ENV["RUBY_VERSION"]}.log" }
before do
File.open(log_file, "w") # truncate log file
end

it "it follows ftp if requested" do
# Make a real request to a local server started with /script/test-redirections
File.open(log_file, "w") # truncate log file
Typhoeus.get(
"http://localhost:9988",
GitHubPages::HealthCheck.typhoeus_options.merge(:redir_protocols => %i[http https ftp])
Expand All @@ -680,7 +682,6 @@

it "it does not follow anything other than http/https by default" do
# Make a real request to a local server started with /script/test-redirections
File.open(log_file, "w") # truncate log file
Typhoeus.get(
"http://localhost:9988",
GitHubPages::HealthCheck.typhoeus_options
Expand Down

0 comments on commit efc04d6

Please sign in to comment.