Files
weevil/Cargo.toml
Eric Ratliff 58f7962a2a v1.1.0-beta.1: add proxy integration tests (62 tests, all green)
Nine end-to-end tests for the proxy feature: 6 network tests exercising
every proxy code path through a real hyper forward proxy (TestProxy) and
a mockito origin, plus 3 CLI tests verifying flag parsing and error handling.

TestProxy binds to 127.0.0.1:0, forwards in absolute-form, counts requests
via an atomic so we can assert traffic actually traversed the proxy.

Key issues resolved during implementation:

- ENV_MUTEX serializes all tests that mutate HTTPS_PROXY/HTTP_PROXY in both
  the unit test module and the integration suite. Without it, parallel test
  execution within a single binary produces nondeterministic failures.

- reqwest's blocking::Client owns an internal tokio Runtime. Dropping it
  inside a #[tokio::test] async fn panics on tokio >= 1.49. All reqwest
  work runs inside spawn_blocking so the Client drops on a thread-pool
  thread where that's permitted.

- service_fn's closure can't carry a return-type annotation, and async
  blocks don't support one either. The handler is extracted to a named
  async fn (proxy_handler) so the compiler can see the concrete
  Result<Response, Infallible> and satisfy serve_connection's Error bound.
2026-02-01 10:21:11 -06:00

89 lines
1.9 KiB
TOML

[package]
name = "weevil"
version = "1.1.0-beta.1"
edition = "2021"
authors = ["Eric Ratliff <eric@nxlearn.net>"]
description = "FTC robotics project generator - bores into complexity, emerges with clean code"
license = "MIT"
[lib]
name = "weevil"
path = "src/lib.rs"
[[bin]]
name = "weevil"
path = "src/main.rs"
[dependencies]
# CLI framework - beautiful help, subcommands, validation
clap = { version = "4.5", features = ["derive", "cargo"] }
# Filesystem and paths
walkdir = "2.5"
tempfile = "3.13"
dirs = "5.0"
# Templates
tera = "1.20"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
toml = "0.8"
# Embedded resources
include_dir = "0.7"
# Downloads
reqwest = { version = "0.12", features = ["blocking", "stream"] }
tokio = { version = "1.42", features = ["full"] }
# Progress bars
indicatif = "0.17"
# Archive handling
zip = "2.2"
flate2 = "1.0"
tar = "0.4"
# Error handling
anyhow = "1.0"
thiserror = "1.0"
# Git operations
git2 = "0.19"
# Process execution
which = "7.0"
# Colors
colored = "2.1"
[dev-dependencies]
tempfile = "3.13"
assert_cmd = "2.0"
predicates = "3.1"
insta = "1.41"
# Proxy integration tests: mockito is the mock origin server; hyper + friends
# are the forward proxy. All three are already in Cargo.lock as transitive
# deps of reqwest — we're just promoting them to explicit dev-deps with the
# features we actually need.
mockito = "1.7"
hyper = { version = "1", features = ["server", "http1", "client"] }
hyper-util = { version = "0.1", features = ["tokio", "client-legacy", "http1"] }
http-body-util = "0.1"
bytes = "1"
tokio = { version = "1", features = ["full"] }
[build-dependencies]
ureq = { version = "2.10", features = ["json"] }
zip = "2.2"
[profile.release]
opt-level = 3
lto = true
codegen-units = 1
strip = true
[features]
default = []
embedded-gradle = [] # Embed gradle-wrapper.jar in binary (run download-gradle-wrapper.sh first)