2020-10-30 14:08:56 -04:00
---
stage: none
group: unassigned
2020-11-26 01:09:20 -05:00
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
2020-10-30 14:08:56 -04:00
---
2017-10-11 01:59:34 -04:00
# Testing standards and style guidelines
This document describes various guidelines and best practices for automated
testing of the GitLab project.
2021-02-04 16:09:06 -05:00
It is meant to be an _extension_ of the [Thoughtbot testing
2020-08-24 11:10:11 -04:00
style guide](https://github.com/thoughtbot/guides/tree/master/testing-rspec). If
2021-02-04 16:09:06 -05:00
this guide defines a rule that contradicts the Thoughtbot guide, this guide
2017-10-11 01:59:34 -04:00
takes precedence. Some guidelines may be repeated verbatim to stress their
importance.
## Overview
2020-04-21 11:21:10 -04:00
GitLab is built on top of [Ruby on Rails ](https://rubyonrails.org/ ), and we're using [RSpec ](https://github.com/rspec/rspec-rails#feature-specs ) for all
the backend tests, with [Capybara ](https://github.com/teamcapybara/capybara ) for end-to-end integration testing.
2021-09-03 11:10:48 -04:00
On the frontend side, we're using [Jest ](https://jestjs.io/ ) for JavaScript unit and
2017-10-11 01:59:34 -04:00
integration testing.
Following are two great articles that everyone should read to understand what
automated testing means, and what are its principles:
2019-09-27 08:06:07 -04:00
- [Five Factor Testing ](https://madeintandem.com/blog/five-factor-testing/ ): Why do we need tests?
2020-06-04 17:08:11 -04:00
- [Principles of Automated Testing ](https://www.lihaoyi.com/post/PrinciplesofAutomatedTesting.html ): Levels of testing. Prioritize tests. Cost of tests.
2017-10-11 01:59:34 -04:00
## [Testing levels](testing_levels.md)
Learn about the different testing levels, and how to decide at what level your
changes should be tested.
## [Testing best practices](best_practices.md)
2019-03-26 15:40:10 -04:00
Everything you should know about how to write good tests: Test Design, RSpec, FactoryBot,
2017-10-11 01:59:34 -04:00
system tests, parameterized tests etc.
## [Frontend testing standards and style guidelines](frontend_testing.md)
2021-09-03 11:10:48 -04:00
Everything you should know about how to write good Frontend tests: Jest,
2017-10-11 01:59:34 -04:00
testing promises, stubbing etc.
## [Flaky tests](flaky_tests.md)
What are flaky tests, the different kind of flaky tests we encountered, and what
we do about them.
2021-10-13 08:12:20 -04:00
## [GitLab pipelines](../pipelines.md)
2017-10-11 01:59:34 -04:00
How GitLab test suite is run in the CI context: setup, caches, artifacts,
parallelization, monitoring.
2018-09-06 15:28:23 -04:00
## [Review apps](review_apps.md)
How review apps are set up for GitLab CE/EE and how to use them.
2017-10-11 01:59:34 -04:00
## [Testing Rake tasks](testing_rake_tasks.md)
Everything you should know about how to test Rake tasks.
2019-05-21 21:34:12 -04:00
## [End-to-end tests](end_to_end/index.md)
2017-12-20 08:05:02 -05:00
2018-01-02 08:22:48 -05:00
Everything you should know about how to run end-to-end tests using
2020-06-03 17:08:23 -04:00
[GitLab QA ](https://gitlab.com/gitlab-org/gitlab-qa ) testing framework.
2017-12-20 08:05:02 -05:00
2019-10-04 08:06:14 -04:00
## [Migrations tests](testing_migrations_guide.md)
Everything you should know about how to test migrations.
2021-06-28 08:38:12 -04:00
[Return to Development documentation ](../index.md )