RANCHER-2606 [SPIKE] Cypress Tests Pipeline Discovery for Mriya Team Parallel Execution Support

RANCHER-2606 [SPIKE] Cypress Tests Pipeline Discovery for Mriya Team Parallel Execution Support

RANCHER-2606 [SPIKE] Cypress Tests Pipeline Discovery for Mriya Team Parallel Execution Support

Introduction

This technical spike analyzes the current Cypress testing pipeline architecture within the FOLIO pipelines shared library and proposes strategic optimizations across three critical areas:

  • Test execution strategy

  • Parallel execution approach

  • Automated failure recovery

The analysis focuses on improving test efficiency, reducing execution time, and increasing overall test reliability while maintaining comprehensive coverage.

Overview Diagram

Architecture Justification: This redesigned strategy follows E2E best practices by implementing Tiered Test Execution (progressive test scope), Feedback Optimization (faster critical path feedback), and Resource Management (distributed load across time periods).

This approach ensures faster feedback loops while maintaining comprehensive coverage.


Topic 1: Cypress Run Strategy Optimization

Current Test Execution Analysis

Existing Implementation:

  • Quality Gates: Every 3 hours, smoke tests only (~300 test cases, ~1h40m, 99% success rate)

  • Nightly Tests: Monday-Friday, smoke+criticalPath+extendedPath (~3300 test cases, ~12h, 90-93% success rate)

Identified Challenges:

  • Scalability Risk: Continuous test growth threatens 20+ hour execution times

  • Resource Contention: High parallel load degrades environment performance

  • Feedback Delay: Extended execution times slow development feedback loops

Proposed Three-Tier Strategy

Implementation Strategy:

  1. Quality Gates: Maintain current smoke test execution every 3 hours

  2. Nightly Execution: Reduce scope to smoke,criticalPath only, targeting 6-8 hour execution

  3. Weekly Execution: Full suite smoke,criticalPath,extendedPath on weekends

Benefits Analysis:

  • Granular Feedback: More frequent, targeted test results

  • Clear Timelines: Predictable execution windows for different test scopes

  • Growth Accommodation: Space for test suite expansion without timeline explosion

  • Resource Optimization: Distributed load prevents environment overloading

E2E Best Practice Justification: This approach implements Risk-Based Testing by prioritizing critical functionality for frequent execution and Load Distribution to prevent infrastructure bottlenecks while maintaining comprehensive coverage through scheduled extended runs.

Recommendations for AQA Team:

  • Clearly categorize tests to maintain lean criticalPath suite

  • Implement strict criteria for critical path test inclusion

  • Regular review and pruning of test categories to prevent scope creep

  • Ensure that smoke tests are distributed evenly across all application functionality to ensure potential issues are identified early.


Topic 2: Cypress-Cloud Alternative Implementation

Driver Analysis

Business Context: Cypress-cloud pricing model changes prevent utilization of new versions and advanced framework features, necessitating a custom parallel execution approach.

Current Architecture

Current Orchestration Layer Responsibilities:

  • Resource Orchestration: Pod template and container lifecycle management

  • Parallel Execution: Multiple test worker creation and management

  • Test Distribution: Archive-based test suite distribution via Jenkins stash

  • Result Aggregation: Test result collection and merging from all workers

  • Reporting Integration: Report Portal and Allure report coordination

Proposed Enhanced Architecture

Enhanced Workflow Implementation:

  1. Test Grouping Phase: Execute AQA-managed JavaScript script with test type and thread count parameters

  2. Configuration Generation: Script outputs JSON file containing optimized test tag batches

  3. Parallel Execution: Parse JSON configuration and execute test tags across workers without cypress-cloud

  4. Result Collection: Individual Allure report collection from each execution thread

  5. Report Unification: Merge and publish comprehensive Allure report

Technical Benefits:

  • Framework Independence: Complete Cypress framework feature access without vendor limitations

  • Enhanced Control: Granular test grouping and parallel execution management

  • Conflict Avoidance: Intelligent test distribution prevents execution conflicts

E2E Best Practice Justification: This approach follows Tool Independence principles, ensuring long-term maintainability while implementing Custom Parallelization strategies optimized for FOLIO's specific testing requirements and infrastructure capabilities.

Implementation Considerations

Modified Orchestration Layer (folioCypressFlow.groovy):

  • Integration of test grouping script execution

  • JSON configuration parsing and batch management

  • Enhanced worker coordination without cypress-cloud dependencies

  • Improved error handling for custom parallel execution

Modified Execution Layer (folioCypress.groovy):

  • Tag-based test execution without cloud orchestration

  • Individual Allure report generation per worker

  • Enhanced artifact management for distributed execution

  • Improved browser and environment management