debian-mirror-gitlab/doc/development/testing_guide/index.md

83 lines
3.1 KiB
Markdown
Raw Normal View History

2021-01-29 00:20:46 +05:30
---
stage: none
group: unassigned
2022-11-25 23:54:43 +05:30
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
2021-01-29 00:20:46 +05:30
---
2018-03-17 18:26:18 +05:30
# Testing standards and style guidelines
This document describes various guidelines and best practices for automated
testing of the GitLab project.
2022-10-11 01:57:18 +05:30
It is meant to be an _extension_ of the
2022-08-27 11:52:29 +05:30
[Thoughtbot testing style guide](https://github.com/thoughtbot/guides/tree/master/testing-rspec). If
2021-03-11 19:13:27 +05:30
this guide defines a rule that contradicts the Thoughtbot guide, this guide
2018-03-17 18:26:18 +05:30
takes precedence. Some guidelines may be repeated verbatim to stress their
importance.
## Overview
2020-05-24 23:13:21 +05:30
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-11-11 11:23:49 +05:30
On the frontend side, we're using [Jest](https://jestjs.io/) for JavaScript unit and
2018-03-17 18:26:18 +05:30
integration testing.
Following are two great articles that everyone should read to understand what
automated testing means, and what are its principles:
2019-12-21 20:55:43 +05:30
- [Five Factor Testing](https://madeintandem.com/blog/five-factor-testing/): Why do we need tests?
2020-06-23 00:09:42 +05:30
- [Principles of Automated Testing](https://www.lihaoyi.com/post/PrinciplesofAutomatedTesting.html): Levels of testing. Prioritize tests. Cost of tests.
2018-03-17 18:26:18 +05:30
## [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-07-07 11:18:12 +05:30
Everything you should know about how to write good tests: Test Design, RSpec, FactoryBot,
2018-03-17 18:26:18 +05:30
system tests, parameterized tests etc.
## [Frontend testing standards and style guidelines](frontend_testing.md)
2021-11-11 11:23:49 +05:30
Everything you should know about how to write good Frontend tests: Jest,
2018-03-17 18:26:18 +05:30
testing promises, stubbing etc.
2023-01-13 00:05:48 +05:30
## [Getting started with Feature tests](frontend_testing.md#get-started-with-feature-tests)
Need to get started with feature tests? Here are some general guidelines,
tips and tricks to get the most out of white-box testing.
2018-03-17 18:26:18 +05:30
## [Flaky tests](flaky_tests.md)
What are flaky tests, the different kind of flaky tests we encountered, and what
we do about them.
2023-01-13 00:05:48 +05:30
## [GitLab pipelines](../pipelines/index.md)
2018-03-17 18:26:18 +05:30
How GitLab test suite is run in the CI context: setup, caches, artifacts,
parallelization, monitoring.
2018-12-05 23:21:45 +05:30
## [Review apps](review_apps.md)
How review apps are set up for GitLab CE/EE and how to use them.
2018-03-17 18:26:18 +05:30
## [Testing Rake tasks](testing_rake_tasks.md)
Everything you should know about how to test Rake tasks.
2019-09-04 21:01:54 +05:30
## [End-to-end tests](end_to_end/index.md)
2018-03-17 18:26:18 +05:30
Everything you should know about how to run end-to-end tests using
2020-06-23 00:09:42 +05:30
[GitLab QA](https://gitlab.com/gitlab-org/gitlab-qa) testing framework.
2018-03-17 18:26:18 +05:30
2019-12-21 20:55:43 +05:30
## [Migrations tests](testing_migrations_guide.md)
Everything you should know about how to test migrations.
2022-07-23 23:45:48 +05:30
## [Contract tests](contract/index.md)
Introduction to contract testing, how to run the tests, and how to write them.
2021-09-30 23:02:18 +05:30
[Return to Development documentation](../index.md)