Testing guide for CI/CD Rails application code
This document contains details for testing CI/CD application code.
Backend
Integration specs
The CI/CD specs include informal integration specs for the core CI/CD processes.
Linting
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.
Pipeline creation
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.
Pipeline processing
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
.
Frontend
Fixtures
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 fixtures
These fixtures provide mock API responses for consistent testing of CI/CD frontend components.
Unit tests
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.
Docs
Edit this page to fix an error or add an improvement in a merge request.
Create an issue to suggest an improvement to this page.
Product
Create an issue if there's something you don't like about this feature.
Propose functionality by submitting a feature request.
Feature availability and product trials
View pricing to see all GitLab tiers and features, or to upgrade.
Try GitLab for free with access to all features for 30 days.
Get help
If you didn't find what you were looking for, search the docs.
If you want help with something specific and could use community support, post on the GitLab forum.
For problems setting up or using this feature (depending on your GitLab subscription).
Request support