-
Notifications
You must be signed in to change notification settings - Fork 167
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
Do not require a test file in a separately run test case #591
Do not require a test file in a separately run test case #591
Conversation
0fabee3
to
9b36ed1
Compare
require #{__FILE__.dump} | ||
include OpenSSL::TestEngine::Utils | ||
require 'engine_utils' | ||
include EngineUtils | ||
#{code} | ||
end; | ||
end |
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.
module Utils
below should be removed
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 think we should simply inline these helper methods in Utils
. They are both too specialized and don't look very useful anyway.
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've inlined the helpers.
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.
Looks good to me
test/openssl/test_engine.rb
Outdated
decrypted = crypt_data(encrypted, key, :decrypt) { OpenSSL::Cipher.new(algo) } | ||
|
||
cipher = engine.cipher(algo) | ||
cipher.send :encrypt |
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.
Is the .send
necessary? (is it a private method?)
(same below)
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.
Good catch. Fixed and squashed the commits.
9083cd5
to
ae78467
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.
Looks good to me, too. Thank you!
The problem:
some tests run test cases in a separate Ruby process, probably to not pollute the global namespace. To share test helpers a test file can be
require
d in this separate process. So there need additional efforts to prevent auto-launching etc.I propose to not
require
a test file and to move such shared test helpers into a separate place.Actually there are only 2 places where a test file is required
test_engine.rb
test_fips.rb
But only in one place it's really needed (to share test helpers).
Related PR: #589