chore: scaffold workspace with nextest and docker compose

Workspace with 6 crates: wfe-core, wfe-sqlite, wfe-postgres,
wfe-opensearch, wfe-valkey, and wfe (umbrella). Nextest profiles
for default, integration, and CI. Docker compose for PostgreSQL,
Valkey, and OpenSearch integration tests.
This commit is contained in:
2026-03-25 20:05:34 +00:00
commit 098564db51
4 changed files with 129 additions and 0 deletions

40
.config/nextest.toml Normal file
View File

@@ -0,0 +1,40 @@
[store]
dir = "target/nextest"
[profile.default]
test-threads = "num-cpus"
status-level = "pass"
final-status-level = "flaky"
failure-output = "immediate-final"
success-output = "never"
fail-fast = true
slow-timeout = { period = "30s", terminate-after = 2 }
[profile.default.junit]
path = "target/nextest/default/junit.xml"
[profile.integration]
test-threads = 4
fail-fast = false
slow-timeout = { period = "120s", terminate-after = 2 }
failure-output = "immediate-final"
retries = 1
[profile.integration.junit]
path = "target/nextest/integration/junit.xml"
[profile.ci]
fail-fast = false
test-threads = "num-cpus"
failure-output = "immediate-final"
success-output = "final"
slow-timeout = { period = "60s", terminate-after = 3 }
retries = 2
[profile.ci.junit]
path = "target/nextest/ci/junit.xml"
# Postgres tests must run serially (shared database state)
[[profile.default.overrides]]
filter = "package(wfe-postgres)"
threads-required = "num-cpus"

6
.gitignore vendored Normal file
View File

@@ -0,0 +1,6 @@
/target
Cargo.lock
*.swp
*.swo
.DS_Store
.env

45
Cargo.toml Normal file
View File

@@ -0,0 +1,45 @@
[workspace]
members = ["wfe-core", "wfe-sqlite", "wfe-postgres", "wfe-opensearch", "wfe-valkey", "wfe"]
resolver = "2"
[workspace.package]
version = "0.1.0"
edition = "2024"
license = "MIT"
[workspace.dependencies]
# Core
tokio = { version = "1", features = ["full"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
async-trait = "0.1"
uuid = { version = "1", features = ["v4", "serde"] }
chrono = { version = "0.4", features = ["serde"] }
thiserror = "2"
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
# HTTP
reqwest = { version = "0.12", features = ["json"] }
# Persistence
sqlx = { version = "0.8", features = ["runtime-tokio", "tls-rustls", "sqlite", "postgres", "chrono", "uuid", "json"] }
# Redis/Valkey
redis = { version = "0.27", features = ["tokio-comp", "connection-manager"] }
# Search
opensearch = "2"
# Internal crates
wfe-core = { path = "wfe-core" }
wfe-sqlite = { path = "wfe-sqlite" }
wfe-postgres = { path = "wfe-postgres" }
wfe-opensearch = { path = "wfe-opensearch" }
wfe-valkey = { path = "wfe-valkey" }
# Dev/Test
pretty_assertions = "1"
rstest = "0.23"
wiremock = "0.6"
tokio-stream = "0.1"

38
docker-compose.yml Normal file
View File

@@ -0,0 +1,38 @@
services:
postgres:
image: postgres:17
environment:
POSTGRES_USER: wfe
POSTGRES_PASSWORD: wfe
POSTGRES_DB: wfe_test
ports:
- "5433:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U wfe"]
interval: 2s
timeout: 5s
retries: 10
valkey:
image: valkey/valkey:8
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "valkey-cli", "ping"]
interval: 2s
timeout: 5s
retries: 10
opensearch:
image: opensearchproject/opensearch:2
environment:
- discovery.type=single-node
- DISABLE_SECURITY_PLUGIN=true
- OPENSEARCH_INITIAL_ADMIN_PASSWORD=admin
ports:
- "9200:9200"
healthcheck:
test: ["CMD-SHELL", "curl -s http://localhost:9200 | grep -q 'opensearch'"]
interval: 5s
timeout: 10s
retries: 20