Skip to content

Commit 63a252b

Browse files
ono-maxko1
authored andcommitted
Print information that protocol tests are skipped only once
1 parent 5edf769 commit 63a252b

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

test/support/cdp_utils.rb

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,7 @@ def setup_chrome_debuggee
3131
MSG
3232
end
3333

34-
pt = ENV['RUBY_DEBUG_PROTOCOL_TEST']
35-
PROTOCOL_TEST = pt == 'true' || pt == '1'
36-
3734
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-
4035
ENV['RUBY_DEBUG_TEST_MODE'] = 'true'
4136

4237
sock = Socket.tcp HOST, @remote_info.port
@@ -69,6 +64,8 @@ def connect_to_cdp_server
6964
HOST = '127.0.0.1'
7065

7166
def run_cdp_scenario program, &msgs
67+
return unless Protocol_TestUtils::PROTOCOL_TEST
68+
7269
ENV['RUBY_DEBUG_TEST_UI'] = 'chrome'
7370

7471
program = program.delete_suffix "\n"

test/support/dap_utils.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,9 @@ 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'
102100

103101
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
102+
return unless Protocol_TestUtils::PROTOCOL_TEST
105103

106104
begin
107105
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)