Skip to content

Commit dae7235

Browse files
authored
Drastically speed up test running on CI (#142)
Takes sigstore conformance tests from 5+ minutes locally to 2 Removes jruby since those tests are hopelessly broken and we are not currently making progress on them Signed-off-by: Samuel Giddins <[email protected]>
1 parent 40a5071 commit dae7235

File tree

5 files changed

+17
-11
lines changed

5 files changed

+17
-11
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,15 @@ permissions: {}
1212

1313
jobs:
1414
ruby-versions:
15-
uses: ruby/actions/.github/workflows/ruby_versions.yml@master
15+
uses: ruby/actions/.github/workflows/ruby_versions.yml@3fbf038d6f0d8043b914f923764c61bc2a114a77
1616
with:
17-
engine: all
17+
engine: cruby-truffleruby
1818
min_version: 3.1
1919

2020
test:
2121
needs: ruby-versions
2222
runs-on: ${{ matrix.os }}
2323
name: Test Ruby ${{ matrix.ruby }} / ${{ matrix.os }}
24-
continue-on-error: ${{ startsWith(matrix.ruby, 'jruby') }}
2524
strategy:
2625
fail-fast: false
2726
matrix:
@@ -58,7 +57,6 @@ jobs:
5857
sigstore-conformance:
5958
needs: ruby-versions
6059
runs-on: ${{ matrix.os }}
61-
continue-on-error: ${{ startsWith(matrix.ruby, 'jruby') }}
6260
name: Sigstore Ruby ${{ matrix.ruby }} / ${{ matrix.os }}
6361
strategy:
6462
fail-fast: false
@@ -107,7 +105,6 @@ jobs:
107105
needs: ruby-versions
108106
runs-on: ${{ matrix.os }}
109107
name: TUF Ruby ${{ matrix.ruby }} / ${{ matrix.os }}
110-
continue-on-error: "${{ startsWith(matrix.ruby, 'jruby') }}"
111108
strategy:
112109
fail-fast: false
113110
matrix:

.simplecov

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
SimpleCov.root(__dir__)
44

5-
SimpleCov.start do
6-
enable_coverage :branch unless RUBY_ENGINE == "truffleruby"
5+
if ENV["COVERAGE"]
6+
SimpleCov.start do
7+
enable_coverage :branch unless RUBY_ENGINE == "truffleruby"
8+
end
79
end

bin/conformance-entrypoint

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ ENV.update(
2424
)
2525

2626
load File.expand_path("sigstore-ruby", __dir__)
27-
ARGV.delete("--verify-digest")
28-
Sigstore::CLI.start(ARGV)
27+
28+
Sigstore::CLI.start(ARGV << "--no-update-trusted-root")

bin/sigstore-ruby

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ module Sigstore
5555
option :offline, type: :boolean, desc: "Do not fetch the latest timestamp from the Rekor server"
5656
option :bundle, type: :string, desc: "Path to the signed bundle"
5757
option :trusted_root, type: :string, desc: "Path to the trusted root"
58+
option :update_trusted_root, type: :boolean, desc: "Update the trusted root", default: true
5859
exclusive :bundle, :signature
5960
exclusive :bundle, :certificate
6061
def verify(*files)
@@ -90,6 +91,8 @@ module Sigstore
9091
option :bundle, type: :string, desc: "Path to write the signed bundle to"
9192
option :signature, type: :string, desc: "Path to write the signature to"
9293
option :certificate, type: :string, desc: "Path to the public certificate"
94+
option :trusted_root, type: :string, desc: "Path to the trusted root"
95+
option :update_trusted_root, type: :boolean, desc: "Update the trusted root", default: true
9396
def sign(file)
9497
require "sigstore/signer"
9598

@@ -166,7 +169,11 @@ module Sigstore
166169
def trusted_root
167170
return Sigstore::TrustedRoot.from_file(options[:trusted_root]) if options[:trusted_root]
168171

169-
options[:staging] ? Sigstore::TrustedRoot.staging : Sigstore::TrustedRoot.production
172+
if options[:staging]
173+
Sigstore::TrustedRoot.staging(offline: !options[:update_trusted_root])
174+
else
175+
Sigstore::TrustedRoot.production(offline: !options[:update_trusted_root])
176+
end
170177
end
171178

172179
def collect_verification_state(files)

test/test_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
SimpleCov.configure do
55
add_filter "test/"
66
end
7-
SimpleCov.start
7+
SimpleCov.start if ENV["COVERAGE"]
88

99
$LOAD_PATH.unshift File.expand_path("../lib", __dir__)
1010
require "sigstore"

0 commit comments

Comments
 (0)