Skip to content

Commit 382eca2

Browse files
committed
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.
1 parent 77133c6 commit 382eca2

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
run: bundle exec rake debug
6767

6868
- name: rake test
69-
run: bundle exec rake test TESTOPTS="-v --no-show-detail-immediately"
69+
run: bundle exec rake test TESTOPTS="-v --no-show-detail-immediately" OSSL_TEST_ALL=1
7070
timeout-minutes: 5
7171

7272
test-openssls:
@@ -167,7 +167,7 @@ jobs:
167167
run: bundle exec rake debug
168168

169169
- name: rake test
170-
run: bundle exec rake test TESTOPTS="-v --no-show-detail-immediately"
170+
run: bundle exec rake test TESTOPTS="-v --no-show-detail-immediately" OSSL_TEST_ALL=1
171171
timeout-minutes: 5
172172

173173
# Run only the passing tests on the FIPS module as a temporary workaround.
@@ -177,6 +177,6 @@ jobs:
177177
sed -e "s|OPENSSL_DIR|$HOME/openssl|" tool/openssl_fips.cnf.tmpl > tmp/openssl_fips.cnf
178178
export OPENSSL_CONF=$(pwd)/tmp/openssl_fips.cnf
179179
bundle exec rake debug
180-
bundle exec rake test_fips TESTOPTS="-v --no-show-detail-immediately"
180+
bundle exec rake test_fips TESTOPTS="-v --no-show-detail-immediately" OSSL_TEST_ALL=1
181181
timeout-minutes: 5
182182
if: ${{ startsWith(matrix.openssl, 'openssl-3') || matrix.openssl == 'openssl-master' }}

test/openssl/test_ossl.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def test_memcmp_timing
6363
end
6464
assert_operator(a_b_time, :<, a_c_time * 10, "fixed_length_secure_compare timing test failed")
6565
assert_operator(a_c_time, :<, a_b_time * 10, "fixed_length_secure_compare timing test failed")
66-
end
66+
end if ENV["OSSL_TEST_ALL"] == "1"
6767

6868
def test_error_data
6969
# X509V3_EXT_nconf_nid() called from OpenSSL::X509::ExtensionFactory#create_ext is a function

test/openssl/test_pkey_dh.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def test_new_generate
1616
# This test is slow
1717
dh = OpenSSL::PKey::DH.new(NEW_KEYLEN)
1818
assert_key(dh)
19-
end if ENV["OSSL_TEST_ALL"]
19+
end if ENV["OSSL_TEST_ALL"] == "1"
2020

2121
def test_new_break
2222
unless openssl? && OpenSSL.fips_mode

test/openssl/test_pkey_dsa.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ def test_generate
4747
assert_equal 1024, key1024.p.num_bits
4848
assert_equal 160, key1024.q.num_bits
4949

50-
key2048 = OpenSSL::PKey::DSA.generate(2048)
51-
assert_equal 2048, key2048.p.num_bits
52-
assert_equal 256, key2048.q.num_bits
53-
5450
if ENV["OSSL_TEST_ALL"] == "1" # slow
51+
key2048 = OpenSSL::PKey::DSA.generate(2048)
52+
assert_equal 2048, key2048.p.num_bits
53+
assert_equal 256, key2048.q.num_bits
54+
5555
key3072 = OpenSSL::PKey::DSA.generate(3072)
5656
assert_equal 3072, key3072.p.num_bits
5757
assert_equal 256, key3072.q.num_bits

test/openssl/test_ssl_session.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ def test_server_session_cache
222222

223223
# Skipping tests that use session_remove_cb by default because it may cause
224224
# deadlock.
225-
TEST_SESSION_REMOVE_CB = ENV["OSSL_TEST_ALL"] == "1"
225+
TEST_SESSION_REMOVE_CB = ENV["OSSL_TEST_UNSAFE"] == "1"
226226

227227
def test_ctx_client_session_cb_tls12
228228
start_server do |port|

0 commit comments

Comments
 (0)