#!/bin/bash

TINC_TARGET="$@"
TINC_DIR=/home/gpadmin/gpdb_src/src/test/tinc

trap look4diffs ERR
function look4diffs() {
	find "\${TINC_DIR}" -name *.diff -exec cat {} \; >> "\${TINC_DIR}/regression.diffs"
	echo "=================================================================="
	echo "The differences that caused some tests to fail can also be viewed in the file saved at \${TINC_DIR}/regression.diffs."
	echo "=================================================================="
	cat "\${TINC_DIR}/regression.diffs"
	exit 1
}

cat > ~/gpdb-env.sh << EOF
  source /usr/local/greenplum-db-devel/greenplum_path.sh
  export PGPORT=5432
  export MASTER_DATA_DIRECTORY=/data/gpdata/master/gpseg-1
  export PGDATABASE=gptest

  alias mdd='cd \$MASTER_DATA_DIRECTORY'
  alias tinc='cd ${TINC_DIR}'
EOF
source ~/gpdb-env.sh

# make fsync by default off to improve test stability
gpconfig --skipvalidation -c fsync -v off
gpstop -u

createdb gptest
createdb gpadmin
cd ${TINC_DIR}
source tinc_env.sh
make ${TINC_TARGET}

#!/bin/bash

TINC_TARGET="$@"
TINC_DIR=/home/gpadmin/gpdb_src/src/test/tinc

cat > ~/gpdb-env.sh << EOF
  source /usr/local/greenplum-db-devel/greenplum_path.sh
  export PGPORT=5432
  export MASTER_DATA_DIRECTORY=/data/gpdata/master/gpseg-1
  export PGDATABASE=gptest

  alias mdd='cd \$MASTER_DATA_DIRECTORY'
  alias tinc='cd ${TINC_DIR}'
EOF
source ~/gpdb-env.sh

# make fsync by default off to improve test stability
gpconfig --skipvalidation -c fsync -v off
gpstop -u

createdb gptest
createdb gpadmin
cd ${TINC_DIR}
source tinc_env.sh
make ${TINC_TARGET}

Revert "Print diffs generated in CCP TINC tests"
Revert "Print diffs generated in CCP TINC tests"

This commit added an ERR trap that exits the script immediately.
Unfortunately, the gpconfig line that follows doesn't appear to succeed
(and may never have?), which prevents the TINC tests from running
entirely. To get the CI moving again, revert for now.

This reverts commit c8350a806de4607d9f8c503a874f5e6bc632414e.
