This is an automated email from the ASF dual-hosted git repository. isapego pushed a commit to branch ignite-17607 in repository https://gitbox.apache.org/repos/asf/ignite-3.git
commit 2c8373c1edb915519bf698cd9d54764257a10c81 Author: Igor Sapego <[email protected]> AuthorDate: Mon Mar 20 18:22:33 2023 +0300 IGNITE-17607 Add test --- .../cpp/tests/client-test/compute_test.cpp | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/modules/platforms/cpp/tests/client-test/compute_test.cpp b/modules/platforms/cpp/tests/client-test/compute_test.cpp index 75bdb101fb..85623fd138 100644 --- a/modules/platforms/cpp/tests/client-test/compute_test.cpp +++ b/modules/platforms/cpp/tests/client-test/compute_test.cpp @@ -272,4 +272,41 @@ TEST_F(compute_test, execute_colocated_throws_when_table_does_not_exist) { ignite_error); } +TEST_F(compute_test, execute_colocated_throws_when_key_column_is_missing) { + EXPECT_THROW( + { + try { + (void) m_client.get_compute().execute_colocated(TABLE_1, get_tuple("some"), ECHO_JOB, {}); + } catch (const ignite_error &e) { + EXPECT_THAT(e.what_str(), ::testing::HasSubstr("Missed key column: KEY")); + throw; + } + }, + ignite_error); +} + +TEST_F(compute_test, execute_colocated_throws_when_key_is_empty) { + EXPECT_THROW( + { + try { + (void) m_client.get_compute().execute_colocated(TABLE_1, {}, ECHO_JOB, {}); + } catch (const ignite_error &e) { + EXPECT_EQ("Key tuple can not be empty", e.what_str()); + throw; + } + }, + ignite_error); +} +TEST_F(compute_test, exception_in_server_job_propogates_to_client) { + EXPECT_THROW( + { + try { + (void) m_client.get_compute().execute_colocated(TABLE_1, {}, ECHO_JOB, {}); + } catch (const ignite_error &e) { + EXPECT_EQ("Key tuple can not be empty", e.what_str()); + throw; + } + }, + ignite_error); +}
