Skip to content

Commit

Permalink
travis: docker test all versions
Browse files Browse the repository at this point in the history
  • Loading branch information
grooverdan committed Jan 28, 2021
1 parent 8cda55a commit be5809e
Showing 1 changed file with 29 additions and 61 deletions.
90 changes: 29 additions & 61 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,63 +1,22 @@
sudo: false

language: perl
perl:
- "5.24"

os: linux
dist: focal

matrix:
include:
# - addons:
# mariadb: "5.5"
# name: "MariaDB 5.5/Perl 5.24"
# perl: "5.24"
# - addons:
# mariadb: "10.0"
# name: "MariaDB 10.0/Perl 5.24"
# perl: "5.24"
# - addons:
# mariadb: "10.1"
# name: "MariaDB 10.1/Perl 5.24"
# perl: "5.24"
- addons:
mariadb: "10.2"
name: "MariaDB 10.2/Perl 5.24"
perl: "5.24"
- addons:
mariadb: "10.5"
name: "MariaDB 10.5/Perl 5.24"
perl: "5.24"
sudo: true
env: VERSION=mariadb-10.5
# - addons:
# mysql: "5.5"
# name: "MySQL 5.5/Perl 5.24"
# perl: "5.24"
# - addons:
# mysql: "5.6"
# name: "MySQL 5.6/Perl 5.24"
# perl: "5.24"
# - addons:
# apt:
# sources:
# - mysql-5.7-trusty
# packages:
# - mysql-server
# - mysql-client
# name: "MySQL 5.7/Perl 5.24"
# perl: "5.24"
# - addons:
# apt:
# sources:
# - mysql-8.0-trusty
# packages:
# - mysql-server
# - mysql-client
# name: "MySQL 8/Perl 5.24"
# perl: "5.24"
services:
- docker

before_install:
- git clone git://github.com/haarg/perl-travis-helper
- source perl-travis-helper/init
- build-perl
- perl -V
env:
- DB=mariadb:5.5
- DB=mariadb:10.2
- DB=mariadb:10.3
- DB=mariadb:10.4
- DB=mariadb:10.5
- DB=mysql:5.5
- DB=mysql:5.7
- DB=mysql:8.0

install:
- cpanm --quiet --notest Data::Dumper
Expand All @@ -66,18 +25,27 @@ install:
- cpanm --quiet --notest Text::Template

before_script:
# MariaDB-10.4?+ has unix_plugin socket auth, but no password is set.
- if [ "$VERSION" == 'mariadb-10.5' ]; then sudo mysql -e 'SET PASSWORD = PASSWORD("")'; fi
- echo -e "[client]\nuser=root\npassword=\"\"" > .my.cnf
- chmod 600 .my.cnf
- mysql --version
- mysqladmin --version
- docker run -it --name=mysqltestinstance -d -e MYSQL_ALLOW_EMPTY_PASSWORD=yes -p 3306:3306 ${DB}
- echo -e "[client]\nuser=root\npassword=\"\"\nhost=127.0.0.1" > ~/.my.cnf
- chmod 600 ~/.my.cnf
- git clone https://github.com/datacharmer/test_db.git
- cd test_db
- count=10
- while ! mysql -e 'select version()' && [ $count -gt 0 ]; do echo $count seconds to go; sleep 1; count=$(( $count - 1 )); done
- if [ $DB == 'mysql:8.0' ]; then
for file in public_key.pem ca.pem server-cert.pem client-key.pem client-cert.pem ; do
docker cp mysqltestinstance:/var/lib/mysql/$file "${HOME}" ;
done ;
fi
- "cat employees.sql | grep -v 'storage_engine' | mysql"
- cd ..

script:
- ./mysqltuner.pl --verbose --tbstat 2>stderr.txt | tee -a "stdout.txt"

after_script:
- docker stop mysqltestinstance
- echo "Standard Output: $(cat stdout.txt)"
- echo "Standard Error : $(cat stderr.txt)"

0 comments on commit be5809e

Please sign in to comment.