Skip to content

feat(scenarios): expand to 10 total scenarios + CLI external scenario files#75

Merged
sepehr-safari merged 2 commits into
mainfrom
feat/scenarios-v2
Jul 8, 2026
Merged

feat(scenarios): expand to 10 total scenarios + CLI external scenario files#75
sepehr-safari merged 2 commits into
mainfrom
feat/scenarios-v2

Conversation

@sepehr-safari

Copy link
Copy Markdown
Member

Summary

Expands from 5 to 10 total scenarios and adds CLI support for external scenario files.

New Scenarios

Scenario Expected Failure Description
meter-value-gap METER_VALUE_GAP Transaction with no MeterValues
invalid-stop-reason INVALID_STOP_REASON StopTransaction with invalid 'PowerSurge' reason
unexpected-start UNEXPECTED_START StartTransaction without BootNotification/Authorize
status-transition-violation STATUS_TRANSITION_VIOLATION Available -> Finishing (illegal transition)
diagnostics-failure DIAGNOSTICS_FAILURE DiagnosticsStatusNotification with DiagnosisFailed

CLI External Scenario Files

ocpp-debugkit scenario run --file ./my-scenario.json

The external file must be a JSON object with name, description, trace, and expectedFailures fields (same shape as built-in scenarios).

Changes

  • 5 new scenario fixtures in packages/toolkit/src/scenarios/__scenarios__/
  • Updated index.ts registry to export all 10 scenarios
  • Updated index.test.ts — 36 tests (10 scenarios, engine integration for each, synthetic data policy)
  • Refactored scenario.ts — shared runScenarioInternal(), new scenarioRunFileCommand()
  • Updated cli/index.tsrun [name] with --file option

Verification

  • pnpm test — 295/295 tests pass
  • pnpm build — clean
  • pnpm lint — clean
  • pnpm typecheck — clean
  • pnpm format:check — clean

Closes #60

… files

Add 5 new scenario fixtures aligned with v0.2 detection rules:
- meter-value-gap: transaction with no MeterValues
- invalid-stop-reason: StopTransaction with invalid 'PowerSurge' reason
- unexpected-start: StartTransaction without BootNotification/Authorize
- status-transition-violation: Available -> Finishing (illegal transition)
- diagnostics-failure: DiagnosticsStatusNotification with DiagnosisFailed

Update scenarios registry to export all 10 scenarios. Update tests to
expect 10 scenarios and verify each triggers its expected failure code.

Add CLI --file flag support: 'ocpp-debugkit scenario run --file <path>'
loads and runs an external scenario JSON file through the analysis engine.

Closes #60
@vercel

vercel Bot commented Jul 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ocpp-debugkit-web Ready Ready Preview, Comment Jul 8, 2026 6:25pm

@sepehr-safari sepehr-safari merged commit f6c6192 into main Jul 8, 2026
4 checks passed
@sepehr-safari sepehr-safari deleted the feat/scenarios-v2 branch July 8, 2026 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(scenarios): expand to 10 total scenarios + CLI external scenario files

1 participant