commit 098564db512773123ce196d256d1ef5bc7a189a7 Author: Sienna Meridian Satterwhite Date: Wed Mar 25 20:05:34 2026 +0000 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. diff --git a/.config/nextest.toml b/.config/nextest.toml new file mode 100644 index 0000000..dcb0131 --- /dev/null +++ b/.config/nextest.toml @@ -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" diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7f71f7a --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +/target +Cargo.lock +*.swp +*.swo +.DS_Store +.env diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..ac49eeb --- /dev/null +++ b/Cargo.toml @@ -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" diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..2ede153 --- /dev/null +++ b/docker-compose.yml @@ -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