-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add integration script and CI for ruby 3.1 and 3.2 #1563
Conversation
aa00d22
to
03b8ff6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(sorry for lurking on a draft)
771ff8c
to
0d9098b
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1563 +/- ##
==========================================
- Coverage 78.76% 78.75% -0.01%
==========================================
Files 598 598
Lines 103683 103683
Branches 14742 14742
==========================================
- Hits 81666 81657 -9
- Misses 21364 21372 +8
- Partials 653 654 +1 ☔ View full report in Codecov by Sentry. |
6cf2b3d
to
365401c
Compare
f69869d
to
26b722a
Compare
85edc6b
to
6bacec1
Compare
44b7edb
to
95cd424
Compare
08773c6
to
66b4176
Compare
66b4176
to
77a48a9
Compare
7f2effd
to
b45eca3
Compare
a6043a3
to
b324a1e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reviewed everything but the patch files this pass. will review those in the next pass.
./install/bin/ruby -e 'require "openssl"; puts OpenSSL::OPENSSL_VERSION' | grep -q "AWS-LC" && echo "AWS-LC found!" || exit 1 | ||
|
||
#TODO: add more relevant tests here | ||
make test-all TESTS="test/openssl/*.rb" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I may be misunderstanding this, but from this PR's most recent CI run, it looks like a different executable than ./install/bin/ruby
is used to execute the tests, namely miniruby
:
test-all
Run options:
--seed=24196
"--ruby=./miniruby -I./lib -I. -I.ext/common ./tool/runruby.rb --extout=.ext -- --disable-gems"
--excludes-dir=./test/excludes
--name=!/memory_leak/
could we patch a test into the OpenSSL module unit tests that asserts OpenSSL::OPENSSL_VERSION.include? 'AWS-LC'
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a test, but we do have a version detection mechanism in the patch:
+ def aws_lc?(major = nil, minor = nil, fix = nil)
+ version = OpenSSL::OPENSSL_VERSION.scan(/AWS-LC (\d+)\.(\d+)\.(\d+).*/)[0]
+ return false unless version
+ !major || (version.map(&:to_i) <=> [major, minor, fix]) >= 0
+ end
It's used throughout the tests to skip across various AWS-LC specific discrepancies. I'm hesitant to add a specific test that asserts AWS-LC. Ultimate end goal is to run this patch down to 0 if upstream is willing to take us. I also think the various bash checks we do and the mentioned version detection should be sufficient.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
miniruby
appears to be minimal lighter version of ruby used in their build. The ruby binary we're asserting in this script is the actual ruby binary that the general consumer uses.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
miniruby appears to be minimal lighter version of ruby used in their build
right. i think we need some way to assert that the miniruby
used to run the tests is actually linked against AWS-LC. otherwise, we might be testing against an OpenSSL-backed miniruby
, which is meaningless to us.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added an assertion for miniruby
edaae75
to
4b9f6f4
Compare
4b9f6f4
to
938d980
Compare
Follow up from #1563 where we add more test coverage for the Ruby/OpenSSL gem. * ruby_release_backport is for any commits that are already on the main branch and are required for some tests on older releases to pass through. * ruby_patch_common is for commits that all branches should need for additional tests to pass. These are outside of the ruby/openssl gem boundary, so I chose to consolidate the logic in a separate patch. Patches in this folder would be submitted to their respective repos instead of https://github.com/ruby/openssl. By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license.
Description of changes:
We've finalized our support for Ruby 3.1 and 3.2. This adds the patch and integration CI to test against it.
Ruby 3.1 patch contents are as following:
params_ok?
. AWS-LC simply disallows invalid parameters to be parsed.BN::CONSTTIME
. See 0a211df for more details.test/openssl/test_pkey_rsa.rb
are pieces of ruby/ruby@2e5680d in upstream Ruby. It accounts for RSA operations disallowed in FIPS mode in Ruby's RSA tests. The commit diff is a bit too large to muddle with the changes in this CR. It's also fairly recent and not directly applicable to Ruby 3.1's version of the file, so I've only taken pieces that ensure we're not losing coverage.Ruby 3.2 patch contents are nearly identical to the points mentioned above. Only additional thing to note is AWS-LC does key checks while parsing EC Keys and disallows invalid keys to be parsed. This is similar to the DH params discrepancy described above in point 4.
Testing:
CI
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license.