Adding integration test crate
This commit is contained in:
parent
b2033148d1
commit
ae90c587b0
8 changed files with 73 additions and 1 deletions
7
Cargo.lock
generated
7
Cargo.lock
generated
|
|
@ -1368,6 +1368,13 @@ dependencies = [
|
||||||
"urlencoding",
|
"urlencoding",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "szurubooru-integration-test"
|
||||||
|
version = "0.1.0"
|
||||||
|
dependencies = [
|
||||||
|
"szurubooru-client",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tempfile"
|
name = "tempfile"
|
||||||
version = "3.12.0"
|
version = "3.12.0"
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
[workspace]
|
[workspace]
|
||||||
resolver = "2"
|
resolver = "2"
|
||||||
members = [
|
members = [
|
||||||
"szurubooru-client"
|
"szurubooru-client",
|
||||||
|
"szurubooru-integration-test"
|
||||||
]
|
]
|
||||||
|
|
|
||||||
7
szurubooru-integration-test/Cargo.toml
Normal file
7
szurubooru-integration-test/Cargo.toml
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
[package]
|
||||||
|
name = "szurubooru-integration-test"
|
||||||
|
version = "0.1.0"
|
||||||
|
edition = "2021"
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
szurubooru-client = { version = "0.1.0", path = "../szurubooru-client" }
|
||||||
48
szurubooru-integration-test/docker-compose.yml
Normal file
48
szurubooru-integration-test/docker-compose.yml
Normal file
|
|
@ -0,0 +1,48 @@
|
||||||
|
## Example Docker Compose configuration
|
||||||
|
##
|
||||||
|
## Use this as a template to set up docker-compose, or as guide to set up other
|
||||||
|
## orchestration services
|
||||||
|
version: '2'
|
||||||
|
|
||||||
|
services:
|
||||||
|
|
||||||
|
server:
|
||||||
|
image: szurubooru/server:latest
|
||||||
|
depends_on:
|
||||||
|
- sql
|
||||||
|
environment:
|
||||||
|
## These should be the names of the dependent containers listed below,
|
||||||
|
## or FQDNs/IP addresses if these services are running outside of Docker
|
||||||
|
POSTGRES_HOST: sql
|
||||||
|
## Credentials for database:
|
||||||
|
POSTGRES_USER:
|
||||||
|
POSTGRES_PASSWORD:
|
||||||
|
## Commented Values are Default:
|
||||||
|
#POSTGRES_DB: defaults to same as POSTGRES_USER
|
||||||
|
#POSTGRES_PORT: 5432
|
||||||
|
#LOG_SQL: 0 (1 for verbose SQL logs)
|
||||||
|
THREADS:
|
||||||
|
volumes:
|
||||||
|
- "${MOUNT_DATA}:/data"
|
||||||
|
- "${SERVER_MOUNT}/config.yaml:/opt/app/config.yaml"
|
||||||
|
|
||||||
|
client:
|
||||||
|
image: szurubooru/client:latest
|
||||||
|
depends_on:
|
||||||
|
- server
|
||||||
|
environment:
|
||||||
|
BACKEND_HOST: server
|
||||||
|
BASE_URL: ${BASE_URL}
|
||||||
|
volumes:
|
||||||
|
- "${MOUNT_DATA}:/data:ro"
|
||||||
|
ports:
|
||||||
|
- "${PORT}:80"
|
||||||
|
|
||||||
|
sql:
|
||||||
|
image: postgres:11-alpine
|
||||||
|
restart: unless-stopped
|
||||||
|
environment:
|
||||||
|
POSTGRES_USER:
|
||||||
|
POSTGRES_PASSWORD:
|
||||||
|
volumes:
|
||||||
|
- "${MOUNT_SQL}:/var/lib/postgresql/data"
|
||||||
9
szurubooru-integration-test/start_szurubooru.sh
Normal file
9
szurubooru-integration-test/start_szurubooru.sh
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
export MOUNT_DATA=szurubooru/data
|
||||||
|
export SERVER_MOUNT=szurubooru/server
|
||||||
|
export MOUNT_SQL=szurubooru/pgsql
|
||||||
|
export BASE_URL=http://localhost:5000
|
||||||
|
export PORT=5000
|
||||||
|
|
||||||
|
docker compose up -d
|
||||||
0
szurubooru-integration-test/szurubooru/pgsql/.gitkeep
Normal file
0
szurubooru-integration-test/szurubooru/pgsql/.gitkeep
Normal file
0
szurubooru-integration-test/szurubooru/server/.gitkeep
Normal file
0
szurubooru-integration-test/szurubooru/server/.gitkeep
Normal file
Loading…
Add table
Add a link
Reference in a new issue