Increase test coverage for MDBF versions
This commit is contained in:
parent
9a598e0d6f
commit
6a83d518c2
|
|
@ -8,39 +8,106 @@ on:
|
|||
- cron: "0 5 * * 2"
|
||||
|
||||
jobs:
|
||||
molecule:
|
||||
molecule-distrib-pkg:
|
||||
name: Molecule
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- distro: ubuntu-18.04
|
||||
playbook: converge.yml
|
||||
- distro: ubuntu-18.04
|
||||
playbook: converge-mdbf.yml
|
||||
- distro: ubuntu-20.04
|
||||
playbook: converge.yml
|
||||
- distro: ubuntu-20.04
|
||||
playbook: converge-mdbf.yml
|
||||
distro:
|
||||
- ubuntu-18.04
|
||||
- ubuntu-20.04
|
||||
- ubuntu-21.04
|
||||
- ubuntu-22.04
|
||||
- debian-10
|
||||
- debian-11
|
||||
- debian-sid
|
||||
playbook:
|
||||
- converge.yml
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Install requirements
|
||||
run: |
|
||||
python3 -m pip install --upgrade pip
|
||||
python3 -m pip install -r requirements.txt
|
||||
# This is necessary on GH Actions to allow running systemd in rootless containers
|
||||
# see: https://github.com/actions/virtual-environments/issues/3536
|
||||
# see: https://github.com/ansible-community/molecule/discussions/3155
|
||||
- name: Start systemd user service
|
||||
run: |
|
||||
loginctl enable-linger $(whoami)
|
||||
sleep 1
|
||||
- name: Run molecule
|
||||
run: molecule test
|
||||
env:
|
||||
PY_COLORS: "1"
|
||||
ANSIBLE_FORCE_COLOR: "1"
|
||||
MOLECULE_DISTRO: ${{ matrix.distro }}
|
||||
MOLECULE_PLAYBOOK: ${{ matrix.playbook }}
|
||||
|
||||
molecule-mdbf-pkg:
|
||||
name: Molecule (MDBF)
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
distro:
|
||||
- ubuntu-18.04
|
||||
- ubuntu-20.04
|
||||
- ubuntu-21.04
|
||||
- ubuntu-22.04
|
||||
- debian-10
|
||||
- debian-11
|
||||
- debian-sid
|
||||
playbook:
|
||||
- converge-mdbf.yml
|
||||
mariadb-version:
|
||||
- 10.3
|
||||
- 10.4
|
||||
- 10.5
|
||||
- 10.6
|
||||
- 10.7
|
||||
- 10.8
|
||||
- 10.9
|
||||
exclude:
|
||||
- distro: ubuntu-21.04
|
||||
playbook: converge.yml
|
||||
mariadb-version: 10.3
|
||||
- distro: ubuntu-21.04
|
||||
playbook: converge-mdbf.yml
|
||||
mariadb-version: 10.4
|
||||
- distro: ubuntu-21.04
|
||||
mariadb-version: 10.8
|
||||
- distro: ubuntu-21.04
|
||||
mariadb-version: 10.9
|
||||
- distro: ubuntu-22.04
|
||||
playbook: converge.yml
|
||||
mariadb-version: 10.3
|
||||
- distro: ubuntu-22.04
|
||||
playbook: converge-mdbf.yml
|
||||
- distro: debian-10
|
||||
playbook: converge.yml
|
||||
- distro: debian-10
|
||||
playbook: converge-mdbf.yml
|
||||
mariadb-version: 10.4
|
||||
- distro: ubuntu-22.04
|
||||
mariadb-version: 10.5
|
||||
# //TEMP remove below for next release
|
||||
- distro: ubuntu-22.04
|
||||
mariadb-version: 10.6
|
||||
- distro: ubuntu-22.04
|
||||
mariadb-version: 10.7
|
||||
# //TEMP remove above for next release
|
||||
- distro: debian-11
|
||||
playbook: converge.yml
|
||||
mariadb-version: 10.3
|
||||
- distro: debian-11
|
||||
playbook: converge-mdbf.yml
|
||||
mariadb-version: 10.4
|
||||
- distro: debian-sid
|
||||
playbook: converge.yml
|
||||
mariadb-version: 10.3
|
||||
- distro: debian-sid
|
||||
mariadb-version: 10.4
|
||||
- distro: debian-sid
|
||||
mariadb-version: 10.5
|
||||
- distro: debian-sid
|
||||
mariadb-version: 10.6
|
||||
- distro: debian-sid
|
||||
mariadb-version: 10.7
|
||||
- distro: debian-sid
|
||||
mariadb-version: 10.8
|
||||
- distro: debian-sid
|
||||
mariadb-version: 10.9
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
|
@ -62,3 +129,4 @@ jobs:
|
|||
ANSIBLE_FORCE_COLOR: "1"
|
||||
MOLECULE_DISTRO: ${{ matrix.distro }}
|
||||
MOLECULE_PLAYBOOK: ${{ matrix.playbook }}
|
||||
MARIADB_VERSION: ${{ matrix.mariadb-version }}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
vars:
|
||||
mariadb_use_official_repo: true
|
||||
mariadb_use_official_repo_url: https://deb.mariadb.org
|
||||
mariadb_use_official_repo_version: 10.5
|
||||
mariadb_use_official_repo_version: "{{ lookup('env', 'MARIADB_VERSION') }}"
|
||||
vars_files: vars/testvars.yml
|
||||
|
||||
roles:
|
||||
|
|
|
|||
|
|
@ -37,34 +37,34 @@ def test_ensure_custom_config_is_applied(host):
|
|||
|
||||
|
||||
def test_ensure_innodb_is_enabled(host):
|
||||
assert host.run("mariadb -Bse 'SHOW ENGINES' |\
|
||||
assert host.run("mysql -Bse 'SHOW ENGINES' |\
|
||||
grep -qE '^InnoDB.DEFAULT.*YES.YES.YES$'").rc == 0
|
||||
|
||||
|
||||
def test_ensure_system_db_exist(host):
|
||||
assert host.run("mariadb -Bse 'SHOW DATABASES' |\
|
||||
assert host.run("mysql -Bse 'SHOW DATABASES' |\
|
||||
grep -q '^mysql$'").rc == 0
|
||||
assert host.run("mariadb -Bse 'SHOW DATABASES' |\
|
||||
assert host.run("mysql -Bse 'SHOW DATABASES' |\
|
||||
grep -q '^information_schema$'").rc == 0
|
||||
assert host.run("mariadb -Bse 'SHOW DATABASES' |\
|
||||
assert host.run("mysql -Bse 'SHOW DATABASES' |\
|
||||
grep -q '^performance_schema$'").rc == 0
|
||||
|
||||
|
||||
def test_ensure_test_db_exist(host):
|
||||
assert host.run("mariadb -Bse 'SHOW DATABASES' |\
|
||||
assert host.run("mysql -Bse 'SHOW DATABASES' |\
|
||||
grep -q '^db1'").rc == 0
|
||||
assert host.run("mariadb -Bse 'SHOW DATABASES' |\
|
||||
assert host.run("mysql -Bse 'SHOW DATABASES' |\
|
||||
grep -q '^db2'").rc == 0
|
||||
|
||||
|
||||
def test_some_sql_queries(host):
|
||||
assert host.run("mariadb -e 'CREATE DATABASE db'").rc == 0
|
||||
assert host.run("mariadb -e 'CREATE TABLE\
|
||||
assert host.run("mysql -e 'CREATE DATABASE db'").rc == 0
|
||||
assert host.run("mysql -e 'CREATE TABLE\
|
||||
db.t_innodb(a1 SERIAL, c1 CHAR(8)) ENGINE=InnoDB;\
|
||||
INSERT INTO db.t_innodb VALUES (1,\"foo\"),(2,\"bar\")'").rc == 0
|
||||
assert host.run("mariadb -e 'CREATE FUNCTION db.f()\
|
||||
assert host.run("mysql -e 'CREATE FUNCTION db.f()\
|
||||
RETURNS INT DETERMINISTIC RETURN 1'").rc == 0
|
||||
assert host.run("mariadb -e 'SHOW TABLES IN db'").rc == 0
|
||||
assert host.run("mariadb -e 'SELECT * FROM db.t_innodb;\
|
||||
assert host.run("mysql -e 'SHOW TABLES IN db'").rc == 0
|
||||
assert host.run("mysql -e 'SELECT * FROM db.t_innodb;\
|
||||
INSERT INTO db.t_innodb VALUES (3,\"foo\"),(4,\"bar\")'").rc == 0
|
||||
assert host.run("mariadb -e 'SELECT db.f()'").rc == 0
|
||||
assert host.run("mysql -e 'SELECT db.f()'").rc == 0
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@
|
|||
- name: Install mariadb repo necessary packages
|
||||
ansible.builtin.apt:
|
||||
package:
|
||||
- software-properties-common
|
||||
- dirmngr
|
||||
- apt-transport-https
|
||||
- gnupg2
|
||||
state: present
|
||||
update_cache: true
|
||||
when: mariadb_use_official_repo
|
||||
|
|
|
|||
Loading…
Reference in New Issue