From 473eabada2158832ac55dbd14a005e4575d22d83 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Mon, 28 Oct 2013 02:59:45 -0400 Subject: [PATCH 1/3] Gracefully handle the case when a DISTDIR already exists --- qa/pull-tester/build-tests.sh.in | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/qa/pull-tester/build-tests.sh.in b/qa/pull-tester/build-tests.sh.in index 9640bcaf6..74a92f79d 100755 --- a/qa/pull-tester/build-tests.sh.in +++ b/qa/pull-tester/build-tests.sh.in @@ -9,7 +9,7 @@ set -o xtrace MINGWPREFIX=$1 JAVA_COMPARISON_TOOL=$2 -RUN_LARGE_REORGS=$3 +RUN_EXPENSIVE_TESTS=$3 JOBS=${4-1} OUT_DIR=${5-} @@ -23,17 +23,22 @@ DISTDIR=@PACKAGE@-@VERSION@ # Cross-compile for windows first (breaking the mingw/windows build is most common) cd @abs_top_srcdir@ make distdir -mv $DISTDIR win32-build +mkdir -p win32-build +rsync -av $DISTDIR/ win32-build/ +rm -r $DISTDIR cd win32-build + ./configure --disable-silent-rules --disable-ccache --prefix=$MINGWPREFIX --host=i586-mingw32msvc --with-qt-bindir=$MINGWPREFIX/host/bin --with-qt-plugindir=$MINGWPREFIX/plugins --with-qt-incdir=$MINGWPREFIX/include --with-boost=$MINGWPREFIX --with-protoc-bindir=$MINGWPREFIX/host/bin CPPFLAGS=-I$MINGWPREFIX/include LDFLAGS=-L$MINGWPREFIX/lib make -j$JOBS # And compile for Linux: cd @abs_top_srcdir@ make distdir -mv $DISTDIR linux-build +mkdir -p linux-build +rsync -av $DISTDIR/ linux-build/ +rm -r $DISTDIR cd linux-build -if [ $RUN_LARGE_REORGS = 1 ]; then +if [ $RUN_EXPENSIVE_TESTS = 1 ]; then ./configure --disable-silent-rules --disable-ccache --with-comparison-tool="$JAVA_COMPARISON_TOOL" --enable-comparison-tool-reorg-tests else ./configure --disable-silent-rules --disable-ccache --with-comparison-tool="$JAVA_COMPARISON_TOOL" From a18a408067229d2474dc7e88ef8b074b5c48cb95 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Mon, 28 Oct 2013 03:20:12 -0400 Subject: [PATCH 2/3] Run block tester and test suite on Windows too (only on Jenkins) --- qa/pull-tester/build-tests.sh.in | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/qa/pull-tester/build-tests.sh.in b/qa/pull-tester/build-tests.sh.in index 74a92f79d..73f046a0f 100755 --- a/qa/pull-tester/build-tests.sh.in +++ b/qa/pull-tester/build-tests.sh.in @@ -28,7 +28,11 @@ rsync -av $DISTDIR/ win32-build/ rm -r $DISTDIR cd win32-build -./configure --disable-silent-rules --disable-ccache --prefix=$MINGWPREFIX --host=i586-mingw32msvc --with-qt-bindir=$MINGWPREFIX/host/bin --with-qt-plugindir=$MINGWPREFIX/plugins --with-qt-incdir=$MINGWPREFIX/include --with-boost=$MINGWPREFIX --with-protoc-bindir=$MINGWPREFIX/host/bin CPPFLAGS=-I$MINGWPREFIX/include LDFLAGS=-L$MINGWPREFIX/lib +if [ $RUN_EXPENSIVE_TESTS = 1 ]; then + ./configure --disable-silent-rules --disable-ccache --prefix=$MINGWPREFIX --host=i586-mingw32msvc --with-qt-bindir=$MINGWPREFIX/host/bin --with-qt-plugindir=$MINGWPREFIX/plugins --with-qt-incdir=$MINGWPREFIX/include --with-boost=$MINGWPREFIX --with-protoc-bindir=$MINGWPREFIX/host/bin CPPFLAGS=-I$MINGWPREFIX/include LDFLAGS=-L$MINGWPREFIX/lib --with-comparison-tool="$JAVA_COMPARISON_TOOL" --enable-comparison-tool-reorg-tests +else + ./configure --disable-silent-rules --disable-ccache --prefix=$MINGWPREFIX --host=i586-mingw32msvc --with-qt-bindir=$MINGWPREFIX/host/bin --with-qt-plugindir=$MINGWPREFIX/plugins --with-qt-incdir=$MINGWPREFIX/include --with-boost=$MINGWPREFIX --with-protoc-bindir=$MINGWPREFIX/host/bin CPPFLAGS=-I$MINGWPREFIX/include LDFLAGS=-L$MINGWPREFIX/lib +fi make -j$JOBS # And compile for Linux: @@ -64,6 +68,12 @@ fi cd @abs_top_srcdir@/linux-build make check +if [ $RUN_EXPENSIVE_TESTS = 1 ]; then + # Run unit tests and blockchain-tester on Windows: + cd @abs_top_srcdir@/win32-build + make check +fi + # Clean up builds (pull-tester machine doesn't have infinite disk space) cd @abs_top_srcdir@/linux-build make clean From f1f72e535c8aa95e5d23a5d5b088c375aa27ee03 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Mon, 28 Oct 2013 03:41:40 -0400 Subject: [PATCH 3/3] Fix port binding by listening on port $BASHPID --- Makefile.am | 4 ++-- qa/pull-tester/run-bitcoind-for-test.sh.in | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Makefile.am b/Makefile.am index bb950ee9f..243166b3f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -119,7 +119,7 @@ test_bitcoin_filtered.info: test_bitcoin.info block_test.info: test_bitcoin_filtered.info $(MKDIR_P) qa/tmp - -@TIMEOUT=15 qa/pull-tester/run-bitcoind-for-test.sh $(JAVA) -jar $(JAVA_COMPARISON_TOOL) qa/tmp/compTool 0 18444 + -@TIMEOUT=15 qa/pull-tester/run-bitcoind-for-test.sh $(JAVA) -jar $(JAVA_COMPARISON_TOOL) qa/tmp/compTool 0 $(LCOV) -c -d $(abs_builddir)/src --t BitcoinJBlockTest -o $@ $(LCOV) -z -d $(abs_builddir)/src $(LCOV) -z -d $(abs_builddir)/src/leveldb @@ -148,7 +148,7 @@ endif if USE_COMPARISON_TOOL check-local: $(MKDIR_P) qa/tmp - @qa/pull-tester/run-bitcoind-for-test.sh $(JAVA) -jar $(JAVA_COMPARISON_TOOL) qa/tmp/compTool $(COMPARISON_TOOL_REORG_TESTS) 18444 + @qa/pull-tester/run-bitcoind-for-test.sh $(JAVA) -jar $(JAVA_COMPARISON_TOOL) qa/tmp/compTool $(COMPARISON_TOOL_REORG_TESTS) endif EXTRA_DIST = $(top_srcdir)/share/genbuild.sh qa/pull-tester/pull-tester.sh $(WINDOWS_PACKAGING) $(OSX_PACKAGING) diff --git a/qa/pull-tester/run-bitcoind-for-test.sh.in b/qa/pull-tester/run-bitcoind-for-test.sh.in index e8bcb4bf7..4eef8202c 100755 --- a/qa/pull-tester/run-bitcoind-for-test.sh.in +++ b/qa/pull-tester/run-bitcoind-for-test.sh.in @@ -5,7 +5,8 @@ mkdir -p "$DATADIR"/regtest touch "$DATADIR/regtest/debug.log" tail -q -n 1 -F "$DATADIR/regtest/debug.log" | grep -m 1 -q "Done loading" & WAITER=$! -"@abs_top_builddir@/src/bitcoind@EXEEXT@" -connect=0.0.0.0 -datadir="$DATADIR" -rpcuser=user -rpcpassword=pass -listen -keypool=3 -debug -debug=net -logtimestamps -port=18444 -regtest & +PORT=`expr $BASHPID + 10000` +"@abs_top_builddir@/src/bitcoind@EXEEXT@" -connect=0.0.0.0 -datadir="$DATADIR" -rpcuser=user -rpcpassword=pass -listen -keypool=3 -debug -debug=net -logtimestamps -port=$PORT -regtest & BITCOIND=$! #Install a watchdog. @@ -13,10 +14,10 @@ BITCOIND=$! wait $WAITER if [ -n "$TIMEOUT" ]; then - timeout "$TIMEOUT"s "$@" + timeout "$TIMEOUT"s "$@" $PORT RETURN=$? else - "$@" + "$@" $PORT RETURN=$? fi