Skip to content

Various test and CI improvements #910

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

rhenium
Copy link
Member

@rhenium rhenium commented Jul 12, 2025


Rakefile: do not add test/openssl to the load paths

The directory used to contain a copy of envutil.rb. It is now gone since
we started using the test-unit-ruby-core gem.

The top-level lib directory is automatically added by Rake::TestTask.


.github/workflows/test.yml: update debug print

Changes include:

  • Remove Rake task dependency to "debug" and "debug_compiler" from
    "compile" and "test". Let the workflow explicitly run them as
    necessary. Since we use separate rake invocations for compiling and
    running tests, the dependency causes repeated debug prints.

  • Remove printing Ruby version from the debug tasks as it is not
    necessary. The ruby/setup-ruby action shows the activated version.

  • Let "debug" rake task call FileUtils#ruby with verbose: false to
    avoid printing the script itself.


Move slow tests to OSSL_TEST_ALL=1 only

Update GitHub Actions workflows to set OSSL_TEST_ALL=1.

Exclude a few slow tests that are not critical for local development,
unless OSSL_TEST_ALL=1 is set. The bindings code paths are still reached
by other tests with smaller inputs, and failures in those would likely
indicate an issue in OpenSSL rather than in the bindings.

Newly excluded tests include generating large DSA keys and measuring
CRYPTO_memcmp() timing. These tests currently take nearly half of the
total runtime.


test/openssl/test_ossl.rb: fix style issues

Use OpenSSL::TestCase instead of OpenSSL::SSLTestCase.

Prefer assert_true and assert_false over the bare assert and refute.
OpenSSL.fixed_length_secure_compare and OpenSSL.secure_compare will
only return true or false, and it should be checked.


test/openssl/test_ts.rb: make assert_raise blocks smaller

rhenium added 5 commits July 12, 2025 23:24
The directory used to contain a copy of envutil.rb. It is now gone since
we started using the test-unit-ruby-core gem.

The top-level lib directory is automatically added by Rake::TestTask.
Changes include:

 - Remove Rake task dependency to "debug" and "debug_compiler" from
   "compile" and "test". Let the workflow explicitly run them as
   necessary. Since we use separate rake invocations for compiling and
   running tests, the dependency causes repeated debug prints.

 - Remove printing Ruby version from the debug tasks as it is not
   necessary. The ruby/setup-ruby action shows the activated version.

 - Let "debug" rake task call FileUtils#ruby with verbose: false to
   avoid printing the script itself.
Update GitHub Actions workflows to set OSSL_TEST_ALL=1.

Exclude a few slow tests that are not critical for local development,
unless OSSL_TEST_ALL=1 is set. The bindings code paths are still reached
by other tests with smaller inputs, and failures in those would likely
indicate an issue in OpenSSL rather than in the bindings.

Newly excluded tests include generating large DSA keys and measuring
CRYPTO_memcmp() timing. These tests currently take nearly half of the
total runtime.
Use OpenSSL::TestCase instead of OpenSSL::SSLTestCase.

Prefer assert_true and assert_false over the bare assert and refute.
OpenSSL.fixed_length_secure_compare and OpenSSL.secure_compare will
only return true or false, and it should be checked.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant