Skip to content

Data-driven runs: apic run --data rows.csv #53

Closed

Description

@dataGriff

Why

Newman's --iteration-data and Bruno's CSV runs feed one request many rows. Scenario Outlines already do this for apic test, but a quick "hit this endpoint with these 50 ids" from the CLI has no answer besides a shell loop.

What

  • apic run <targets> --data rows.csv|rows.json: one run per row; CSV header names (or JSON object keys) become variables at --var precedence for that iteration.
  • Output: text mode prints an iteration 3/50 heading per run; --json adds "iteration": {"index": 3, "total": 50, "row": {...}} to each object.
  • --keep-going semantics extend across iterations; the exit code is 1 if any iteration failed. Captures from one iteration do not leak to the next unless --data-share-session.
  • --data - reads stdin.

Where

internal/cli/run.go, internal/runner/runner.go (RunAll with per-iteration var overlays), internal/output/render.go.

Docs

docs/cli.md (run flags, JSON field), docs/cheatsheet.md, docs/cookbook.md ("Run one request for every row").

Tests

CSV and JSON inputs; variable precedence; isolation between iterations; exit codes; --json field.

Activity

  1. dataGriff commented on Sep 24, 2026

    @dataGriff
    OwnerAuthor

    Done in #115 (58fff0c). apic run <targets> --data rows.csv|rows.json|- runs once per row, with the row's values at --var precedence. Iterations are isolated on a session snapshot unless --data-share-session. Each --json object carries iteration, and --keep-going and exit codes cover the whole run. See docs/cli.md#data-driven-runs and the cookbook recipe.


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions