Skip to content

Commit f9f947a

Browse files
committed
Print information that protocol tests are skipped only once
1 parent 1fce258 commit f9f947a

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

test/support/cdp_utils.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ def setup_chrome_debuggee
3535
PROTOCOL_TEST = pt == 'true' || pt == '1'
3636

3737
def connect_to_cdp_server
38-
omit 'Tests for CDP were skipped. You can enable them with RUBY_DEBUG_PROTOCOL_TEST=1.' unless PROTOCOL_TEST
39-
4038
ENV['RUBY_DEBUG_TEST_MODE'] = 'true'
4139

4240
sock = Socket.tcp HOST, @remote_info.port
@@ -69,6 +67,8 @@ def connect_to_cdp_server
6967
HOST = '127.0.0.1'
7068

7169
def run_cdp_scenario program, &msgs
70+
return unless PROTOCOL_TEST
71+
7272
ENV['RUBY_DEBUG_TEST_UI'] = 'chrome'
7373

7474
program = program.delete_suffix "\n"

test/support/dap_utils.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,11 @@ def connect_to_dap_server test_info
9797
end
9898

9999
TIMEOUT_SEC = (ENV['RUBY_DEBUG_TIMEOUT_SEC'] || 10).to_i
100-
dt = ENV['RUBY_DEBUG_PROTOCOL_TEST']
101-
DAP_TEST = dt == 'true' || dt == '1'
100+
pt = ENV['RUBY_DEBUG_PROTOCOL_TEST']
101+
PROTOCOL_TEST = pt == 'true' || pt == '1'
102102

103103
def run_dap_scenario program, &msgs
104-
omit 'Tests for DAP were skipped. You can enable them with RUBY_DEBUG_PROTOCOL_TEST=1.' unless DAP_TEST
104+
return unless PROTOCOL_TEST
105105

106106
begin
107107
write_temp_file(strip_line_num(program))

test/support/protocol_utils.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,14 @@ class Detach < StandardError
3737
pt = ENV['RUBY_DEBUG_PROTOCOL_TEST']
3838
PROTOCOL_TEST = pt == 'true' || pt == '1'
3939

40+
unless PROTOCOL_TEST
41+
warn 'Tests for CDP and DAP were skipped. You can enable them with RUBY_DEBUG_PROTOCOL_TEST=1.'
42+
end
43+
4044
# API
4145

4246
def run_protocol_scenario program, dap: true, cdp: true, &scenario
43-
omit 'Tests for CDP and DAP were skipped. You can enable them with RUBY_DEBUG_PROTOCOL_TEST=1.' unless PROTOCOL_TEST
47+
return unless PROTOCOL_TEST
4448

4549
write_temp_file(strip_line_num(program))
4650
execute_dap_scenario scenario if dap

0 commit comments

Comments
 (0)