Description
Current Behavior
Testing multiple APIs requires executing microcks test separately for each API, sequentially. With 10+ APIs in CI/CD pipelines, this becomes a significant bottleneck and wastes compute time.
Why we need this?
- Sequential testing is slow and does not scale with microservice architectures
- CI pipelines with many APIs take 5-10x longer than necessary
- No built-in way to batch or parallelize contract tests
How will this help?
--batch + --parallel cuts CI pipeline time by 60-80%
- Worker pool pattern scales with number of APIs
- Aggregated results show pass/fail summary at a glance
- Reduces developer feedback loop from minutes to seconds
Proposed Solution
- Create
pkg/batch/batch.go for parsing batch test definitions
- Support two input modes:
--batch=tests.json — JSON file with test definitions
--test='API1:1.0:http://api1:8080:OPEN_API_SCHEMA:30sec' — repeatable flag
- Implement Go worker pool with
sync.WaitGroup for parallel execution
- Add
--parallel flag to control concurrency (default: 1, max: 10)
- Aggregate and report results with exit code 0 only if ALL pass
Example usage:
$ microcks test --batch=tests.json --parallel=4
Running 3 tests in parallel (max 4 workers)...
✓ API1:1.0 - PASSED (12s)
✓ API2:2.0 - PASSED (15s)
✗ API3:1.5 - FAILED (8s)
Summary: 2 passed, 1 failed
Total time: 15s (vs 45s sequential)
Description
Current Behavior
Testing multiple APIs requires executing
microcks testseparately for each API, sequentially. With 10+ APIs in CI/CD pipelines, this becomes a significant bottleneck and wastes compute time.Why we need this?
How will this help?
--batch+--parallelcuts CI pipeline time by 60-80%Proposed Solution
pkg/batch/batch.gofor parsing batch test definitions--batch=tests.json— JSON file with test definitions--test='API1:1.0:http://api1:8080:OPEN_API_SCHEMA:30sec'— repeatable flagsync.WaitGroupfor parallel execution--parallelflag to control concurrency (default: 1, max: 10)Example usage: