Skip to content

features load test workflow

Douwe de Vries edited this page Jul 1, 2026 · 1 revision

Load test workflow

Active contributors: Douwe de Vries

Purpose

The core workflow takes a Postman collection through import, configuration, validation, smoke testing, k6 execution, live monitoring, and report export. src/app/App.tsx coordinates that flow with hooks from src/features/import/, src/features/test/, and src/app/hooks/.

Directory layout

src/app/App.tsx
src/app/components/CollectionImportSection.tsx
src/app/components/TestHarnessSection.tsx
src/features/import/useCollectionImport.ts
src/features/test/useConfigValidation.ts
src/features/test/useSmokeTest.ts
src/features/test/useTestHarness.ts
src/lib/loadrift/api.ts
src/lib/loadrift/types.ts

Key abstractions

Abstraction File Description
LoadRiftApi src/lib/loadrift/api.ts Frontend interface for import, validation, smoke test, run, stop, export, status, and events
K6Options src/lib/loadrift/types.ts User-controlled load profile, auth, base URL, variables, selection, traffic mode, and advanced JSON
useCollectionImport src/features/import/useCollectionImport.ts Imports a collection and stores the latest CollectionInfo
useConfigValidation src/features/test/useConfigValidation.ts Debounces backend readiness checks before enabling runs
useTestHarness src/features/test/useTestHarness.ts Starts/stops runs and consumes k6 events

How it works

graph LR
    File[Select JSON] --> Import[Import collection]
    Import --> Configure[Configure k6 options]
    Configure --> Validate[Validate readiness]
    Validate --> Smoke[Optional smoke test]
    Validate --> Run[Start k6]
    Run --> Monitor[Live output and metrics]
    Monitor --> Export[Export HTML report]
Loading

src/app/App.tsx normalizes runner options with normalizeRunnerOptionsForExecution from src/app/utils.ts, then passes them to validation and execution. The start button is enabled only when a collection exists, local input validation passes, backend config validation is ready, and neither smoke testing nor k6 execution is busy.

Integration points

The workflow calls the command bridge documented in Command API bridge. k6 process details live in k6 runtime, while the import details live in Postman import.

Entry points for modification

Change workflow wiring in src/app/App.tsx. Change form state in src/app/hooks/useRunnerOptions.ts. Change backend readiness rules in src-tauri/src/commands/testing/logic.rs.

Key source files

File Purpose
src/app/App.tsx Top-level workflow state and actions
src/features/test/useConfigValidation.ts Debounced readiness checks
src/features/test/useTestHarness.ts Live run lifecycle state
src/features/test/useSmokeTest.ts Smoke test state
src/lib/loadrift/api.ts Workflow API contract

Clone this wiki locally