Skip to content

Commit 231caac

Browse files
committed
✅🚧 Omit 15 SSL connection tests for JRuby
1 parent 04f0b1f commit 231caac

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

test/net/imap/test_imap.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class IMAPTest < Net::IMAP::TestCase
1313

1414
if defined?(OpenSSL::SSL::SSLError)
1515
def test_imaps_unknown_ca
16+
omit_if_jruby "SSL tests don't work yet"
1617
assert_raise(OpenSSL::SSL::SSLError) do
1718
imaps_test do |port|
1819
begin
@@ -27,6 +28,7 @@ def test_imaps_unknown_ca
2728
end
2829

2930
def test_imaps_with_ca_file
31+
omit_if_jruby "SSL tests don't work yet"
3032
# Assert verified *after* the imaps_test and assert_nothing_raised blocks.
3133
# Otherwise, failures can't logout and need to wait for the timeout.
3234
verified, imap = :unknown, nil
@@ -54,6 +56,7 @@ def test_imaps_with_ca_file
5456
end
5557

5658
def test_imaps_verify_none
59+
omit_if_jruby "SSL tests don't work yet"
5760
# Assert verified *after* the imaps_test and assert_nothing_raised blocks.
5861
# Otherwise, failures can't logout and need to wait for the timeout.
5962
verified, imap = :unknown, nil
@@ -81,6 +84,7 @@ def test_imaps_verify_none
8184
end
8285

8386
def test_imaps_post_connection_check
87+
omit_if_jruby "SSL tests don't work yet"
8488
assert_raise(OpenSSL::SSL::SSLError) do
8589
imaps_test do |port|
8690
# server_addr is different from the hostname in the certificate,
@@ -95,6 +99,7 @@ def test_imaps_post_connection_check
9599

96100
if defined?(OpenSSL::SSL)
97101
def test_starttls_unknown_ca
102+
omit_if_jruby "SSL tests don't work yet"
98103
omit "This test is not working with Windows" if RUBY_PLATFORM =~ /mswin|mingw/
99104

100105
imap = nil
@@ -115,6 +120,7 @@ def test_starttls_unknown_ca
115120
end
116121

117122
def test_starttls
123+
omit_if_jruby "SSL tests don't work yet"
118124
initial_verified, initial_ctx, initial_params = :unknown, :unknown, :unknown
119125
imap = nil
120126
starttls_test do |port|
@@ -139,6 +145,7 @@ def test_starttls
139145
end
140146

141147
def test_starttls_stripping
148+
omit_if_jruby "SSL tests don't work yet"
142149
imap = nil
143150
starttls_stripping_test do |port|
144151
imap = Net::IMAP.new("localhost", :port => port)
@@ -497,6 +504,7 @@ def test_connection_closed_during_idle
497504
end
498505

499506
def test_connection_closed_without_greeting
507+
omit_if_jruby "???"
500508
server = create_tcp_server
501509
port = server.addr[1]
502510
h = {

test/net/imap/test_imap_capabilities.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ class IMAPCapabilitiesTest < Net::IMAP::TestCase
124124

125125
if defined?(OpenSSL::SSL::SSLError)
126126
test "#capabilities caches greeting capabilities (implicit TLS)" do
127+
omit_if_jruby
127128
with_fake_server(preauth: false, implicit_tls: true) do |server, imap|
128129
assert imap.capabilities_cached?
129130
assert_equal %w[IMAP4REV1 AUTH=PLAIN], imap.capabilities
@@ -136,6 +137,7 @@ class IMAPCapabilitiesTest < Net::IMAP::TestCase
136137

137138
test "#capabilities cache is cleared after #starttls" do
138139
with_fake_server(preauth: false, cleartext_auth: false) do |server, imap|
140+
omit_if_jruby
139141
assert imap.capabilities_cached?
140142
assert imap.capable? :IMAP4rev1
141143
refute imap.auth_capable? "plain"
@@ -189,6 +191,7 @@ class IMAPCapabilitiesTest < Net::IMAP::TestCase
189191

190192
# TODO: should we warn about this?
191193
test "#capabilities cache IGNORES tagged OK response to STARTTLS" do
194+
omit_if_jruby
192195
with_fake_server(preauth: false) do |server, imap|
193196
server.on "STARTTLS" do |cmd|
194197
cmd.done_ok code: "[CAPABILITY IMAP4rev1 AUTH=PLAIN fnord]"

test/net/imap/test_imap_deprecated_client_options.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ class InitializeTests < IMAPDeprecatedClientOptionsTest
4242
end
4343

4444
test "Convert deprecated usessl (= true) and certs, with warning" do
45+
omit_if_jruby "SSL tests don't work yet"
4546
run_fake_server_in_thread(implicit_tls: true) do |server|
4647
certs = server.config.tls[:ca_file]
4748
assert_deprecated_warning(/Call Net::IMAP\.new with keyword/i) do
@@ -58,6 +59,7 @@ class InitializeTests < IMAPDeprecatedClientOptionsTest
5859
end
5960

6061
test "Convert deprecated usessl (= true) and verify (= false), with warning" do
62+
omit_if_jruby "SSL tests don't work yet"
6163
run_fake_server_in_thread(implicit_tls: true) do |server|
6264
assert_deprecated_warning(/Call Net::IMAP\.new with keyword/i) do
6365
with_client("localhost", server.port, true, nil, false) do |client|
@@ -89,6 +91,7 @@ class InitializeTests < IMAPDeprecatedClientOptionsTest
8991

9092
class StartTLSTests < IMAPDeprecatedClientOptionsTest
9193
test "Convert obsolete options hash to keywords" do
94+
omit_if_jruby "SSL tests don't work yet"
9295
with_fake_server(preauth: false) do |server, imap|
9396
imap.starttls(ca_file: server.config.tls[:ca_file], min_version: :TLS1_2)
9497
assert_equal(
@@ -101,6 +104,7 @@ class StartTLSTests < IMAPDeprecatedClientOptionsTest
101104
end
102105

103106
test "Convert deprecated certs, verify with warning" do
107+
omit_if_jruby "SSL tests don't work yet"
104108
with_fake_server(preauth: false) do |server, imap|
105109
assert_deprecated_warning(/Call Net::IMAP#starttls with keyword/i) do
106110
imap.starttls(server.config.tls[:ca_file], false)

0 commit comments

Comments
 (0)