Run integration tests on all db types
This commit is contained in:
2
.github/workflows/integration-test.yml
vendored
2
.github/workflows/integration-test.yml
vendored
@@ -52,7 +52,7 @@ jobs:
|
|||||||
needs: [build, build-tester]
|
needs: [build, build-tester]
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
dbtype: ["postgres"]
|
dbtype: ["postgres", "sqlite", "mariadb", "cockroachdb"]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
|
|||||||
39
tests_integration/docker-compose-cockroachdb.yml
Normal file
39
tests_integration/docker-compose-cockroachdb.yml
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
version: '3.9'
|
||||||
|
services:
|
||||||
|
db:
|
||||||
|
image: cockroachdb/cockroach:v23.1.1
|
||||||
|
command: start-single-node
|
||||||
|
environment:
|
||||||
|
- COCKROACH_USER=john
|
||||||
|
- COCKROACH_PASSWORD=abc
|
||||||
|
- COCKROACH_DATABASE=spoolman
|
||||||
|
healthcheck:
|
||||||
|
test:
|
||||||
|
[
|
||||||
|
"CMD",
|
||||||
|
"curl",
|
||||||
|
"-f",
|
||||||
|
"http://localhost:8080/health?ready=1"
|
||||||
|
]
|
||||||
|
interval: 5s
|
||||||
|
timeout: 10s
|
||||||
|
retries: 5
|
||||||
|
spoolman:
|
||||||
|
image: donkie/spoolman:test
|
||||||
|
environment:
|
||||||
|
- SPOOLMAN_DB_TYPE=cockroachdb
|
||||||
|
- SPOOLMAN_DB_HOST=db
|
||||||
|
- SPOOLMAN_DB_PORT=26257
|
||||||
|
- SPOOLMAN_DB_NAME=spoolman
|
||||||
|
- SPOOLMAN_DB_USERNAME=john
|
||||||
|
- SPOOLMAN_DB_PASSWORD=abc
|
||||||
|
- SPOOLMAN_LOGGING_LEVEL=DEBUG
|
||||||
|
depends_on:
|
||||||
|
db:
|
||||||
|
condition: service_healthy
|
||||||
|
tester:
|
||||||
|
image: donkie/spoolman-tester:latest
|
||||||
|
volumes:
|
||||||
|
- ./tests:/tester/tests
|
||||||
|
depends_on:
|
||||||
|
- spoolman
|
||||||
33
tests_integration/docker-compose-mariadb.yml
Normal file
33
tests_integration/docker-compose-mariadb.yml
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
version: '3.9'
|
||||||
|
services:
|
||||||
|
db:
|
||||||
|
image: mariadb:latest
|
||||||
|
environment:
|
||||||
|
- MARIADB_USER=john
|
||||||
|
- MARIADB_RANDOM_ROOT_PASSWORD=yes
|
||||||
|
- MARIADB_PASSWORD=abc
|
||||||
|
- MARIADB_DATABASE=spoolman
|
||||||
|
healthcheck:
|
||||||
|
test: [ "CMD", "mysqladmin", "ping", "-h", "localhost" ]
|
||||||
|
interval: 1s
|
||||||
|
timeout: 20s
|
||||||
|
retries: 10
|
||||||
|
spoolman:
|
||||||
|
image: donkie/spoolman:test
|
||||||
|
environment:
|
||||||
|
- SPOOLMAN_DB_TYPE=mysql
|
||||||
|
- SPOOLMAN_DB_HOST=db
|
||||||
|
- SPOOLMAN_DB_PORT=3306
|
||||||
|
- SPOOLMAN_DB_NAME=spoolman
|
||||||
|
- SPOOLMAN_DB_USERNAME=john
|
||||||
|
- SPOOLMAN_DB_PASSWORD=abc
|
||||||
|
- SPOOLMAN_LOGGING_LEVEL=DEBUG
|
||||||
|
depends_on:
|
||||||
|
db:
|
||||||
|
condition: service_healthy
|
||||||
|
tester:
|
||||||
|
image: donkie/spoolman-tester:latest
|
||||||
|
volumes:
|
||||||
|
- ./tests:/tester/tests
|
||||||
|
depends_on:
|
||||||
|
- spoolman
|
||||||
13
tests_integration/docker-compose-sqlite.yml
Normal file
13
tests_integration/docker-compose-sqlite.yml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
version: '3.8'
|
||||||
|
services:
|
||||||
|
spoolman:
|
||||||
|
image: donkie/spoolman:test
|
||||||
|
environment:
|
||||||
|
- SPOOLMAN_DB_TYPE=sqlite
|
||||||
|
- SPOOLMAN_LOGGING_LEVEL=DEBUG
|
||||||
|
tester:
|
||||||
|
image: donkie/spoolman-tester:latest
|
||||||
|
volumes:
|
||||||
|
- ./tests:/tester/tests
|
||||||
|
depends_on:
|
||||||
|
- spoolman
|
||||||
@@ -6,3 +6,9 @@ os.system("docker build -t donkie/spoolman:test .")
|
|||||||
os.system("docker build -t donkie/spoolman-tester:latest tests_integration")
|
os.system("docker build -t donkie/spoolman-tester:latest tests_integration")
|
||||||
os.system("docker-compose -f tests_integration/docker-compose-postgres.yml down -v")
|
os.system("docker-compose -f tests_integration/docker-compose-postgres.yml down -v")
|
||||||
os.system("docker-compose -f tests_integration/docker-compose-postgres.yml up --abort-on-container-exit")
|
os.system("docker-compose -f tests_integration/docker-compose-postgres.yml up --abort-on-container-exit")
|
||||||
|
os.system("docker-compose -f tests_integration/docker-compose-sqlite.yml down -v")
|
||||||
|
os.system("docker-compose -f tests_integration/docker-compose-sqlite.yml up --abort-on-container-exit")
|
||||||
|
os.system("docker-compose -f tests_integration/docker-compose-mariadb.yml down -v")
|
||||||
|
os.system("docker-compose -f tests_integration/docker-compose-mariadb.yml up --abort-on-container-exit")
|
||||||
|
os.system("docker-compose -f tests_integration/docker-compose-cockroachdb.yml down -v")
|
||||||
|
os.system("docker-compose -f tests_integration/docker-compose-cockroachdb.yml up --abort-on-container-exit")
|
||||||
|
|||||||
Reference in New Issue
Block a user