Skip to content

Commit

Permalink
318: add mariadb gh actions
Browse files Browse the repository at this point in the history
  • Loading branch information
John-Sharples committed Sep 4, 2024
1 parent 59696a8 commit c6939c8
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
16 changes: 15 additions & 1 deletion .github/workflows/unit_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ on:
- bugfix_*
- issue_*
- gha_*
- test_*
paths-ignore:
- 'docs/**'
- '.github/pull_request_template.md'
Expand All @@ -27,8 +28,20 @@ on:

jobs:
build:

runs-on: ubuntu-latest

services:
mariadb:
image: mariadb:latest
env:
MARIADB_ROOT_PASSWORD: root_password
MARIADB_DATABASE: test_db
MARIADB_USER: test_user
MARIADB_PASSWORD: test_password
ports:
- 3306:3306
options: --health-cmd="healthcheck.sh --connect --innodb_initialized" --health-interval=10s --health-timeout=5s --health-retries=3

strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -67,6 +80,7 @@ jobs:

- name: Test with pytest
run: |
coverage run --append -m pytest METdbLoad/test
coverage run --append -m pytest METreformat
coverage run --append -m pytest METreadnc
coverage report -m
Expand Down
12 changes: 12 additions & 0 deletions METdbLoad/test/test_mysql_conn.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import pymysql


def test_mysql_available():
conn = pymysql.connect(host='localhost',
port=3306,
user='root',
password='root_password',
)

conn.cursor().execute("CREATE DATABASE mv_test")

0 comments on commit c6939c8

Please sign in to comment.