Skip to content

Commit

Permalink
merged with main and resolved conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
diptanshumittal committed Feb 9, 2023
1 parent 0a295a0 commit eae8ddc
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
9 changes: 9 additions & 0 deletions google-cloud-datastore/acceptance/datastore_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,15 @@ def try_with_backoff msg = nil, limit: 10
end
end

Minitest.after_run do
unless $dataset_2
puts "The multiple database tests were not run. These tests require a secondary " \
"database which is not configured. To enable, ensure that the following " \
"is present in the environment: \n" \
"DATASTORE_MULTI_DB_DATABASE"
end
end

Minitest.after_run do
unless $dataset_2
puts "The multiple database tests were not run. These tests require a secondary " \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1251,7 +1251,7 @@
read_only: Google::Cloud::Datastore::V1::TransactionOptions::ReadOnly.new(read_time: read_time_to_timestamp(read_time))
)
begin_tx_res = Google::Cloud::Datastore::V1::BeginTransactionResponse.new(transaction: tx_id)
dataset.service.mocked_service.expect :begin_transaction, begin_tx_res, project_id: project, transaction_options: tx_options
dataset.service.mocked_service.expect :begin_transaction, begin_tx_res, project_id: project, database_id: default_database, transaction_options: tx_options

tx = dataset.read_only_transaction read_time: read_time
_(tx).must_be_kind_of Google::Cloud::Datastore::ReadOnlyTransaction
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,8 @@
first_lookup_res_dup.read_time = read_time
second_lookup_res_dup = second_lookup_res.dup
second_lookup_res_dup.read_time = read_time
dataset.service.mocked_service.expect :lookup, first_lookup_res_dup, project_id: project, keys: first_keys, read_options: read_options
dataset.service.mocked_service.expect :lookup, second_lookup_res_dup, project_id: project, keys: second_keys, read_options: read_options
dataset.service.mocked_service.expect :lookup, first_lookup_res_dup, project_id: project, database_id: default_database, keys: first_keys, read_options: read_options
dataset.service.mocked_service.expect :lookup, second_lookup_res_dup, project_id: project, database_id: default_database, keys: second_keys, read_options: read_options

first_entities = dataset.find_all keys, read_time: read_time
_(first_entities.next?).must_equal true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@
next_run_query_res_dup = next_run_query_res.dup
next_run_query_res_dup.batch.read_time = read_time
dataset.service.mocked_service = Minitest::Mock.new
dataset.service.mocked_service.expect :run_query, first_run_query_res, project_id: project, partition_id: nil, read_options: read_options, query: first_run_query, gql_query: nil
dataset.service.mocked_service.expect :run_query, next_run_query_res, project_id: project, partition_id: nil, read_options: read_options, query: next_run_query, gql_query: nil
dataset.service.mocked_service.expect :run_query, first_run_query_res, project_id: project, partition_id: nil, database_id: default_database, read_options: read_options, query: first_run_query, gql_query: nil
dataset.service.mocked_service.expect :run_query, next_run_query_res, project_id: project, partition_id: nil, database_id: default_database, read_options: read_options, query: next_run_query, gql_query: nil

first_entities = dataset.run dataset.query("Task"), read_time: read_time
_(first_entities.count).must_equal 25
Expand Down

0 comments on commit eae8ddc

Please sign in to comment.