Skip to content

ResultSingleOptional testkit request #260

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

Open
wants to merge 2 commits into
base: 5.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class GetFeatures < Request
'Feature:API:Result.List' => 'ja',
'Feature:API:Result.Peek' => 'ja',
'Feature:API:Result.Single' => 'ja',
'Feature:API:Result.SingleOptional' => '',
'Feature:API:Result.SingleOptional' => 'jar',
'Feature:API:RetryableExceptions' => '',
'Feature:API:Session:AuthConfig' => 'a',
'Feature:API:Session:NotificationsConfig' => 'a',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module Testkit::Backend::Messages
module Requests
class ResultSingleOptional < Request
def process
result = fetch(result_id)
record = begin
{ values: result.single.values.map(&method(:to_testkit)) }
rescue Neo4j::Driver::Exceptions::NoSuchRecordException
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using exception for control flow is not a good practice. The same can be achieved without raising and rescuing an exception by reading 2 records.

nil
end
named_entity('RecordOptional', record:, warnings: [])
end
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ class StartTest < Request
SKIPPED_TESTS = {
'neo4j.test_direct_driver.TestDirectDriver.test_custom_resolver': 'Does not call resolver for direct connections', # skip for java hardcoded in testkit
'stub.session_run_parameters.test_session_run_parameters.TestSessionRunParameters.test_empty_query': 'rejects empty string', # skip for java hardcoded in testkit
'stub.iteration.test_result_optional_single.TestResultSingleOptional.test_result_single_optional_with_2_records': 'Not implemented for ruby driver in testkit',
'stub.iteration.test_result_optional_single.TestResultSingleOptional.test_result_single_optional_with_disconnect': 'Not implemented for ruby driver in testkit',
# 'stub.iteration.test_iteration_tx_run.TestIterationTxRun.test_nested': 'completely pulls the first query before running the second',
# 'stub.optimizations.test_optimizations.TestOptimizations.test_uses_implicit_default_arguments': 'Driver does not implement optimization for qid in explicit transaction',
# 'stub.optimizations.test_optimizations.TestOptimizations.test_uses_implicit_default_arguments_multi_query': 'Driver does not implement optimization for qid in explicit transaction',
Expand Down
Loading