Chris Browne cbbrowne at lists.slony.info
Wed Jul 11 10:20:20 PDT 2007
Update of /home/cvsd/slony1/slony1-engine/tests
In directory main.slony.info:/tmp/cvs-serv14278/tests

Modified Files:
	run_test.sh settings.ik support_funcs.sh 
Log Message:
Tests now generate output in a |pipe delimited| form for eventual
aggregation in a "regression test repository."


Index: support_funcs.sh
===================================================================
RCS file: /home/cvsd/slony1/slony1-engine/tests/support_funcs.sh,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** support_funcs.sh	6 Jun 2007 22:20:39 -0000	1.5
--- support_funcs.sh	11 Jul 2007 17:20:18 -0000	1.6
***************
*** 6,9 ****
--- 6,11 ----
      echo 1>&2 "$0: ERROR: $*"
      numerrors=`expr ${numerrors} + 1`
+ 
+     gen_testinfo "$*"
      exit $exitval
  }
***************
*** 199,200 ****
--- 201,234 ----
    echo ${ranstring}
  }
+ 
+ gen_testinfo ()
+ {
+     DESC=$1;
+     UNAMEM=`uname -m`
+     UNAMER=`uname -r`
+     UNAMES=`uname -s`
+     UNAMEV=`uname -v`
+     HOST=`hostname -f`
+     USERNAME=`whoami`
+     
+     #TESTSTARTTIME is calculated at the very beginning...
+     TESTENDTIME=`date +"%Y-%m-%d %H:%M:%S %Z"`
+ 
+     CLNAME="\"_${CLUSTER1}\""
+ 
+     if [[ x$DESC = x'' ]]; then
+ 	OK="true"
+     else
+ 	OK="false"
+     fi
+ 
+     BASEOUTPUT="select ${CLNAME}.getModuleversion() || '|' || ${CLNAME}.slonyVersionMajor() || '|' || ${CLNAME}.slonyVersionMinor() || '|' || ${CLNAME}.slonyVersionPatchlevel() || '|' || version() || '|';"
+ 
+     BASEOUTPUT=`${pgbindir}/psql -d ${DB1} -h ${HOST1} -p ${PORT1} -U ${USER1} -c "${QUERY}" -qAt`
+     BASEOUTPUT="${BASEOUTPUT}|${UNAMEM}|${UNAMER}|${UNAMES}|${UNAMEV}|"
+     BASEOUTPUT="${BASEOUTPUT}|${HOST}|${SLONYTESTER}|${testname}|${TESTSTARTTIME}|${TESTENDTIME}|${OK}|${DESC}"
+ 
+ 
+     echo "${BASEOUTPUT}" >> ${SLONYTESTFILE}
+     echo "${BASEOUTPUT}"
+ }

Index: settings.ik
===================================================================
RCS file: /home/cvsd/slony1/slony1-engine/tests/settings.ik,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** settings.ik	22 Jun 2007 16:12:22 -0000	1.7
--- settings.ik	11 Jul 2007 17:20:18 -0000	1.8
***************
*** 105,107 ****
  
  # Email address of the tester
! SLONYTESTER=${SLONYTESTER:-"j.random.luser at example.net"}
\ No newline at end of file
--- 105,110 ----
  
  # Email address of the tester
! SLONYTESTER=${SLONYTESTER:-"j.random.luser at example.net"}
! 
! # File in which to stow SQL queries that summarize test results
! SLONYTESTFILE=${SLONYTESTFILE:-"/tmp/Slony-I-test-results.log"}

Index: run_test.sh
===================================================================
RCS file: /home/cvsd/slony1/slony1-engine/tests/run_test.sh,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** run_test.sh	20 Apr 2007 21:43:14 -0000	1.14
--- run_test.sh	11 Jul 2007 17:20:18 -0000	1.15
***************
*** 39,44 ****
  fi
  
  if [ ! -x "$pgbindir/psql" ]; then
!   echo "please set the PGBINDIR envvar to the directory containing psql, createdb, ..."
    exit 1;
  fi
--- 39,47 ----
  fi
  
+ TESTSTARTTIME=`date +"%Y-%m-%d %H:%M:%S %Z"`
+ 
+ 
  if [ ! -x "$pgbindir/psql" ]; then
!   echo "please set the PGBINDIR environment variable to the directory containing psql, createdb, ..."
    exit 1;
  fi
***************
*** 56,59 ****
--- 59,64 ----
  . support_funcs.sh
  
+ echo "Test by ${SLONYTESTER} to be summarized in ${SLONYTESTFILE}"
+ 
  trap '
  	echo ""
***************
*** 759,762 ****
--- 764,769 ----
  status "done"
  
+ gen_testinfo
  drop_databases
  cleanup
+ 



More information about the Slony1-commit mailing list