doc/development/cicd/testing.md
This document contains details for testing CI/CD application code.
The CI/CD specs include informal integration specs for the core CI/CD processes.
Integration specs for linting are kept in spec/lib/gitlab/ci/yaml_processor_spec.rb and
spec/lib/gitlab/ci/yaml_processor/test_cases/. Add any new specs to the
test_cases/ directory.
Integration specs for pipeline creation are kept in spec/services/ci/create_pipeline_service_spec.rb and
spec/services/ci/create_pipeline_service/. Add new specs to the
create_pipeline_service/ directory.
spec/services/ci/pipeline_processing/atomic_processing_service_spec.rb runs integration specs for pipeline processing.
To add a new integration spec, add a YAML CI/CD configuration file to spec/services/ci/pipeline_processing/test_cases.
It is run automatically with atomic_processing_service_spec.rb.
The following files contain frontend fixtures for CI/CD endpoints used in frontend unit tests:
spec/frontend/fixtures/pipelines.rb - General pipeline fixturesspec/frontend/fixtures/pipeline_create.rb - Pipeline creation fixturesspec/frontend/fixtures/pipeline_details.rb - Pipeline details fixturesspec/frontend/fixtures/pipeline_header.rb - Pipeline header fixturesspec/frontend/fixtures/pipeline_schedules.rb - Pipeline schedule fixturesThese fixtures provide mock API responses for consistent testing of CI/CD frontend components.
Frontend unit tests for CI/CD components are located in spec/frontend/ci. These tests verify proper rendering, interactions, and state management for pipeline visualization, job execution, scheduling, and status reporting components.