Skip to content

Commit 7b9aa85

Browse files
authored
Merge pull request mysql#45 from planetscale/piki/e2e-tests-on-main
Run integration tests
2 parents ce65b08 + ef1f45f commit 7b9aa85

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+79
-14833
lines changed

.buildkite/pipeline.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ env:
1111

1212
steps:
1313
- name: "Build mysql-server"
14+
key: "build"
1415
label: ":docker: Build and package"
1516
command: bash build.sh
1617
artifact_paths:
@@ -25,9 +26,19 @@ steps:
2526
- "ubuntu:focal"
2627
- "ubuntu:jammy"
2728

28-
- wait
29+
- name: "Integration tests on debug build"
30+
label: ":docker: Build a debug binary and run integration tests"
31+
command: bash integration-tests.sh
32+
agents:
33+
queue: whopper
34+
plugins:
35+
- docker-compose#v3.10.0:
36+
run: builder
37+
env:
38+
DISTRO: "debian:bullseye-slim"
2939

3040
- name: "Build runtime mysql-server container for branch"
41+
depends_on: "build"
3142
label: ":docker: Build runtime branch container"
3243
command: "/usr/sbin/mysqld -V"
3344
branches: "!${MAIN_BRANCH}"
@@ -42,6 +53,7 @@ steps:
4253
- "release:${REGISTRY}/branch/${IMAGE_NAME}:${CONTAINER_SEMVER}-ps-${CONTAINER_SHORT_SHA}-${CONTAINER_BRANCH_NAME}"
4354

4455
- name: "Build runtime mysql-server container for main"
56+
depends_on: "build"
4557
label: ":docker: Build runtime main container"
4658
command: "/usr/sbin/mysqld -V"
4759
branches: "${MAIN_BRANCH}"

Dockerfile.build

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ RUN apt-get install -y \
2929
libssl-dev \
3030
net-tools \
3131
git-core \
32+
zip \
33+
unzip \
3234
tzdata
3335

3436
RUN adduser --disabled-password --no-create-home --gecos '' bob --uid 1234

_planetscale/docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ The public repo has only one branch, `8.0`, which is a fork of the upstream `8.0
2020

2121
```sh
2222
git co -- README
23-
rm -r .buildkite/ .dockerignore Dockerfile.* _planetscale/ build.sh docker-compose.yml
23+
rm -r .buildkite/ .dockerignore Dockerfile.* _planetscale/ build.sh integration-tests.sh docker-compose.yml
2424
```
2525

2626
The public repo has one tag per image that we have deployed broadly, with the format `8.0.30-ps1`. In general, create a commit only when rolling out a new image, which means there will be one tag per commit. The semver in each tag is the upstream version the build is based on. The final number (`1` in `ps1`) in each tag is sequential and has no semantic (i.e., compatibility) meaning.

build.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
set -e
44

55
if [ $(id -u) -eq 0 ]; then
6-
su bob -c ./build.sh
6+
cd "$(dirname ${0})"
7+
SCRIPT="$(basename ${0})"
8+
su bob -c "./${SCRIPT}"
79
cp build/*.tar.gz /dist/
810
exit
911
fi

client/mysql.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3400,7 +3400,7 @@ static int com_go(String *buffer, char *line [[maybe_unused]]) {
34003400
if (info) {
34013401
if (info[0])
34023402
put_info(mysql_info(&mysql), INFO_RESULT);
3403-
else if (info[1])
3403+
else if (info[1] && getenv("MYSQL_METRICS"))
34043404
printf("Metrics: %s\n", info+1);
34053405
}
34063406
put_info("", INFO_RESULT); // Empty row

client/mysqltest.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8353,7 +8353,7 @@ static void append_info(DYNAMIC_STRING *ds, ulonglong affected_rows,
83538353
char buf[40], buff2[21];
83548354
sprintf(buf, "affected rows: %s\n", llstr(affected_rows, buff2));
83558355
dynstr_append(ds, buf);
8356-
if (info) {
8356+
if (info && info[0]) {
83578357
dynstr_append(ds, "info: ");
83588358
dynstr_append(ds, info);
83598359
dynstr_append_mem(ds, "\n", 1);

integration-tests.sh

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
if [ $(id -u) -eq 0 ]; then
6+
cd "$(dirname ${0})"
7+
SCRIPT="$(basename ${0})"
8+
su bob -c "./${SCRIPT}"
9+
exit
10+
fi
11+
12+
if [ -d build ]; then
13+
rm -rf build
14+
fi
15+
16+
mkdir build
17+
cd build
18+
19+
cmake \
20+
-DWITH_BOOST=boost-lib \
21+
-DDOWNLOAD_BOOST=1 \
22+
-DBUILD_CONFIG=mysql_release \
23+
-DCMAKE_INSTALL_PREFIX=/usr \
24+
-DCMAKE_BUILD_TYPE=Release \
25+
-DSYSCONFDIR=/etc/mysql \
26+
-DMYSQL_UNIX_ADDR=/var/run/mysqld/mysqld.sock \
27+
-DWITH_MECAB=system \
28+
-DWITH_NUMA=ON \
29+
-DCOMPILATION_COMMENT="PlanetScale MySQL" \
30+
-DCOMPILATION_COMMENT_SERVER="PlanetScale MySQL Server" \
31+
-DINSTALL_LAYOUT=DEB \
32+
-DREPRODUCIBLE_BUILD=OFF \
33+
\
34+
-DENABLED_PROFILING=0 \
35+
-DENABLE_GCOV=0 \
36+
-DENABLE_GPROF=0 \
37+
-DWITH_CLIENT_PROTOCOL_TRACING=0 \
38+
-DWITH_DEBUG=1 \
39+
-DWITH_INNODB_EXTRA_DEBUG=0 \
40+
-DWITH_KERBEROS=none \
41+
-DINSTALL_MYSQLTESTDIR=\
42+
-DWITH_ROUTER=OFF \
43+
..
44+
45+
echo Building on $(nproc) cores
46+
47+
make -j $(nproc)
48+
49+
cd runtime_output_directory
50+
[ -e mysqld ] || ln -s mysqld-debug mysqld
51+
cd ../mysql-test
52+
export MTR_MAX_TEST_FAIL=1000
53+
MTR_PARALLELISM=$[$(nproc) / 2]
54+
./mysql-test-run --force --skip-ndb --nounit-tests --parallel=$MTR_PARALLELISM

mysql-test/r/all_persisted_variables.result

Lines changed: 0 additions & 67 deletions
This file was deleted.

mysql-test/r/file_contents.result

Lines changed: 0 additions & 6 deletions
This file was deleted.

mysql-test/r/loaddata_special.result

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)