[GitHub] incubator-hawq pull request #818: HAWQ-955. Add scriptS for feature test run...

2016-08-08 Thread xunzhang
Github user xunzhang closed the pull request at:

https://github.com/apache/incubator-hawq/pull/818


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #818: HAWQ-955. Add scriptS for feature test run...

2016-07-28 Thread xunzhang
Github user xunzhang commented on a diff in the pull request:

https://github.com/apache/incubator-hawq/pull/818#discussion_r72580564
  
--- Diff: src/test/feature/parallel-run-feature-test.sh ---
@@ -0,0 +1,49 @@
+#! /bin/bash
+
+if [ x$GPHOME == 'x' ]; then
+  echo "Please source greenplum_path.sh before running feature tests."
+  exit 0
+fi
+
+PSQL=${GPHOME}/bin/psql
+HAWQ_DB=${PGDATABASE:-"postgres"}
+HAWQ_HOST=${PGHOST:-"localhost"}
+HAWQ_PORT=${PGPORT:-"5432"}
--- End diff --

Done, please review again.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #818: HAWQ-955. Add scriptS for feature test run...

2016-07-27 Thread xunzhang
Github user xunzhang commented on a diff in the pull request:

https://github.com/apache/incubator-hawq/pull/818#discussion_r72565256
  
--- Diff: src/test/feature/run-feature-test.sh ---
@@ -0,0 +1,47 @@
+#! /bin/bash
+
+if [ x$GPHOME == 'x' ]; then
+  echo "Please export GPHOME variable."
+  exit 0
+fi
--- End diff --

GOT


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #818: HAWQ-955. Add scriptS for feature test run...

2016-07-27 Thread xunzhang
Github user xunzhang commented on a diff in the pull request:

https://github.com/apache/incubator-hawq/pull/818#discussion_r72559287
  
--- Diff: src/test/feature/run-feature-test.sh ---
@@ -0,0 +1,47 @@
+#! /bin/bash
+
+if [ x$GPHOME == 'x' ]; then
+  echo "Please export GPHOME variable."
+  exit 0
+fi
+
+PSQL=${GPHOME}/bin/psql
+HAWQ_DB=${PGDATABASE:-"postgres"}
+HAWQ_HOST=${PGHOST:-"localhost"}
+HAWQ_PORT=${PGPORT:-"5432"}
+
+run_sql() {
+  $PSQL -d $HAWQ_DB -h $HAWQ_HOST -p $HAWQ_PORT -c "$1" > /dev/null 2>&1
+  if [ $? -ne 0 ]; then
+echo "$1 failed."
+exit 1
+  fi
+}
+
+init_hawq_test() {
+  source "${GPHOME}/greenplum_path.sh"
+  
+  TEST_DB_NAME="hawq_feature_test"
+  
+  $PSQL -d $HAWQ_DB -h $HAWQ_HOST -p $HAWQ_PORT \
+-c "create database $TEST_DB_NAME;" > /dev/null 2>&1
+  run_sql "alter database $TEST_DB_NAME set lc_messages to 'C';"
+  run_sql "alter database $TEST_DB_NAME set lc_monetary to 'C';"
+  run_sql "alter database $TEST_DB_NAME set lc_numeric to 'C';"
+  run_sql "alter database $TEST_DB_NAME set lc_time to 'C';"
+  run_sql "alter database $TEST_DB_NAME set timezone_abbreviations to 
'Default';"
+  run_sql "alter database $TEST_DB_NAME set timezone to 'PST8PDT';"
+  run_sql "alter database $TEST_DB_NAME set datestyle to 'postgres,MDY';"
+  PGDATABASE=$TEST_DB_NAME
+}
+
+run_feature_test() {
+  if [ $# -lt 2 ] || [ $1 == "--help" ]; then
--- End diff --

Oh, I think I will change the first condition, or it is a little tricky 
then.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #818: HAWQ-955. Add scriptS for feature test run...

2016-07-27 Thread paul-guo-
Github user paul-guo- commented on a diff in the pull request:

https://github.com/apache/incubator-hawq/pull/818#discussion_r72559152
  
--- Diff: src/test/feature/run-feature-test.sh ---
@@ -0,0 +1,47 @@
+#! /bin/bash
+
+if [ x$GPHOME == 'x' ]; then
+  echo "Please export GPHOME variable."
+  exit 0
+fi
+
+PSQL=${GPHOME}/bin/psql
+HAWQ_DB=${PGDATABASE:-"postgres"}
+HAWQ_HOST=${PGHOST:-"localhost"}
+HAWQ_PORT=${PGPORT:-"5432"}
+
+run_sql() {
+  $PSQL -d $HAWQ_DB -h $HAWQ_HOST -p $HAWQ_PORT -c "$1" > /dev/null 2>&1
+  if [ $? -ne 0 ]; then
+echo "$1 failed."
+exit 1
+  fi
+}
+
+init_hawq_test() {
+  source "${GPHOME}/greenplum_path.sh"
+  
+  TEST_DB_NAME="hawq_feature_test"
+  
+  $PSQL -d $HAWQ_DB -h $HAWQ_HOST -p $HAWQ_PORT \
+-c "create database $TEST_DB_NAME;" > /dev/null 2>&1
+  run_sql "alter database $TEST_DB_NAME set lc_messages to 'C';"
+  run_sql "alter database $TEST_DB_NAME set lc_monetary to 'C';"
+  run_sql "alter database $TEST_DB_NAME set lc_numeric to 'C';"
+  run_sql "alter database $TEST_DB_NAME set lc_time to 'C';"
+  run_sql "alter database $TEST_DB_NAME set timezone_abbreviations to 
'Default';"
+  run_sql "alter database $TEST_DB_NAME set timezone to 'PST8PDT';"
+  run_sql "alter database $TEST_DB_NAME set datestyle to 'postgres,MDY';"
+  PGDATABASE=$TEST_DB_NAME
+}
+
+run_feature_test() {
+  if [ $# -lt 2 ] || [ $1 == "--help" ]; then
--- End diff --

I think "program --help" could be caught by "[ $# -lt 2]"


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #818: HAWQ-955. Add scriptS for feature test run...

2016-07-27 Thread paul-guo-
Github user paul-guo- commented on a diff in the pull request:

https://github.com/apache/incubator-hawq/pull/818#discussion_r72558667
  
--- Diff: src/test/feature/run-feature-test.sh ---
@@ -0,0 +1,47 @@
+#! /bin/bash
+
+if [ x$GPHOME == 'x' ]; then
+  echo "Please export GPHOME variable."
+  exit 0
+fi
--- End diff --

Actually for direct run, you need to source greenplum_path.sh at first, 
thus "source greenplum_path.sh" could be the same prerequisite for both direct 
run and parallel run.
We could check GP_HOME just to simply but not strictly judge whether users 
have sourced that file or not, not for us to source that file ourselves in the 
code.

Besides, another benefit is that you could make doc neat in README.MD :-) 
see the existing related doc below.

"Make sure HAWQ is running correctly. If not, init or start HAWQ at first.
Load environment configuration by running source 
$INSTALL_PREFIX/greenplum_path.sh.
Load hdfs configuration. For example, export 
HADOOP_HOME=/Users/wuhong/hadoop-2.7.2 && export 
PATH=${PATH}:${HADOOP_HOME}/bin. Since some test cases need hdfs and hadoop 
command, just ensure these commands work before running. Otherwise you will get 
failure."


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #818: HAWQ-955. Add scriptS for feature test run...

2016-07-27 Thread xunzhang
Github user xunzhang commented on a diff in the pull request:

https://github.com/apache/incubator-hawq/pull/818#discussion_r72557899
  
--- Diff: src/test/feature/run-feature-test.sh ---
@@ -0,0 +1,47 @@
+#! /bin/bash
+
+if [ x$GPHOME == 'x' ]; then
+  echo "Please export GPHOME variable."
+  exit 0
+fi
--- End diff --

In the logic, user do not need to know anything about source in running 
feature tests. In running this script, the only thing users need to do is set 
GPHOME. So I think the info is enough. Thoughts?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #818: HAWQ-955. Add scriptS for feature test run...

2016-07-27 Thread xunzhang
Github user xunzhang commented on a diff in the pull request:

https://github.com/apache/incubator-hawq/pull/818#discussion_r72557615
  
--- Diff: src/test/feature/run-feature-test.sh ---
@@ -0,0 +1,47 @@
+#! /bin/bash
+
+if [ x$GPHOME == 'x' ]; then
+  echo "Please export GPHOME variable."
+  exit 0
+fi
+
+PSQL=${GPHOME}/bin/psql
+HAWQ_DB=${PGDATABASE:-"postgres"}
+HAWQ_HOST=${PGHOST:-"localhost"}
+HAWQ_PORT=${PGPORT:-"5432"}
--- End diff --

Since


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #818: HAWQ-955. Add scriptS for feature test run...

2016-07-27 Thread xunzhang
Github user xunzhang commented on a diff in the pull request:

https://github.com/apache/incubator-hawq/pull/818#discussion_r72557599
  
--- Diff: src/test/feature/run-feature-test.sh ---
@@ -0,0 +1,47 @@
+#! /bin/bash
+
+if [ x$GPHOME == 'x' ]; then
+  echo "Please export GPHOME variable."
+  exit 0
+fi
+
+PSQL=${GPHOME}/bin/psql
+HAWQ_DB=${PGDATABASE:-"postgres"}
+HAWQ_HOST=${PGHOST:-"localhost"}
+HAWQ_PORT=${PGPORT:-"5432"}
--- End diff --

Some we can not run a command like psql -c "xx" -U.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #818: HAWQ-955. Add scriptS for feature test run...

2016-07-27 Thread xunzhang
Github user xunzhang commented on a diff in the pull request:

https://github.com/apache/incubator-hawq/pull/818#discussion_r72557537
  
--- Diff: src/test/feature/run-feature-test.sh ---
@@ -0,0 +1,47 @@
+#! /bin/bash
+
+if [ x$GPHOME == 'x' ]; then
+  echo "Please export GPHOME variable."
+  exit 0
+fi
--- End diff --

Ok


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #818: HAWQ-955. Add scriptS for feature test run...

2016-07-27 Thread xunzhang
Github user xunzhang commented on a diff in the pull request:

https://github.com/apache/incubator-hawq/pull/818#discussion_r72557444
  
--- Diff: src/test/feature/run-feature-test.sh ---
@@ -0,0 +1,47 @@
+#! /bin/bash
+
+if [ x$GPHOME == 'x' ]; then
+  echo "Please export GPHOME variable."
+  exit 0
+fi
+
+PSQL=${GPHOME}/bin/psql
+HAWQ_DB=${PGDATABASE:-"postgres"}
+HAWQ_HOST=${PGHOST:-"localhost"}
+HAWQ_PORT=${PGPORT:-"5432"}
+
+run_sql() {
+  $PSQL -d $HAWQ_DB -h $HAWQ_HOST -p $HAWQ_PORT -c "$1" > /dev/null 2>&1
+  if [ $? -ne 0 ]; then
+echo "$1 failed."
+exit 1
+  fi
+}
+
+init_hawq_test() {
+  source "${GPHOME}/greenplum_path.sh"
+  
+  TEST_DB_NAME="hawq_feature_test"
+  
+  $PSQL -d $HAWQ_DB -h $HAWQ_HOST -p $HAWQ_PORT \
+-c "create database $TEST_DB_NAME;" > /dev/null 2>&1
+  run_sql "alter database $TEST_DB_NAME set lc_messages to 'C';"
+  run_sql "alter database $TEST_DB_NAME set lc_monetary to 'C';"
+  run_sql "alter database $TEST_DB_NAME set lc_numeric to 'C';"
+  run_sql "alter database $TEST_DB_NAME set lc_time to 'C';"
+  run_sql "alter database $TEST_DB_NAME set timezone_abbreviations to 
'Default';"
+  run_sql "alter database $TEST_DB_NAME set timezone to 'PST8PDT';"
+  run_sql "alter database $TEST_DB_NAME set datestyle to 'postgres,MDY';"
+  PGDATABASE=$TEST_DB_NAME
+}
+
+run_feature_test() {
+  if [ $# -lt 2 ] || [ $1 == "--help" ]; then
--- End diff --

Why it should be removed?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #818: HAWQ-955. Add scriptS for feature test run...

2016-07-27 Thread xunzhang
Github user xunzhang commented on a diff in the pull request:

https://github.com/apache/incubator-hawq/pull/818#discussion_r72557467
  
--- Diff: src/test/feature/run-feature-test.sh ---
@@ -0,0 +1,47 @@
+#! /bin/bash
+
+if [ x$GPHOME == 'x' ]; then
+  echo "Please export GPHOME variable."
+  exit 0
+fi
+
+PSQL=${GPHOME}/bin/psql
+HAWQ_DB=${PGDATABASE:-"postgres"}
+HAWQ_HOST=${PGHOST:-"localhost"}
+HAWQ_PORT=${PGPORT:-"5432"}
+
+run_sql() {
+  $PSQL -d $HAWQ_DB -h $HAWQ_HOST -p $HAWQ_PORT -c "$1" > /dev/null 2>&1
+  if [ $? -ne 0 ]; then
+echo "$1 failed."
+exit 1
+  fi
+}
+
+init_hawq_test() {
+  source "${GPHOME}/greenplum_path.sh"
+  
+  TEST_DB_NAME="hawq_feature_test"
--- End diff --

Ok


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #818: HAWQ-955. Add scriptS for feature test run...

2016-07-27 Thread xunzhang
Github user xunzhang commented on a diff in the pull request:

https://github.com/apache/incubator-hawq/pull/818#discussion_r72557500
  
--- Diff: src/test/feature/run-feature-test.sh ---
@@ -0,0 +1,47 @@
+#! /bin/bash
+
+if [ x$GPHOME == 'x' ]; then
+  echo "Please export GPHOME variable."
+  exit 0
+fi
+
+PSQL=${GPHOME}/bin/psql
+HAWQ_DB=${PGDATABASE:-"postgres"}
+HAWQ_HOST=${PGHOST:-"localhost"}
+HAWQ_PORT=${PGPORT:-"5432"}
+
+run_sql() {
+  $PSQL -d $HAWQ_DB -h $HAWQ_HOST -p $HAWQ_PORT -c "$1" > /dev/null 2>&1
+  if [ $? -ne 0 ]; then
+echo "$1 failed."
+exit 1
+  fi
+}
+
+init_hawq_test() {
+  source "${GPHOME}/greenplum_path.sh"
--- End diff --

It is!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #818: HAWQ-955. Add scriptS for feature test run...

2016-07-27 Thread paul-guo-
Github user paul-guo- commented on a diff in the pull request:

https://github.com/apache/incubator-hawq/pull/818#discussion_r72555783
  
--- Diff: src/test/feature/run-feature-test.sh ---
@@ -0,0 +1,47 @@
+#! /bin/bash
+
+if [ x$GPHOME == 'x' ]; then
+  echo "Please export GPHOME variable."
+  exit 0
+fi
+
+PSQL=${GPHOME}/bin/psql
+HAWQ_DB=${PGDATABASE:-"postgres"}
+HAWQ_HOST=${PGHOST:-"localhost"}
+HAWQ_PORT=${PGPORT:-"5432"}
--- End diff --

Why ignore HAWQ_PASSWORD? It is easier to obtain in shell.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #818: HAWQ-955. Add scriptS for feature test run...

2016-07-27 Thread paul-guo-
Github user paul-guo- commented on a diff in the pull request:

https://github.com/apache/incubator-hawq/pull/818#discussion_r7280
  
--- Diff: src/test/feature/run-feature-test.sh ---
@@ -0,0 +1,47 @@
+#! /bin/bash
+
+if [ x$GPHOME == 'x' ]; then
+  echo "Please export GPHOME variable."
+  exit 0
+fi
+
+PSQL=${GPHOME}/bin/psql
+HAWQ_DB=${PGDATABASE:-"postgres"}
+HAWQ_HOST=${PGHOST:-"localhost"}
+HAWQ_PORT=${PGPORT:-"5432"}
+
+run_sql() {
+  $PSQL -d $HAWQ_DB -h $HAWQ_HOST -p $HAWQ_PORT -c "$1" > /dev/null 2>&1
+  if [ $? -ne 0 ]; then
+echo "$1 failed."
+exit 1
+  fi
+}
+
+init_hawq_test() {
+  source "${GPHOME}/greenplum_path.sh"
+  
+  TEST_DB_NAME="hawq_feature_test"
+  
+  $PSQL -d $HAWQ_DB -h $HAWQ_HOST -p $HAWQ_PORT \
+-c "create database $TEST_DB_NAME;" > /dev/null 2>&1
+  run_sql "alter database $TEST_DB_NAME set lc_messages to 'C';"
+  run_sql "alter database $TEST_DB_NAME set lc_monetary to 'C';"
+  run_sql "alter database $TEST_DB_NAME set lc_numeric to 'C';"
+  run_sql "alter database $TEST_DB_NAME set lc_time to 'C';"
+  run_sql "alter database $TEST_DB_NAME set timezone_abbreviations to 
'Default';"
+  run_sql "alter database $TEST_DB_NAME set timezone to 'PST8PDT';"
+  run_sql "alter database $TEST_DB_NAME set datestyle to 'postgres,MDY';"
+  PGDATABASE=$TEST_DB_NAME
+}
+
+run_feature_test() {
+  if [ $# -lt 2 ] || [ $1 == "--help" ]; then
--- End diff --

Add a line in help output to explain what is the script for? (for running 
in parallel)

I suspect '$1 == "--help"' could be removed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #818: HAWQ-955. Add scriptS for feature test run...

2016-07-27 Thread paul-guo-
Github user paul-guo- commented on a diff in the pull request:

https://github.com/apache/incubator-hawq/pull/818#discussion_r72555003
  
--- Diff: src/test/feature/run-feature-test.sh ---
@@ -0,0 +1,47 @@
+#! /bin/bash
+
+if [ x$GPHOME == 'x' ]; then
+  echo "Please export GPHOME variable."
+  exit 0
+fi
+
+PSQL=${GPHOME}/bin/psql
+HAWQ_DB=${PGDATABASE:-"postgres"}
+HAWQ_HOST=${PGHOST:-"localhost"}
+HAWQ_PORT=${PGPORT:-"5432"}
+
+run_sql() {
+  $PSQL -d $HAWQ_DB -h $HAWQ_HOST -p $HAWQ_PORT -c "$1" > /dev/null 2>&1
+  if [ $? -ne 0 ]; then
+echo "$1 failed."
+exit 1
+  fi
+}
+
+init_hawq_test() {
+  source "${GPHOME}/greenplum_path.sh"
+  
+  TEST_DB_NAME="hawq_feature_test"
--- End diff --

I'm wondering whether change the name from hawq_feature_test to 
hawq_feature_test_db.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #818: HAWQ-955. Add scriptS for feature test run...

2016-07-27 Thread paul-guo-
Github user paul-guo- commented on a diff in the pull request:

https://github.com/apache/incubator-hawq/pull/818#discussion_r72554974
  
--- Diff: src/test/feature/run-feature-test.sh ---
@@ -0,0 +1,47 @@
+#! /bin/bash
+
+if [ x$GPHOME == 'x' ]; then
+  echo "Please export GPHOME variable."
+  exit 0
+fi
+
+PSQL=${GPHOME}/bin/psql
+HAWQ_DB=${PGDATABASE:-"postgres"}
+HAWQ_HOST=${PGHOST:-"localhost"}
+HAWQ_PORT=${PGPORT:-"5432"}
+
+run_sql() {
+  $PSQL -d $HAWQ_DB -h $HAWQ_HOST -p $HAWQ_PORT -c "$1" > /dev/null 2>&1
+  if [ $? -ne 0 ]; then
+echo "$1 failed."
+exit 1
+  fi
+}
+
+init_hawq_test() {
+  source "${GPHOME}/greenplum_path.sh"
--- End diff --

I think "source greenplum_path.sh" should be run before running the case? 
What is you opinion?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #818: HAWQ-955. Add scriptS for feature test run...

2016-07-27 Thread paul-guo-
Github user paul-guo- commented on a diff in the pull request:

https://github.com/apache/incubator-hawq/pull/818#discussion_r72554617
  
--- Diff: src/test/feature/run-feature-test.sh ---
@@ -0,0 +1,47 @@
+#! /bin/bash
+
+if [ x$GPHOME == 'x' ]; then
+  echo "Please export GPHOME variable."
+  exit 0
+fi
--- End diff --

I think we need more words. How about this?

Please export the environment variable GPHOME before running.
Typically you can run " source greenplum_path.sh" under
the hawq installation path.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #818: HAWQ-955. Add scriptS for feature test run...

2016-07-27 Thread xunzhang
Github user xunzhang commented on a diff in the pull request:

https://github.com/apache/incubator-hawq/pull/818#discussion_r72386072
  
--- Diff: src/test/feature/run-feature-test.sh ---
@@ -0,0 +1,74 @@
+#! /bin/bash
+
+if [ x$GPHOME == 'x' ]; then
+  echo "Please export GPHOME variable."
+  exit 0
+fi
+
+init_hawq_test() {
+  source "${GPHOME}/greenplum_path.sh"
+  
+  PSQL=${GPHOME}/bin/psql
+  TEST_DB_NAME="hawq_feature_test"
+  
+  HAWQ_DB=${PGDATABASE:-"postgres"}
+  HAWQ_HOST=${PGHOST:-"localhost"}
+  HAWQ_PORT=${PGPORT:-"5432"}
+
+  $PSQL -d $HAWQ_DB -h $HAWQ_HOST -p $HAWQ_PORT \
+-c "create database $TEST_DB_NAME;" > /dev/null 2>&1
+  $PSQL -d $HAWQ_DB -h $HAWQ_HOST -p $HAWQ_PORT \
+-c "alter database $TEST_DB_NAME set lc_messages to 'C';" > 
/dev/null 2>&1
+  if [ $? -ne 0 ]; then
+echo "Alter database hawq_feature_test set lc_messages failed."
+exit 1
+  fi
+  $PSQL -d $HAWQ_DB -h $HAWQ_HOST -p $HAWQ_PORT \
+-c "alter database $TEST_DB_NAME set lc_monetary to 'C';" > 
/dev/null 2>&1
+  if [ $? -ne 0 ]; then
+echo "Alter database hawq_feature_test set lc_monetary failed."
+exit 1
+  fi
+  $PSQL -d $HAWQ_DB -h $HAWQ_HOST -p $HAWQ_PORT \
+-c "alter database $TEST_DB_NAME set lc_numeric to 'C';" > 
/dev/null 2>&1
+  if [ $? -ne 0 ]; then
+echo "Alter database hawq_feature_test set lc_numeric failed."
+exit 1
+  fi
+  $PSQL -d $HAWQ_DB -h $HAWQ_HOST -p $HAWQ_PORT \
+-c "alter database $TEST_DB_NAME set lc_time to 'C';" > /dev/null 
2>&1
+  if [ $? -ne 0 ]; then
+echo "Alter database hawq_feature_test set lc_time failed."
+exit 1
+  fi
+  $PSQL -d $HAWQ_DB -h $HAWQ_HOST -p $HAWQ_PORT \
+-c "alter database $TEST_DB_NAME set timezone_abbreviations to 
'Default';" > /dev/null 2>&1
+  if [ $? -ne 0 ]; then
+echo "Alter database hawq_feature_test set timezone_abbreviations 
failed."
+exit 1
+  fi
+  $PSQL -d $HAWQ_DB -h $HAWQ_HOST -p $HAWQ_PORT \
+-c "alter database $TEST_DB_NAME set timezone to 'PST8PDT';" > 
/dev/null 2>&1
+  if [ $? -ne 0 ]; then
+echo "Alter database hawq_feature_test set timezone failed."
+exit 1
+  fi
+  $PSQL -d $HAWQ_DB -h $HAWQ_HOST -p $HAWQ_PORT \
+-c "alter database $TEST_DB_NAME set datestyle to 'postgres,MDY';" 
> /dev/null 2>&1
+  if [ $? -ne 0 ]; then
+echo "Alter database hawq_feature_test set datestyle failed."
+exit 1
+  fi
--- End diff --

Good suggestion! Let me do this.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #818: HAWQ-955. Add scriptS for feature test run...

2016-07-27 Thread yaoj2
Github user yaoj2 commented on a diff in the pull request:

https://github.com/apache/incubator-hawq/pull/818#discussion_r72385745
  
--- Diff: src/test/feature/run-feature-test.sh ---
@@ -0,0 +1,74 @@
+#! /bin/bash
+
+if [ x$GPHOME == 'x' ]; then
+  echo "Please export GPHOME variable."
+  exit 0
+fi
+
+init_hawq_test() {
+  source "${GPHOME}/greenplum_path.sh"
+  
+  PSQL=${GPHOME}/bin/psql
+  TEST_DB_NAME="hawq_feature_test"
+  
+  HAWQ_DB=${PGDATABASE:-"postgres"}
+  HAWQ_HOST=${PGHOST:-"localhost"}
+  HAWQ_PORT=${PGPORT:-"5432"}
+
+  $PSQL -d $HAWQ_DB -h $HAWQ_HOST -p $HAWQ_PORT \
+-c "create database $TEST_DB_NAME;" > /dev/null 2>&1
+  $PSQL -d $HAWQ_DB -h $HAWQ_HOST -p $HAWQ_PORT \
+-c "alter database $TEST_DB_NAME set lc_messages to 'C';" > 
/dev/null 2>&1
+  if [ $? -ne 0 ]; then
+echo "Alter database hawq_feature_test set lc_messages failed."
+exit 1
+  fi
+  $PSQL -d $HAWQ_DB -h $HAWQ_HOST -p $HAWQ_PORT \
+-c "alter database $TEST_DB_NAME set lc_monetary to 'C';" > 
/dev/null 2>&1
+  if [ $? -ne 0 ]; then
+echo "Alter database hawq_feature_test set lc_monetary failed."
+exit 1
+  fi
+  $PSQL -d $HAWQ_DB -h $HAWQ_HOST -p $HAWQ_PORT \
+-c "alter database $TEST_DB_NAME set lc_numeric to 'C';" > 
/dev/null 2>&1
+  if [ $? -ne 0 ]; then
+echo "Alter database hawq_feature_test set lc_numeric failed."
+exit 1
+  fi
+  $PSQL -d $HAWQ_DB -h $HAWQ_HOST -p $HAWQ_PORT \
+-c "alter database $TEST_DB_NAME set lc_time to 'C';" > /dev/null 
2>&1
+  if [ $? -ne 0 ]; then
+echo "Alter database hawq_feature_test set lc_time failed."
+exit 1
+  fi
+  $PSQL -d $HAWQ_DB -h $HAWQ_HOST -p $HAWQ_PORT \
+-c "alter database $TEST_DB_NAME set timezone_abbreviations to 
'Default';" > /dev/null 2>&1
+  if [ $? -ne 0 ]; then
+echo "Alter database hawq_feature_test set timezone_abbreviations 
failed."
+exit 1
+  fi
+  $PSQL -d $HAWQ_DB -h $HAWQ_HOST -p $HAWQ_PORT \
+-c "alter database $TEST_DB_NAME set timezone to 'PST8PDT';" > 
/dev/null 2>&1
+  if [ $? -ne 0 ]; then
+echo "Alter database hawq_feature_test set timezone failed."
+exit 1
+  fi
+  $PSQL -d $HAWQ_DB -h $HAWQ_HOST -p $HAWQ_PORT \
+-c "alter database $TEST_DB_NAME set datestyle to 'postgres,MDY';" 
> /dev/null 2>&1
+  if [ $? -ne 0 ]; then
+echo "Alter database hawq_feature_test set datestyle failed."
+exit 1
+  fi
--- End diff --

It would be better make runsql and error check in a function



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #818: HAWQ-955. Add scriptS for feature test run...

2016-07-27 Thread xunzhang
GitHub user xunzhang opened a pull request:

https://github.com/apache/incubator-hawq/pull/818

HAWQ-955. Add scriptS for feature test running in parallel.



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/xunzhang/incubator-hawq HAWQ-955

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/incubator-hawq/pull/818.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #818


commit f5ffb50304207ade51beefd353a44ee8b34f9bc9
Author: xunzhang 
Date:   2016-07-27T06:12:30Z

HAWQ-955. Add scriptS for feature test running in parallel.




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---