Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Principle:1mcp app Agent CI Test Validation Pipeline

From Leeroopedia
Knowledge Sources
Domains CI_CD, Testing
Last Updated 2026-10-29 00:00 GMT

Overview

Pattern that runs a comprehensive test and validation matrix—static analysis, unit tests, protocol conformance, E2E sharding, browser tests, cross-platform upgrade, and release-gate aggregation—through parallel CI jobs with a fail-closed aggregation gate.

Description

CI Test Validation Pipeline is the practice of decomposing a project's quality checks into independent CI jobs that run concurrently, then aggregating their results through a gate job that fails closed if any required job is skipped or cancelled. It addresses the problem of slow, sequential CI by parallelizing independent test lanes (static, unit, E2E shards, browser, protocol, cross-platform) while maintaining a single required status check. The pipeline supports two modes: standard mode (triggered by push/PR) runs the core test matrix, and release-gate mode (triggered as a reusable workflow) adds release-lifecycle tests and produces an aggregated `release-gates` artifact. E2E tests are sharded by duration to balance execution time across workers, and resource-contended tests (schema startup, packaging, token CLI) are deferred to avoid competing for the same runner. Protocol conformance requires both TypeScript and Python peer fixtures, installed with frozen lockfiles for reproducibility.

Usage

Use this principle when designing a CI pipeline that needs to:

  • Run multiple independent test lanes in parallel without losing required-check semantics
  • Shard E2E tests by measured duration for balanced execution
  • Support both standard and release-gate modes from a single workflow
  • Separate browser tests from ordinary shards to isolate Playwright dependencies
  • Validate cross-platform (Ubuntu/macOS/Windows) scenarios

Theoretical Basis

The core mechanism is parallel lanes with fail-closed fan-in:

# Abstract topology (NOT real implementation)
[static, unit-admin, test-protocol] → ci-gate  # required, fail-closed
[test-e2e-parallel: shard 1..4]              # parallel E2E
[test-e2e-system]                            # exclusive lifecycle
[test-e2e-browser]                           # Playwright isolation
[test-legacy-upgrade: ubuntu, macos]         # OS matrix
[test-windows-installer]                     # Windows-only

# Release-gate mode adds:
[release-lifecycle] → release-result  # aggregated gates artifact

Fail-closed gate rejects skipped/cancelled jobs:

# Abstract gate logic (NOT real implementation)
test "$STATIC_RESULT" = success \
  && test "$TEST_RESULT" = success \
  && test "$PROTOCOL_RESULT" = success

Duration-based sharding balances E2E load:

# Shards assigned by measured duration so no worker is a straggler
shard = hash(testName) % SHARD_COUNT  # balanced by e2e-durations.json

Practical Guide

  1. Run static analysis, unit tests, and protocol tests as separate jobs that feed a fail-closed gate
  2. Shard E2E tests by measured duration, not by count, to avoid stragglers
  3. Keep browser tests in a separate job so ordinary shards don't install Playwright dependencies
  4. Defer resource-contended tests (schema startup, packaging scans) to idle workers after shards exit
  5. Use `paths-ignore` for docs/markdown to avoid triggering CI on documentation-only changes
  6. In release-gate mode, aggregate all check results into an artifact for the release pipeline to verify

Related Pages

Implemented By

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment