2017-10-11 05:59:34 +00:00
# Testing standards and style guidelines
This document describes various guidelines and best practices for automated
testing of the GitLab project.
It is meant to be an _extension_ of the [thoughtbot testing
styleguide](https://github.com/thoughtbot/guides/tree/master/style/testing). If
this guide defines a rule that contradicts the thoughtbot guide, this guide
takes precedence. Some guidelines may be repeated verbatim to stress their
importance.
## Overview
2019-07-09 00:20:40 +00:00
GitLab is built on top of [Ruby on Rails ](https://rubyonrails.org/ ), and we're using [RSpec] for all
2017-10-11 05:59:34 +00:00
the backend tests, with [Capybara] for end-to-end integration testing.
2019-08-29 06:43:25 +00:00
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
2017-10-11 05:59:34 +00: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 12:06:07 +00:00
- [Five Factor Testing ](https://madeintandem.com/blog/five-factor-testing/ ): Why do we need tests?
2017-10-11 05:59:34 +00:00
- [Principles of Automated Testing ](http://www.lihaoyi.com/post/PrinciplesofAutomatedTesting.html ): Levels of testing. Prioritize tests. Cost of tests.
## [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 19:40:10 +00:00
Everything you should know about how to write good tests: Test Design, RSpec, FactoryBot,
2017-10-11 05:59:34 +00:00
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.
2018-09-06 19:28:23 +00:00
## [Review apps](review_apps.md)
How review apps are set up for GitLab CE/EE and how to use them.
2017-10-11 05:59:34 +00:00
## [Testing Rake tasks](testing_rake_tasks.md)
Everything you should know about how to test Rake tasks.
2019-05-22 01:34:12 +00:00
## [End-to-end tests](end_to_end/index.md)
2017-12-20 13:05:02 +00:00
2018-01-02 13:22:48 +00:00
Everything you should know about how to run end-to-end tests using
[GitLab QA][gitlab-qa] testing framework.
2017-12-20 13:05:02 +00:00
2017-10-11 05:59:34 +00:00
[Return to Development documentation ](../README.md )
[RSpec]: https://github.com/rspec/rspec-rails#feature-specs
[Capybara]: https://github.com/teamcapybara/capybara
2017-12-20 13:05:02 +00:00
[gitlab-qa]: https://gitlab.com/gitlab-org/gitlab-qa