summaryrefslogtreecommitdiffstats
path: root/debian/tests/upstream
blob: 5c39949a33f192b636794b84edb3549f7024e2c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/sh
# autopkgtest check: Build and run the upstream test suite.
# (C) 2012 Canonical Ltd.
# Author: Daniel Kessel <d.kessel@gmx.de>

# running the mysql testsuite as described in:
# https://bugs.launchpad.net/ubuntu/+source/mysql-5.5/+bug/959683

echo "Running test 'testsuite'"
set -e

MTR_SKIP_TEST_LIST=$(mktemp)
ARCH=$(dpkg --print-architecture)

WORKDIR=$(mktemp -d)
trap 'rm -rf $WORKDIR $MTR_SKIP_TEST_LIST' 0 INT QUIT ABRT PIPE TERM
cd "$WORKDIR"

mkdir var
mkdir tmp

echo "using vardir: $WORKDIR/var"
echo "using tmpdir: $WORKDIR/tmp"

echo "Setting up skip-tests-list"

# Use the arch specific skiplists if exist, otherwise list is empty
if [ -f "/usr/share/mariadb/mariadb-test/unstable-tests.$ARCH" ]
then
  cat "/usr/share/mariadb/mariadb-test/unstable-tests.$ARCH" >> "$MTR_SKIP_TEST_LIST"
fi

# Skip tests that cannot run properly on ci.debian.net / autopkgtests.ubuntu.com
cat >> "$MTR_SKIP_TEST_LIST" << EOF
binlog.binlog_server_start_options : Requires writable /usr
main.ctype_uca : Requires writable /usr
rpl.rpl_gtid_mode : Requires starting server as root ref http://bugs.mysql.com/bug.php?id=70517
EOF

# Skip tests that cannot run properly on Gitlab-CI
if [ -n "$GITLAB_CI" ]
then
  cat >> "$MTR_SKIP_TEST_LIST" << EOF
main.mysqld--help : For unknown reason table-cache is 4000 instead of default 421
EOF
fi

# Store skipped test list in artifacts so it can be viewed while debugging
# failed autopkgtest runs
cp -v "$MTR_SKIP_TEST_LIST" "$AUTOPKGTEST_ARTIFACTS"

cd /usr/share/mariadb/mariadb-test
echo "starting mysql-test-tun.pl..."
export MTR_PRINT_CORE=detailed
# The $MTR_ARGUMENTS_APPEND is intentionally used to pass in extra arguments
# shellcheck disable=SC2086
eatmydata perl -I. ./mysql-test-run.pl \
    --force --testcase-timeout=120 --suite-timeout=540 --retry=3 \
    --verbose-restart --max-save-core=1 --max-save-datadir=1 \
    --parallel=auto --skip-rpl --suite=main \
    --skip-test-list="$MTR_SKIP_TEST_LIST" \
    --vardir="$WORKDIR/var" --tmpdir="$WORKDIR/tmp" \
    --xml-report="$AUTOPKGTEST_ARTIFACTS/mysql-test-run-junit.xml" \
    $MTR_ARGUMENTS_APPEND \
    "$@" 2>&1
echo "run: OK"