This commit is contained in:
Laurenz 2024-05-01 20:04:21 +02:00
parent 3a27c7e389
commit be4e698d61
5 changed files with 13 additions and 2 deletions

4
.gitignore vendored
View file

@ -2,8 +2,10 @@
.vs/
.vscode/
.idea/
.env
*.pdf
target/
go_client/openapi.json
crates/storage-sled/sled_db
crates/storage-sled/sled_db
test.db

View file

@ -7,6 +7,7 @@ RUN go mod download
COPY . .
# RUN go build -o /app
RUN go build
CMD go test tests/*
# FROM docker.io/library/alpine:3.19

View file

@ -13,7 +13,8 @@ import (
var client *vault.Client
var ctx context.Context
var mountpath = ""
// Apparently used as a default if mountpath is an empty string (client library)
var mountpath = "/kv-v2"
func TestMain(m *testing.M) {
ctx = context.Background()

View file

@ -4,3 +4,5 @@ CREATE TABLE secret_engines (
mount_point TEXT PRIMARY KEY NOT NULL,
engine_type TEXT NOT NULL
);
INSERT INTO secret_engines (mount_point, engine_type) VALUES ('/kv-v2', 'kv');

View file

@ -23,5 +23,10 @@ pub async fn create_pool(db_url: String) -> AnyPool {
.await
.expect(&db_url);
sqlx::migrate!()
.run(&pool)
.await
.expect("Failed to apply migrations");
pool
}