Repository: incubator-hawq Updated Branches: refs/heads/master fc8f34b2f -> 5fae6af7e
HAWQ-1153. Add global init file support for feature test Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/5fae6af7 Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/5fae6af7 Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/5fae6af7 Branch: refs/heads/master Commit: 5fae6af7ed20d3646ea9c16b5d16340a0e02ff23 Parents: fc8f34b Author: Paul Guo <[email protected]> Authored: Fri Nov 11 19:06:28 2016 +0800 Committer: Paul Guo <[email protected]> Committed: Tue Nov 15 14:31:30 2016 +0800 ---------------------------------------------------------------------- src/test/feature/ExternalSource/ans/exttab1.ans.source | 2 +- src/test/feature/lib/global_init_file | 5 +++++ src/test/feature/lib/psql.cpp | 9 +++++++-- src/test/feature/lib/psql.h | 1 + src/test/feature/lib/sql_util.cpp | 5 ++++- src/test/feature/schedule.txt | 4 ++-- 6 files changed, 20 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/5fae6af7/src/test/feature/ExternalSource/ans/exttab1.ans.source ---------------------------------------------------------------------- diff --git a/src/test/feature/ExternalSource/ans/exttab1.ans.source b/src/test/feature/ExternalSource/ans/exttab1.ans.source index 2624abe..8843bc6 100644 --- a/src/test/feature/ExternalSource/ans/exttab1.ans.source +++ b/src/test/feature/ExternalSource/ans/exttab1.ans.source @@ -633,7 +633,7 @@ psql:/tmp/TestExternalTable_TestExternalTableAll.sql:411: ERROR: the ON segment -- SELECT from WET (negative) -- select * from wet_pos1; -psql:/tmp/TestExternalTable_TestExternalTableAll.sql:416: ERROR: External scan error: It is not possible to read from a WRITABLE external table. Create the table as READABLE instead. (COptTasks.cpp:1617) +psql:/tmp/TestExternalTable_TestExternalTableAll.sql:416: ERROR: External scan error: It is not possible to read from a WRITABLE external table. Create the table as READABLE instead. (CTranslatorDXLToPlStmt.cpp:1041) -- -- WET: export some data with INSERT SELECT, INSERT and COPY. -- http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/5fae6af7/src/test/feature/lib/global_init_file ---------------------------------------------------------------------- diff --git a/src/test/feature/lib/global_init_file b/src/test/feature/lib/global_init_file new file mode 100644 index 0000000..85b2bff --- /dev/null +++ b/src/test/feature/lib/global_init_file @@ -0,0 +1,5 @@ +#mask code line numbers +-- start_matchsubs +m/\(.*c[p]+:\d+\)/ +s/\(.*c[p]+:\d+\)/(file_and_line)/ +-- end_matchsubs http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/5fae6af7/src/test/feature/lib/psql.cpp ---------------------------------------------------------------------- diff --git a/src/test/feature/lib/psql.cpp b/src/test/feature/lib/psql.cpp index 88531da..dd2ea79 100644 --- a/src/test/feature/lib/psql.cpp +++ b/src/test/feature/lib/psql.cpp @@ -200,14 +200,19 @@ const string PSQL::_getPSQLFileCommand(const string& file) const { bool PSQL::checkDiff(const string& expect_file, const string& result_file, bool save_diff, + const string& global_init_file, const string& init_file) { string diff_file = result_file + ".diff"; string command; - command.append("gpdiff.pl ") + command.append("gpdiff.pl -du ") .append(PSQL_BASIC_DIFF_OPTS); + if (!global_init_file.empty()) { + command.append(" -gpd_init ") + .append(global_init_file); + } if (!init_file.empty()) { command.append(" -gpd_init ") - .append(init_file); + .append(init_file); } command.append(" ") .append(expect_file) http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/5fae6af7/src/test/feature/lib/psql.h ---------------------------------------------------------------------- diff --git a/src/test/feature/lib/psql.h b/src/test/feature/lib/psql.h index 6363592..f5de19c 100644 --- a/src/test/feature/lib/psql.h +++ b/src/test/feature/lib/psql.h @@ -67,6 +67,7 @@ class PSQL { static bool checkDiff(const std::string& expect_file, const std::string& result_file, bool save_diff = true, + const std::string& global_init_file = "", const std::string& init_file = ""); void resetOutput(); http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/5fae6af7/src/test/feature/lib/sql_util.cpp ---------------------------------------------------------------------- diff --git a/src/test/feature/lib/sql_util.cpp b/src/test/feature/lib/sql_util.cpp index a5188ca..5f43313 100644 --- a/src/test/feature/lib/sql_util.cpp +++ b/src/test/feature/lib/sql_util.cpp @@ -156,7 +156,10 @@ void SQLUtility::execSQLFile(const string &sqlFile, initFileAbsPath = ""; } - bool is_sql_ans_diff = conn->checkDiff(ansFileAbsPath, outFileAbsPath, true, initFileAbsPath); + string globalInitFileAbsPath; + globalInitFileAbsPath = testRootPath + "/lib/global_init_file"; + + bool is_sql_ans_diff = conn->checkDiff(ansFileAbsPath, outFileAbsPath, true, globalInitFileAbsPath, initFileAbsPath); EXPECT_FALSE(is_sql_ans_diff); if (is_sql_ans_diff == false) { // no diff, continue to delete the generated sql file http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/5fae6af7/src/test/feature/schedule.txt ---------------------------------------------------------------------- diff --git a/src/test/feature/schedule.txt b/src/test/feature/schedule.txt index 18e7366..e7dcc0c 100644 --- a/src/test/feature/schedule.txt +++ b/src/test/feature/schedule.txt @@ -2,5 +2,5 @@ #SERIAL=* are the serial tests to run, optional but should not be empty #you can have several PARALLEL or SRRIAL -PARALLEL=TestErrorTable.*:TestExternalTable.*:TestPreparedStatement.*:TestUDF.*:TestAOSnappy.*:TestAlterOwner.*:TestAlterTable.*:TestCreateTable.*:TestGuc.*:TestType.*:TestDatabase.*:TestParquet.*:TestPartition.*:TestSubplan.*:TestAggregate.*:TestCreateTypeComposite.*:TestGpDistRandom.*:TestInformationSchema.*:TestQueryInsert.*:TestQueryNestedCaseNull.*:TestQueryPolymorphism.*:TestQueryPortal.*:TestQueryPrepare.*:TestQuerySequence.*:TestCommonLib.*:TestToast.*:TestTransaction.*:TestCommand.*:TestCopy.*:TestExternalTable.TestExternalTableAll -SERIAL=TestHawqRegister.*:TestExternalOid.TestExternalOidAll:TestTemp.BasicTest:TestRowTypes.* +PARALLEL=TestErrorTable.*:TestPreparedStatement.*:TestUDF.*:TestAOSnappy.*:TestAlterOwner.*:TestAlterTable.*:TestCreateTable.*:TestGuc.*:TestType.*:TestDatabase.*:TestParquet.*:TestPartition.*:TestSubplan.*:TestAggregate.*:TestCreateTypeComposite.*:TestGpDistRandom.*:TestInformationSchema.*:TestQueryInsert.*:TestQueryNestedCaseNull.*:TestQueryPolymorphism.*:TestQueryPortal.*:TestQueryPrepare.*:TestQuerySequence.*:TestCommonLib.*:TestToast.*:TestTransaction.*:TestCommand.*:TestCopy.* +SERIAL=TestHawqRegister.*:TestExternalOid.TestExternalOidAll:TestExternalTable.TestExternalTableAll:TestTemp.BasicTest:TestRowTypes.*
