Skip to content

Commit 742fa32

Browse files
committed
Merge pull request #3078 from gavinandresen/pulltester
Rework pull-tester scripts, disable blockchain tester
2 parents a302c21 + 38a9448 commit 742fa32

File tree

2 files changed

+50
-20
lines changed

2 files changed

+50
-20
lines changed

qa/pull-tester/build-tests.sh.in

Lines changed: 41 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,44 +3,72 @@
33
# Param2: Path to java comparison tool
44
# Param3: Number of make jobs. Defaults to 1.
55

6+
# Exit immediately if anything fails:
67
set -e
78
set -o xtrace
89

910
MINGWPREFIX=$1
1011
JAVA_COMPARISON_TOOL=$2
1112
JOBS=${3-1}
13+
OUT_DIR=${4-}
1214

1315
if [ $# -lt 2 ]; then
14-
echo "Usage: $0 [mingw-prefix] [java-comparison-tool] <make jobs>"
16+
echo "Usage: $0 [mingw-prefix] [java-comparison-tool] <make jobs> <save output dir>"
1517
exit 1
1618
fi
1719

1820
DISTDIR=@PACKAGE@-@VERSION@
1921

20-
# Test win32 build first (it breaks the most often)
22+
# Cross-compile for windows first (breaking the mingw/windows build is most common)
2123
cd @abs_top_srcdir@
2224
make distdir
2325
mv $DISTDIR win32-build
2426
cd win32-build
2527
./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
2628
make -j$JOBS
27-
make check
2829

29-
# ... then linux build, with blockchain-tester:
30+
# And compile for Linux:
3031
cd @abs_top_srcdir@
3132
make distdir
3233
mv $DISTDIR linux-build
3334
cd linux-build
34-
./configure --disable-silent-rules --disable-ccache --with-comparison-tool="$JAVA_COMPARISON_TOOL"
35+
# TODO: re-enable blockchain tester tool, as of 11 Oct 2013 is it not working properly
36+
# on the pull-tester machine.
37+
#./configure --disable-silent-rules --disable-ccache --with-comparison-tool="$JAVA_COMPARISON_TOOL"
38+
./configure --disable-silent-rules --disable-ccache
3539
make -j$JOBS
40+
41+
# link interesting binaries to parent out/ directory, if it exists. Do this before
42+
# running unit tests (we want bad binaries to be easy to find)
43+
if [ -d "$OUT_DIR" -a -w "$OUT_DIR" ]; then
44+
set +e
45+
# Windows:
46+
cp @abs_top_srcdir@/win32-build/src/bitcoind.exe $OUT_DIR/bitcoind.exe
47+
cp @abs_top_srcdir@/win32-build/src/test/test_bitcoin.exe $OUT_DIR/test_bitcoin.exe
48+
cp @abs_top_srcdir@/win32-build/src/qt/bitcoind-qt.exe $OUT_DIR/bitcoin-qt.exe
49+
# Linux:
50+
cp @abs_top_srcdir@/linux-build/src/bitcoind $OUT_DIR/bitcoind
51+
cp @abs_top_srcdir@/linux-build/src/test/test_bitcoin $OUT_DIR/test_bitcoin
52+
cp @abs_top_srcdir@/linux-build/src/qt/bitcoind-qt $OUT_DIR/bitcoin-qt
53+
set -e
54+
fi
55+
56+
# Run unit tests and blockchain-tester on Linux:
57+
cd @abs_top_srcdir@/linux-build
3658
make check
3759

38-
# Test code coverage
39-
cd @abs_top_srcdir@
40-
make distdir
41-
mv $DISTDIR linux-coverage-build
42-
cd linux-coverage-build
43-
./configure --enable-lcov --with-comparison-tool="$JAVA_COMPARISON_TOOL"
44-
make -j$JOBS
45-
make cov
60+
# Clean up builds (pull-tester machine doesn't have infinite disk space)
61+
cd @abs_top_srcdir@/linux-build
62+
make clean
63+
cd @abs_top_srcdir@/win32-build
64+
make clean
4665

66+
# TODO: Fix code coverage builds on pull-tester machine
67+
# # Test code coverage
68+
# cd @abs_top_srcdir@
69+
# make distdir
70+
# mv $DISTDIR linux-coverage-build
71+
# cd linux-coverage-build
72+
# ./configure --enable-lcov --disable-silent-rules --disable-ccache --with-comparison-tool="$JAVA_COMPARISON_TOOL"
73+
# make -j$JOBS
74+
# make cov

qa/pull-tester/pull-tester.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def checkout_pull(clone_url, commit, out):
3838
# Init
3939
build_dir=os.environ["BUILD_DIR"]
4040
run("umount ${CHROOT_COPY}/proc", fail_hard=False)
41-
run("rsync --delete -apv ${CHROOT_MASTER} ${CHROOT_COPY}")
41+
run("rsync --delete -apv ${CHROOT_MASTER}/ ${CHROOT_COPY}")
4242
run("rm -rf ${CHROOT_COPY}${SCRIPTS_DIR}")
4343
run("cp -a ${SCRIPTS_DIR} ${CHROOT_COPY}${SCRIPTS_DIR}")
4444
# Merge onto upstream/master
@@ -108,17 +108,18 @@ def testpull(number, comment_url, clone_url, commit):
108108
open(os.environ["TESTED_DB"], "a").write(commit + "\n")
109109
return
110110

111-
# New: pull-tester.sh script(s) are in the tree:
111+
run("rm -rf ${CHROOT_COPY}/${OUT_DIR}", fail_hard=False);
112+
run("mkdir -p ${CHROOT_COPY}/${OUT_DIR}", fail_hard=False);
113+
run("chown -R ${BUILD_USER}:${BUILD_GROUP} ${CHROOT_COPY}/${OUT_DIR}", fail_hard=False)
114+
112115
script = os.environ["BUILD_PATH"]+"/qa/pull-tester/pull-tester.sh"
113-
script += " ${BUILD_PATH} ${MINGW_DEPS_DIR} ${SCRIPTS_DIR}/BitcoindComparisonTool.jar 1"
116+
script += " ${BUILD_PATH} ${MINGW_DEPS_DIR} ${SCRIPTS_DIR}/BitcoindComparisonTool.jar 6 ${OUT_DIR}"
114117
returncode = run("chroot ${CHROOT_COPY} sudo -u ${BUILD_USER} -H timeout ${TEST_TIMEOUT} "+script,
115118
fail_hard=False, stdout=out, stderr=out)
116119

120+
run("mv ${CHROOT_COPY}/${OUT_DIR} " + dir)
117121
run("mv ${BUILD_DIR} " + dir)
118-
# TODO: FIXME
119-
# Idea: have run-script save interesting output...
120-
# run("cp /mnt/chroot-tmp/home/ubuntu/.bitcoin/regtest/debug.log " + dir)
121-
# os.system("chmod +r " + dir + "/debug.log")
122+
122123
if returncode == 42:
123124
print("Successfully tested pull (needs tests) - sending comment to: " + comment_url)
124125
commentOn(comment_url, True, False, True, resultsurl)
@@ -147,6 +148,7 @@ def environ_default(setting, value):
147148
environ_default("SCRIPTS_DIR", "/mnt/test-scripts")
148149
environ_default("CHROOT_COPY", "/mnt/chroot-tmp")
149150
environ_default("CHROOT_MASTER", "/mnt/chroot")
151+
environ_default("OUT_DIR", "/mnt/out")
150152
environ_default("BUILD_PATH", "/mnt/bitcoin")
151153
os.environ["BUILD_DIR"] = os.environ["CHROOT_COPY"] + os.environ["BUILD_PATH"]
152154
environ_default("RESULTS_DIR", "/mnt/www/pull-tester")

0 commit comments

Comments
 (0)