Merge pull request 'Test against MariaDB in CI runs' (!138) from test-mariadb into main
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #138
This commit is contained in:
24
.drone.yml
24
.drone.yml
@@ -13,6 +13,16 @@ trigger:
|
||||
branch:
|
||||
- main
|
||||
|
||||
services:
|
||||
- name: mariadb
|
||||
image: mariadb:11.8.3@sha256:851a6020c97b9eae7736b6fb275800601d64635222054d3a1b1b3c4abdfa117a
|
||||
environment:
|
||||
MARIADB_ROOT_PASSWORD: notused
|
||||
MARIADB_DATABASE: ki
|
||||
MARIADB_USER: ki
|
||||
MARIADB_PASSWORD: testing
|
||||
TZ: Europe/Berlin
|
||||
|
||||
steps:
|
||||
- name: install-lint-test
|
||||
image: python:3.10.18-alpine@sha256:24cab748bf7bd8e3d2f9bb4e5771f17b628417527a4e1f2c59c370c2a8a27f1c
|
||||
@@ -26,7 +36,7 @@ steps:
|
||||
- pipenv install --dev
|
||||
- pipenv run flake8
|
||||
- pipenv run reuse lint
|
||||
- SQLALCHEMY_DATABASE_URI=sqlite:// pipenv run python -m unittest discover ki
|
||||
- SQLALCHEMY_DATABASE_URI=mariadb+pymysql://ki:testing@mariadb:3306/ki pipenv run python -m unittest discover ki
|
||||
- name: docker-dry-run
|
||||
image: plugins/docker:20.18.6@sha256:59c993e3c4e6c097a0e2d274419aac0d7d8e929773f0ba1af44078e54389834f
|
||||
settings:
|
||||
@@ -102,6 +112,16 @@ trigger:
|
||||
event:
|
||||
- tag
|
||||
|
||||
services:
|
||||
- name: mariadb
|
||||
image: mariadb:11.8.3@sha256:851a6020c97b9eae7736b6fb275800601d64635222054d3a1b1b3c4abdfa117a
|
||||
environment:
|
||||
MARIADB_ROOT_PASSWORD: notused
|
||||
MARIADB_DATABASE: ki
|
||||
MARIADB_USER: ki
|
||||
MARIADB_PASSWORD: testing
|
||||
TZ: Europe/Berlin
|
||||
|
||||
steps:
|
||||
- name: install-lint-test
|
||||
image: python:3.10.18-alpine@sha256:24cab748bf7bd8e3d2f9bb4e5771f17b628417527a4e1f2c59c370c2a8a27f1c
|
||||
@@ -114,7 +134,7 @@ steps:
|
||||
- pipenv install --dev
|
||||
- pipenv run flake8
|
||||
- pipenv run reuse lint
|
||||
- SQLALCHEMY_DATABASE_URI=sqlite:// pipenv run python -m unittest discover ki
|
||||
- SQLALCHEMY_DATABASE_URI=mariadb+pymysql://ki:testing@mariadb:3306/ki pipenv run python -m unittest discover ki
|
||||
- name: docker-publish
|
||||
image: plugins/docker:20.18.6@sha256:59c993e3c4e6c097a0e2d274419aac0d7d8e929773f0ba1af44078e54389834f
|
||||
settings:
|
||||
|
||||
@@ -18,7 +18,6 @@ class ApiTest(unittest.TestCase):
|
||||
app.debug = True
|
||||
app.config["KI_AUTH"] = "file"
|
||||
app.config["TESTING"] = True
|
||||
app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///:memory:"
|
||||
|
||||
self.client = app.test_client()
|
||||
|
||||
@@ -32,7 +31,8 @@ class ApiTest(unittest.TestCase):
|
||||
|
||||
def tearDown(self):
|
||||
with app.app_context():
|
||||
db.drop_all()
|
||||
config = migrate.get_config()
|
||||
command.downgrade(config, "base")
|
||||
db.engine.dispose()
|
||||
|
||||
def login(self, username, password):
|
||||
|
||||
@@ -22,3 +22,10 @@ def upgrade():
|
||||
existing_type=sa.VARCHAR(length=25),
|
||||
type_=sa.String(length=50),
|
||||
existing_nullable=False)
|
||||
|
||||
def downgrade():
|
||||
with op.batch_alter_table("skill") as batch_op:
|
||||
batch_op.alter_column('name',
|
||||
existing_type=sa.String(length=50),
|
||||
type_=sa.VARCHAR(length=25),
|
||||
existing_nullable=False)
|
||||
|
||||
Reference in New Issue
Block a user