Skip to content

Correct Env name for UI to be tested #777

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

Merged
merged 1 commit into from
Oct 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/support/assertions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
module DEBUGGER__
module AssertionHelpers
def assert_line_num(expected)
case ENV['RUBY_DEBUG_TEST_UI']
case get_target_ui
when 'terminal'
@scenario.push(Proc.new { |test_info|
msg = "Expected line number to be #{expected.inspect}, but was #{test_info.internal_info['line']}\n"
Expand Down
8 changes: 2 additions & 6 deletions test/support/protocol_test_case.rb
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ def assert_watch_result expected, expression, frame_idx: 0
# Not API

def execute_dap_scenario scenario
ENV['RUBY_DEBUG_TESTED_UI'] = 'vscode'
ENV['RUBY_DEBUG_TEST_UI'] = 'vscode'

@remote_info = setup_unix_domain_socket_remote_debuggee
Timeout.timeout(TIMEOUT_SEC) do
Expand All @@ -305,7 +305,7 @@ def execute_dap_scenario scenario
end

def execute_cdp_scenario scenario
ENV['RUBY_DEBUG_TESTED_UI'] = 'chrome'
ENV['RUBY_DEBUG_TEST_UI'] = 'chrome'

@remote_info = setup_tcpip_remote_debuggee
Timeout.timeout(TIMEOUT_SEC) do
Expand Down Expand Up @@ -589,10 +589,6 @@ def find_response key, target, direction
flunk create_protocol_message "TIMEOUT ERROR (#{TIMEOUT_SEC} sec) while waiting: #{key} #{target}"
end

def get_target_ui
ENV['RUBY_DEBUG_TESTED_UI']
end

# FIXME: Commonalize this method.
def recv_response
case header = @sock.gets
Expand Down
4 changes: 4 additions & 0 deletions test/support/test_case.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ def debug_print msg

TIMEOUT_SEC = (ENV['RUBY_DEBUG_TIMEOUT_SEC'] || 10).to_i

def get_target_ui
ENV['RUBY_DEBUG_TEST_UI']
end

private

def wait_pid pid, sec
Expand Down