index.md 2.82 KB
Newer Older
Amy Qualls's avatar
Amy Qualls committed
1 2 3
---
stage: none
group: unassigned
4
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
Amy Qualls's avatar
Amy Qualls committed
5 6
---

7 8 9 10 11
# Testing standards and style guidelines

This document describes various guidelines and best practices for automated
testing of the GitLab project.

Amy Qualls's avatar
Amy Qualls committed
12
It is meant to be an _extension_ of the [Thoughtbot testing
13
style guide](https://github.com/thoughtbot/guides/tree/master/testing-rspec). If
Amy Qualls's avatar
Amy Qualls committed
14
this guide defines a rule that contradicts the Thoughtbot guide, this guide
15 16 17 18 19
takes precedence. Some guidelines may be repeated verbatim to stress their
importance.

## Overview

20 21
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.
Mark Florian's avatar
Mark Florian committed
22
On the frontend side, we're using [Jest](https://jestjs.io/) and [Karma](http://karma-runner.github.io/)/[Jasmine](https://jasmine.github.io/) for JavaScript unit and
23 24 25 26 27
integration testing.

Following are two great articles that everyone should read to understand what
automated testing means, and what are its principles:

28
- [Five Factor Testing](https://madeintandem.com/blog/five-factor-testing/): Why do we need tests?
29
- [Principles of Automated Testing](https://www.lihaoyi.com/post/PrinciplesofAutomatedTesting.html): Levels of testing. Prioritize tests. Cost of tests.
30 31 32 33 34 35 36 37

## [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)

38
Everything you should know about how to write good tests: Test Design, RSpec, FactoryBot,
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
system tests, parameterized tests etc.

## [Frontend testing standards and style guidelines](frontend_testing.md)

Everything you should know about how to write good Frontend tests: Karma,
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.

## [GitLab tests in the Continuous Integration (CI) context](ci.md)

How GitLab test suite is run in the CI context: setup, caches, artifacts,
parallelization, monitoring.

56 57 58 59
## [Review apps](review_apps.md)

How review apps are set up for GitLab CE/EE and how to use them.

60 61 62 63
## [Testing Rake tasks](testing_rake_tasks.md)

Everything you should know about how to test Rake tasks.

64
## [End-to-end tests](end_to_end/index.md)
65

66
Everything you should know about how to run end-to-end tests using
Amy Qualls's avatar
Amy Qualls committed
67
[GitLab QA](https://gitlab.com/gitlab-org/gitlab-qa) testing framework.
68

69 70 71 72
## [Migrations tests](testing_migrations_guide.md)

Everything you should know about how to test migrations.

73
[Return to Development documentation](../index.md)