Commit ed729827 authored by Otto Kekäläinen's avatar Otto Kekäläinen
Browse files

Extend gitlab-ci.yml to cover more install/upgrade scenarios

parent 250d7409
...@@ -95,6 +95,35 @@ run lintian stretch: ...@@ -95,6 +95,35 @@ run lintian stretch:
# tags: # tags:
# - privileged # - privileged
.test_install: &test_install
stage: test
artifacts:
when: always
name: "$CI_BUILD_NAME"
paths:
- ${WORKING_DIR}/debug
script:
- cd ${WORKING_DIR} # Don't repeat this step, it's just cd ./debian/output
- mkdir debug
- dpkg -l | grep -iE '"'"'maria|mysql|galera'"'"' || true
- apt-get update
- dpkg -i *.deb || true
- DEBIAN_FRONTEND=noninteractive apt-get -f install --assume-yes
- mariadb --version
- find /var/lib/mysql -ls > debug/var-lib-mysql.list
- cp -ra /etc/mysql debug/etc-mysql
- service mysql restart || true # Always proceed even if init failed
- service mysql status || true
- cp -ra /var/log/mysql debug/var-log-mysql
- mariadb --skip-column-names -e "select @@version, @@version_comment"
- mariadb -e "create database test; use test; create table t(a int primary key) engine=innodb; insert into t values (1); select * from t; drop table t; drop database test;"
test install stretch:
<<: *test_install
image: debian:stretch
dependencies:
- build package stretch
test upgrade stretch: test upgrade stretch:
stage: test stage: test
dependencies: dependencies:
...@@ -123,3 +152,100 @@ test upgrade stretch: ...@@ -123,3 +152,100 @@ test upgrade stretch:
- cp -ra /var/log/mysql debug/var-log-mysql - cp -ra /var/log/mysql debug/var-log-mysql
- mariadb --skip-column-names -e "select @@version, @@version_comment" - mariadb --skip-column-names -e "select @@version, @@version_comment"
- mariadb -e "create database test; use test; create table t(a int primary key) engine=innodb; insert into t values (1); select * from t; drop table t; drop database test;" - mariadb -e "create database test; use test; create table t(a int primary key) engine=innodb; insert into t values (1); select * from t; drop table t; drop database test;"
# Stretch does not have MySQL 5.5/5.6/5.7 so cannot test this without further engineering
#test mysql upgrade:
# stage: test
# image: debian:stretch
# script:
# - apt-get update
# - apt-get install -y mysql-server
# - /etc/init.d/mysql restart
# - mysql --version
# - echo 'SHOW DATABASES;' | mysql
# - cd ${WORKING_DIR}; apt-get install -y ./*.deb
# - /etc/init.d/mysql restart
# - mariadb --version
# - echo 'SHOW DATABASES;' | mariadb
.test_features: &test_features
stage: test
artifacts:
when: always
name: "$CI_BUILD_NAME"
paths:
- ${WORKING_DIR}/debug
script:
- cd ${WORKING_DIR} # Don't repeat this step, it's just cd ./debian/output
- mkdir debug
- dpkg -l | grep -iE '"'"'maria|mysql|galera'"'"' || true
- apt-get update
- dpkg -i *.deb || true
- DEBIAN_FRONTEND=noninteractive apt-get -f install --assume-yes
- mariadb --version
- find /var/lib/mysql -ls > debug/var-lib-mysql.list
- cp -ra /etc/mysql debug/etc-mysql
- service mysql restart || true # Always proceed even if init failed
- service mysql status || true
- cp -ra /var/log/mysql debug/var-log-mysql
# Print info about server
- mariadb --skip-column-names -e "select @@version, @@version_comment"
- mariadb --skip-column-names -e "select engine, support, transactions, savepoints from information_schema.engines order by engine" | sort
- mariadb --skip-column-names -e "select plugin_name, plugin_status, plugin_type, plugin_library, plugin_license from information_schema.all_plugins order by plugin_name, plugin_library"
# Test various features
- mariadb -e "CREATE DATABASE db"
- mariadb -e "CREATE TABLE db.t_innodb(a1 SERIAL, c1 CHAR(8)) ENGINE=InnoDB; INSERT INTO db.t_innodb VALUES (1,'"'"'foo'"'"'),(2,'"'"'bar'"'"')"
- mariadb -e "CREATE TABLE db.t_myisam(a2 SERIAL, c2 CHAR(8)) ENGINE=MyISAM; INSERT INTO db.t_myisam VALUES (1,'"'"'foo'"'"'),(2,'"'"'bar'"'"')"
- mariadb -e "CREATE TABLE db.t_aria(a3 SERIAL, c3 CHAR(8)) ENGINE=Aria; INSERT INTO db.t_aria VALUES (1,'"'"'foo'"'"'),(2,'"'"'bar'"'"')"
- mariadb -e "CREATE TABLE db.t_memory(a4 SERIAL, c4 CHAR(8)) ENGINE=MEMORY; INSERT INTO db.t_memory VALUES (1,'"'"'foo'"'"'),(2,'"'"'bar'"'"')"
- mariadb -e "CREATE ALGORITHM=MERGE VIEW db.v_merge AS SELECT * FROM db.t_innodb, db.t_myisam, db.t_aria"
- mariadb -e "CREATE ALGORITHM=TEMPTABLE VIEW db.v_temptable AS SELECT * FROM db.t_innodb, db.t_myisam, db.t_aria"
- mariadb -e "CREATE PROCEDURE db.p() SELECT * FROM db.v_merge"
- mariadb -e "CREATE FUNCTION db.f() RETURNS INT DETERMINISTIC RETURN 1"
# Test that the features still work (this step can be done e.g. after an upgrade)
- mariadb -e "SHOW TABLES IN db"
- mariadb -e "SELECT * FROM db.t_innodb; INSERT INTO db.t_innodb VALUES (3,'"'"'foo'"'"'),(4,'"'"'bar'"'"')"
- mariadb -e "SELECT * FROM db.t_myisam; INSERT INTO db.t_myisam VALUES (3,'"'"'foo'"'"'),(4,'"'"'bar'"'"')"
- mariadb -e "SELECT * FROM db.t_aria; INSERT INTO db.t_aria VALUES (3,'"'"'foo'"'"'),(4,'"'"'bar'"'"')"
- mariadb -e "SELECT * FROM db.t_memory; INSERT INTO db.t_memory VALUES (3,'"'"'foo'"'"'),(4,'"'"'bar'"'"')"
- mariadb -e "SELECT COUNT(*) FROM db.v_merge"
- mariadb -e "SELECT COUNT(*) FROM db.v_temptable"
- mariadb -e "CALL db.p()"
- mariadb -e "SELECT db.f()"
test features stretch:
<<: *test_features
image: debian:stretch
dependencies:
- build package stretch
test upgrade-libmysql stretch:
stage: test
image: debian:stretch
artifacts:
when: always
name: "$CI_BUILD_NAME"
paths:
- ${WORKING_DIR}/debug
script:
- cd ${WORKING_DIR} # Don't repeat this step, it's just cd ./debian/output
- mkdir debug
- dpkg -l | grep -iE "maria|mysql|galera" || true
- apt-get update
- apt-get install -y libc-bin pkg-config
- pkg-config --list-all
- apt-get install -y ./libmariadbclient18_*.deb ./mariadb-common_*.deb
- pkg-config --list-all
- apt-get install -y ./libmariadbclient-dev_*.deb
- pkg-config --list-all
- apt-get install -y ./libmariadbclient-dev-compat_*.deb
- pkg-config --list-all
- apt-get install -y ./libmariadbd18_*.deb
- pkg-config --list-all
- apt-get install -y ./libmariadbd-dev_*.deb
- pkg-config --list-all
- apt-get install -y libmariadb2 libmariadb-dev libmariadb-dev-compat
- pkg-config --list-all
- apt-get install -y default-libmysqlclient-dev default-libmysqld-dev
- pkg-config --list-all
- ldconfig -p
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment