Modern CI pipelines often execute full regression suites even when code changes are small and localized.
This causes:
- unnecessary compute cost
- slower feedback loops
- inefficient CI resource usage
- delayed developer productivity
especially in microservice architectures with multiple repositories.
Transform Git changes into targeted test execution plans using deterministic impact mapping.
Instead of running full regression suites, the system dynamically executes only impacted Karate tests while maintaining baseline safety coverage through fallback smoke tests.
| Execution Mode | Runtime |
|---|---|
| Full Regression | 52s |
| Impact-Based Execution | 18s |
| Reduction Observed | 66% |
- π Cross-repository CI orchestration using GitHub Repository Dispatch
- π JGit-based file-level Git diff analysis
- π§ Rule-based impact mapping (code β test tags)
- π§ͺ Dynamic Karate test selection at runtime
- π‘οΈ Safe fallback execution using
@smoke - π CI execution metrics generation
Dev Repository (fintech-impact-services)
β
β Push Event
βΌ
GitHub Repository Dispatch
βΌ
Automation Repository (karate-change-impact-test)
β
βββ Start Spring Boot App in CI
βββ Wait for API readiness (log + HTTP check)
βββ Call Impact API (/test-selector)
βββ JGit-based Impact Analysis
βββ Generate Test Tags
βββ Run Karate Tests (tag-based)
βββ Generate Execution Metrics
Trigger:
yaml
on: [push]
Dispatch event:
bash
POST /repos/{owner}/karate-change-impact-test/dispatches
{
"event_type": "dev_push"
}
Steps executed in GitHub Actions:
- Checkout both repositories
- Start Spring Boot application
- Wait for API readiness (log + HTTP check)
HTTP GET /api/dev-ops/test-selector?targetBranch=main~1
- Uses JGit diff analysis
- Maps changed files β test tags
| Change Type | Test Tag |
|---|---|
| /payments/ | @payments |
| /transactions/ | @transactions |
| /transfer/ | @transfers |
| /auth/ | @regression |
| pom.xml | @regression |
| No match | @smoke |
mvn test -Dkarate.options="--tags @payments,@transactions"Safe Fallback
If no impacted tests are detected:
bash
@smoke
metrics.json
json
{
"impacted_tags": "@payments,@transactions",
"scenarios_executed": 6,
"scenarios_skipped": 12,
"test_reduction_rate": "66%",
"timing_metrics": {
"total_workflow_seconds": 52,
"isolated_test_seconds": 18,
"api_overhead_seconds": 6
}
}
features/
βββ payments.feature
βββ transactions.feature
βββ transfers.feature
βββ smoke.feature
Prerequisites Java 17 Maven GitHub Actions enabled
KARATE_REPO_PAT
Start Spring Boot service:
bash
mvn spring-boot:run
Call API:
bash
curl http://localhost:8080/api/dev-ops/test-selector
Run tests:
bash
mvn test -Dkarate.options="--tags @smoke"
- β± Demonstrated up to 60β70% CI runtime reduction in controlled scenarios
- π° Reduced unnecessary regression execution and CI compute usage
- π Faster developer feedback cycles through selective test execution
- π Minimized redundant test runs using deterministic impact mapping
- π§ͺ Maintained baseline regression safety using fallback smoke coverage
- π Enabled cross-repository CI orchestration using GitHub Actions
In large-scale systems with multiple services and repositories, CI pipelines become a major bottleneck. Running full regression suites for every change leads to:
- High infrastructure cost
- Slow developer feedback cycles
- Inefficient resource utilization
This system demonstrates a practical approach to impact-aware CI execution without requiring complex dependency graphs or external SaaS tooling.
Designed and implemented a cross-repository DevOps intelligence framework that enables impact-based test selection, reducing full regression execution by dynamically running only affected Karate tests based on Git diff analysis.