Skip to content

Commit daff133

Browse files
committed
MDEV-9185 - Integrate with Travis-CI for easier and more automatic QA
Based on contributions by Daniel Black and Otto Kekäläinen.
1 parent 69052ed commit daff133

File tree

3 files changed

+73
-16
lines changed

3 files changed

+73
-16
lines changed

.travis.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# vim ft=yaml
2+
# travis-ci.org definition
3+
4+
# non-container builds don't have enough RAM to reliably compile
5+
sudo: required
6+
dist: trusty
7+
8+
language: cpp
9+
compiler:
10+
- gcc
11+
# - clang # See commit f38808 if you want to re-enable clang builds
12+
cache:
13+
apt:
14+
ccache:
15+
16+
# Timing on build an test needs to be < 50 minutes. The compile is ~4-5minutes
17+
# so here we group the tests such that this happens.
18+
19+
addons:
20+
apt:
21+
packages: # make sure these match debian/control contents
22+
- bison
23+
- chrpath
24+
- cmake
25+
- debhelper
26+
- dh-apparmor
27+
- dpatch
28+
- libaio-dev
29+
- libboost-dev
30+
- libjudy-dev
31+
- libncurses5-dev
32+
- libpam0g-dev
33+
- libreadline-gplv2-dev
34+
- libssl-dev
35+
- lsb-release
36+
- perl
37+
- po-debconf
38+
- psmisc
39+
- zlib1g-dev
40+
- libcrack2-dev # no effect as the package is disallowed on Travis-CI
41+
- libjemalloc-dev
42+
- devscripts # implicit for any build on Ubuntu
43+
44+
script:
45+
- ${CC} --version ; ${CXX} --version
46+
- cd "${TRAVIS_BUILD_DIR}"
47+
- env DEB_BUILD_OPTIONS="parallel=4" debian/autobake-deb.sh;
48+
49+
notifications:
50+
irc:
51+
channels:
52+
- "chat.freenode.net#maria"
53+
on_success: never # [always|never|change]
54+
on_failure: never
55+
template:
56+
- "%{repository}/%{branch} (%{commit} - %{author}): %{build_url}: %{message}"

debian/autobake-deb.sh

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,16 @@ set -e
1010
# Debug script and command lines
1111
#set -x
1212

13-
# Don't run the mysql-test-run test suite as part of build.
13+
# On Buildbot, don't run the mysql-test-run test suite as part of build.
1414
# It takes a lot of time, and we will do a better test anyway in
1515
# Buildbot, running the test suite from installed .debs on a clean VM.
16-
export DEB_BUILD_OPTIONS="nocheck"
16+
# On Travis-CI we want to simulate the full build, including tests.
17+
# Also on Travis-CI it is useful not to override the DEB_BUILD_OPTIONS
18+
# at this stage at all.
19+
if [[ ! $TRAVIS ]]
20+
then
21+
export DEB_BUILD_OPTIONS="nocheck"
22+
fi
1723

1824
export MARIADB_OPTIONAL_DEBS=""
1925

@@ -32,8 +38,8 @@ LOGSTRING="MariaDB build"
3238
CODENAME="$(lsb_release -sc)"
3339

3440
# add libcrack2 (>= 2.9.0) as a build dependency
35-
# but only where the distribution can possibly satisfy it
36-
if apt-cache madison cracklib2|grep 'cracklib2 *| *2\.[0-8]\.' >/dev/null 2>&1
41+
# but only where the distribution can possibly satisfy it and if not on Travis-CI
42+
if $TRAVIS || apt-cache madison cracklib2|grep 'cracklib2 *| *2\.[0-8]\.' >/dev/null 2>&1
3743
then
3844
# Anything in MARIADB_OPTIONAL_DEBS is omitted from the resulting
3945
# packages by snipped in rules file

debian/rules

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,15 @@ ifeq (${MAKE_J}, -j0)
2929
MAKE_J = -j1
3030
endif
3131

32-
MAKE_TEST_TARGET=test-force
33-
ifneq ($(findstring fulltest,$(DEB_BUILD_OPTIONS)),)
34-
# make test-bt is the testsuite run by the MySQL build team
35-
# before a release, but it is long
36-
MAKE_TEST_TARGET=test-bt
32+
# Parallel build support as advised
33+
# at https://www.debian.org/doc/debian-policy/ch-source.html#s-debianrules-options
34+
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
35+
NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
36+
MAKEFLAGS += -j $(NUMJOBS)
3737
endif
3838

39-
USE_ASSEMBLER=--enable-assembler
4039

41-
ifneq (,$(filter $(ARCH), amd64 i386 ia64 s390))
42-
TESTSUITE_FAIL_CMD=exit 1
43-
else
44-
TESTSUITE_FAIL_CMD=true
45-
endif
40+
USE_ASSEMBLER=--enable-assembler
4641

4742
BUILDDIR = builddir
4843
builddir = $(BUILDDIR)
@@ -88,7 +83,7 @@ build-stamp: configure
8883

8984
ifeq ($(findstring nocheck,$(DEB_BUILD_OPTIONS)),)
9085
if [ ! -f testsuite-stamp ] ; then \
91-
cd $(builddir) && $(MAKE) $(MAKE_TEST_TARGET) || $(TESTSUITE_FAIL_CMD) ; \
86+
cd $(builddir)/mysql-test && ./mtr --force --parallel=$(NUMJOBS) --skip-rpl --suite=main; \
9287
fi
9388
endif
9489

0 commit comments

Comments
 (0)