Skip to content

Commit 543672a

Browse files
committed
Fix minitest on CI
1 parent 3aaf4c3 commit 543672a

File tree

3 files changed

+27
-20
lines changed

3 files changed

+27
-20
lines changed

.github/workflows/tests.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -555,6 +555,15 @@ jobs:
555555
logs/*
556556
test/**/*.{log,xml}
557557
retention-days: 5
558+
- name: Upload crash logs
559+
if: failure()
560+
uses: actions/upload-artifact@v4
561+
with:
562+
name: ${{ github.job }}-${{ github.run_attempt }}-${{ matrix.ruby }}-crash
563+
path: |
564+
~/Library/Logs/DiagnosticReports/
565+
/Library/Logs/DiagnosticReports/
566+
retention-days: 5
558567
- name: Publish Test Report
559568
uses: mikepenz/action-junit-report@v4.1.0
560569
if: always()
@@ -616,6 +625,15 @@ jobs:
616625
logs/*
617626
test/**/*.{log,xml}
618627
retention-days: 5
628+
- name: Upload crash logs
629+
if: failure()
630+
uses: actions/upload-artifact@v4
631+
with:
632+
name: ${{ github.job }}-${{ github.run_attempt }}-${{ matrix.ruby }}-crash
633+
path: |
634+
~/Library/Logs/DiagnosticReports/
635+
/Library/Logs/DiagnosticReports/
636+
retention-days: 5
619637
- name: Publish Test Report
620638
uses: mikepenz/action-junit-report@v4.1.0
621639
if: always()

Gemfile

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ group :development do
3030
gem "gem-compiler"
3131
gem "grpc-tools", "~> 1.59"
3232
gem "heckle"
33-
gem "minitest"
33+
gem "httpclient"
34+
gem "minitest", "< 6.0"
3435
gem "minitest-reporters"
3536
gem "mutex_m"
3637
gem "rack"
@@ -44,15 +45,4 @@ group :development do
4445
gem "ruby-lsp", require: false
4546
gem "simplecov-cobertura"
4647
gem "yard"
47-
48-
# Resolves https://github.com/ruby/openssl/issues/949 which we encounter when downloading gocaves on macOS on CI
49-
# This has been fixed in openssl versions 3.1.2, 3.2.2, 3.3.1.
50-
# The latest dot-patch version of Ruby 3.3 and 3.4 now comes with a new enough openssl version by default.
51-
if RUBY_PLATFORM.include?("darwin")
52-
if RUBY_VERSION.start_with?('3.2')
53-
gem "openssl", "~> 3.2.2"
54-
elsif RUBY_VERSION.start_with?('3.1')
55-
gem "openssl", "~> 3.1.2"
56-
end
57-
end
5848
end

test/mock_helper.rb

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,28 +20,27 @@
2020
require "fileutils"
2121
require "tmpdir"
2222
require "socket"
23+
require "httpclient"
2324

2425
class Caves
2526
attr_accessor :verbose
2627

27-
VERSION = "v0.0.1-78"
28+
VERSION = "v0.0.1-79"
2829
FORK = "couchbaselabs"
2930

3031
def download_mock(url = caves_url)
3132
return if binary_ready?
32-
3333
puts "download #{url}"
34-
resp = Net::HTTP.get_response(URI.parse(url))
3534

36-
case resp
37-
when Net::HTTPSuccess
38-
raise "Unexpected content type: #{resp['content-type']}" if resp["content-type"] != "application/octet-stream"
35+
client = HTTPClient.new
36+
resp = client.get(url, follow_redirect: true)
3937

38+
case resp.status
39+
when 200..299
40+
raise "Unexpected content type: #{resp.content_type}" if resp.content_type != "application/octet-stream"
4041
FileUtils.mkdir_p(caves_dir, verbose: verbose?)
4142
File.write(mock_path, resp.body, binmode: true)
4243
FileUtils.chmod("a+x", mock_path, verbose: verbose?) unless windows?
43-
when Net::HTTPRedirection
44-
download_mock(resp["location"])
4544
else
4645
raise "Unable to download mock from #{url}: #{resp.status}"
4746
end

0 commit comments

Comments
 (0)