hawq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From w...@apache.org
Subject incubator-hawq git commit: HAWQ-1221. Add register test case verify bug fix YamlFileNotExist and NonDefaultBucketnum check.
Date Tue, 20 Dec 2016 02:43:14 GMT
Repository: incubator-hawq
Updated Branches:
  refs/heads/master c5aee9b64 -> 300ef59b5


HAWQ-1221. Add register test case verify bug fix YamlFileNotExist and NonDefaultBucketnum
check.


Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/300ef59b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/300ef59b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/300ef59b

Branch: refs/heads/master
Commit: 300ef59b541d3fc10edf7ce0082b0d3dffa54501
Parents: c5aee9b
Author: stanlyxiang <stanly.sxiang@gmail.com>
Authored: Mon Dec 19 15:35:48 2016 +0800
Committer: stanlyxiang <stanly.sxiang@gmail.com>
Committed: Tue Dec 20 10:30:11 2016 +0800

----------------------------------------------------------------------
 .../test_hawq_register_usage2_case1.cpp         | 30 ++++++++++++++++++++
 1 file changed, 30 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/300ef59b/src/test/feature/ManagementTool/test_hawq_register_usage2_case1.cpp
----------------------------------------------------------------------
diff --git a/src/test/feature/ManagementTool/test_hawq_register_usage2_case1.cpp b/src/test/feature/ManagementTool/test_hawq_register_usage2_case1.cpp
index d23d754..acaadd6 100644
--- a/src/test/feature/ManagementTool/test_hawq_register_usage2_case1.cpp
+++ b/src/test/feature/ManagementTool/test_hawq_register_usage2_case1.cpp
@@ -370,3 +370,33 @@ TEST_F(TestHawqRegister, TestUsage2Case1FileUnderTableDirectory) {
     EXPECT_EQ(0, Command::getCommandStatus(hawq::test::stringFormat("rm -rf %s", t_yml.c_str())));
     util.execute("drop table t;");
 }
+
+// HAWQ-1221. BFV
+TEST_F(TestHawqRegister, TestUsage2Case1YamlNotExist) {
+	SQLUtility util;
+	util.execute("drop table if exists t_notexist;");
+	util.execute("create table t_notexist (i int);");
+	string test_root(util.getTestRootPath());
+	string t_yml(hawq::test::stringFormat("%s/ManagementTool/usage2case1/yaml_not_exist.yml",
test_root.c_str()));
+	string error_msg(hawq::test::stringFormat("-[ERROR]:-Cannot find yaml file : %s", t_yml.c_str()));
+	EXPECT_TRUE(testing::IsSubstring("", "", error_msg.c_str(),
+	            		   Command::getCommandOutput(hawq::test::stringFormat("hawq register -d %s
-c %s testhawqregister_testusage2case1yamlnotexist.t_notexist", HAWQ_DB, t_yml.c_str()))));
+	util.execute("drop table t_notexist;");
+}
+
+// HAWQ-1223. BFV
+TEST_F(TestHawqRegister, TestUsage2Case1NonDefaultBucketnum) {
+	SQLUtility util;
+	util.execute("drop table if exists tbl_random;");
+	util.execute("drop table if exists tbl_random_new;");
+	util.execute("set default_hash_table_bucket_number=42; create table tbl_random (i int);");
+	util.execute("insert into tbl_random select generate_series(1, 100);");
+	util.query("select * from tbl_random;", 100);
+	util.execute("set default_hash_table_bucket_number=42; create table tbl_random_new (i int);");
+	EXPECT_EQ(0, Command::getCommandStatus("hawq extract -d " + (string) HAWQ_DB + " -o tbl_random.yml
testhawqregister_testusage2case1nondefaultbucketnum.tbl_random"));
+	EXPECT_EQ(0, Command::getCommandStatus("hawq register -d " + (string) HAWQ_DB + " -c tbl_random.yml
testhawqregister_testusage2case1nondefaultbucketnum.tbl_random_new"));
+
+	EXPECT_EQ(0, Command::getCommandStatus("rm -f tbl_random.yml"));
+	util.execute("drop table tbl_random;");
+	util.execute("drop table tbl_random_new;");
+}


Mime
View raw message