-
Notifications
You must be signed in to change notification settings - Fork 0
features smoke testing
Active contributors: Douwe de Vries
Smoke testing runs selected resolved requests directly from the Rust backend before a full k6 run. It is a quick check for base URL, auth, variables, headers, and target availability.
src/features/test/useSmokeTest.ts
src/app/components/SmokeTestCard.tsx
src-tauri/src/commands/testing/mod.rs
src-tauri/src/commands/testing/smoke.rs
src-tauri/src/importing/runtime.rs
| Abstraction | File | Description |
|---|---|---|
SmokeTestResponse |
src/lib/loadrift/types.ts, src-tauri/src/models.rs
|
List of smoke test results |
SmokeTestResult |
src/lib/loadrift/types.ts, src-tauri/src/models.rs
|
Status code, duration, headers, body preview, and error for one request |
ResolvedRuntimeRequest |
src-tauri/src/importing/mod.rs |
Request after variables, base URL, and auth are resolved |
sequenceDiagram
participant UI
participant Command
participant Resolver
participant Reqwest
UI->>Command: smoke_test_requests
Command->>Resolver: resolve_test_requests
Resolver-->>Command: resolved requests
Command->>Reqwest: execute each request
Reqwest-->>Command: status, headers, body preview
Command-->>UI: SmokeTestResponse
smoke_test_requests in src-tauri/src/commands/testing/mod.rs rejects calls while a k6 run is busy, resolves selected requests through src-tauri/src/importing/runtime.rs, then runs smoke::run_smoke_test on a blocking task. src-tauri/src/commands/testing/smoke.rs limits smoke tests to 25 selected requests, 30 seconds per request, and 120 seconds total. Body previews are capped at 16 KiB.
Smoke tests use the same request resolution path as k6 validation, so failures usually point to collection variables, base URL, auth, selected request IDs, or unsupported URLs. For selection rules, see Request selection.
Change limits in src-tauri/src/commands/testing/smoke.rs. Change UI state in src/features/test/useSmokeTest.ts. Change resolution behavior in src-tauri/src/importing/runtime.rs.
| File | Purpose |
|---|---|
src/features/test/useSmokeTest.ts |
Frontend smoke test hook |
src/app/components/SmokeTestCard.tsx |
Smoke test UI |
src-tauri/src/commands/testing/mod.rs |
Tauri smoke command |
src-tauri/src/commands/testing/smoke.rs |
reqwest execution and limits |
src-tauri/src/importing/runtime.rs |
Request resolution before network calls |