CI Mode

The ocpp-debugkit ci command runs all built-in scenarios (and optional external scenario files) and exits with code 0 if all pass, 1 if any fail. This is designed for integration into CI/CD pipelines.

Basic Usage

# Run all built-in scenarios
ocpp-debugkit ci

# Also run external scenarios from a directory
ocpp-debugkit ci ./scenarios

# JSON output for CI tooling
ocpp-debugkit ci --format json

GitHub Actions Integration

Add the following step to your workflow:

- name: Run OCPP scenario tests
  run: ocpp-debugkit ci --format json

The command exits 0 (pass) or 1 (fail). The JSON output can be parsed for dashboards or notifications.

External Scenario Files

Create JSON scenario files in a directory and pass the directory path to the ci command:

ocpp-debugkit ci ./scenarios

Scenario file format:

{
  "name": "my-scenario",
  "description": "Custom scenario for CI testing",
  "trace": { ... },
  "expectedFailures": ["FAILED_AUTHORIZATION"],
  "assertions": [
    { "type": "event_order", "params": { "actions": ["BootNotification", "Authorize"] } }
  ]
}

JSON Output Format

{
  "results": [
    {
      "name": "normal-session",
      "passed": true,
      "detectedFailures": [],
      "expectedFailures": [],
      "assertionResults": []
    },
    ...
  ],
  "allPassed": true
}

Example Workflow

See the examples/ci-example/ directory for a complete GitHub Actions workflow with scenario files.