Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
0aafb6ab
Commit
0aafb6ab
authored
Apr 10, 2017
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document GitLab QA
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
91fb9f44
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
3 deletions
+28
-3
doc/development/testing.md
doc/development/testing.md
+28
-3
No files found.
doc/development/testing.md
View file @
0aafb6ab
...
@@ -17,8 +17,9 @@ Formal definition: https://en.wikipedia.org/wiki/Unit_testing
...
@@ -17,8 +17,9 @@ Formal definition: https://en.wikipedia.org/wiki/Unit_testing
These kind of tests ensure that a single unit of code (a method) works as
These kind of tests ensure that a single unit of code (a method) works as
expected (given an input, it has a predictable output). These tests should be
expected (given an input, it has a predictable output). These tests should be
isolated as much as possible (for example, model methods that don't do anything
isolated as much as possible. For example, model methods that don't do anything
with the database shouldn't need a DB record).
with the database shouldn't need a DB record. Classes that don't need database
records should use stubs/doubles as much as possible.
| Code path | Tests path | Testing engine | Notes |
| Code path | Tests path | Testing engine | Notes |
| --------- | ---------- | -------------- | ----- |
| --------- | ---------- | -------------- | ----- |
...
@@ -94,6 +95,29 @@ possible).
...
@@ -94,6 +95,29 @@ possible).
[
Poltergeist
]:
https://github.com/teamcapybara/capybara#poltergeist
[
Poltergeist
]:
https://github.com/teamcapybara/capybara#poltergeist
[
RackTest
]:
https://github.com/teamcapybara/capybara#racktest
[
RackTest
]:
https://github.com/teamcapybara/capybara#racktest
### Black-box tests or End-to-end tests
GitLab consists of [multiple pieces] such as [GitLab Shell], [GitLab Workhorse],
[Gitaly], [GitLab Pages], [GitLab Runner], and GitLab Rails. All theses pieces
are configured and packaged by [GitLab Omnibus].
[GitLab QA] is a tool that allows to test that all these pieces integrate well
together by building a Docker image for a given version of GitLab Rails and
running feature tests (i.e. using Capybara) against it.
The actual test scenarios and steps are [part of GitLab Rails] so that they're
always in-sync with the codebase.
[
multiple pieces
]:
./architecture.md#components
[
GitLab Shell
]:
https://gitlab.com/gitlab-org/gitlab-shell
[
GitLab Workhorse
]:
https://gitlab.com/gitlab-org/gitlab-workhorse
[
Gitaly
]:
https://gitlab.com/gitlab-org/gitaly
[
GitLab Pages
]:
https://gitlab.com/gitlab-org/gitlab-pages
[
GitLab Runner
]:
https://gitlab.com/gitlab-org/gitlab-ci-multi-runner
[
GitLab Omnibus
]:
https://gitlab.com/gitlab-org/omnibus-gitlab
[
GitLab QA
]:
https://gitlab.com/gitlab-org/gitlab-qa
[
part of GitLab Rails
]:
https://gitlab.com/gitlab-org/gitlab-ce/tree/master/qa
#### Best practices
#### Best practices
-
Create only the necessary records in the database
-
Create only the necessary records in the database
...
@@ -133,7 +157,7 @@ trade-off:
...
@@ -133,7 +157,7 @@ trade-off:
-
Unit tests are usually cheap, and you should consider them like the basement
-
Unit tests are usually cheap, and you should consider them like the basement
of your house: you need them to be confident that your code is behaving
of your house: you need them to be confident that your code is behaving
correctly. However if you run only unit tests without integration / system tests, you might
miss
the [big] [picture]!
correctly. However if you run only unit tests without integration / system tests, you might
[miss]
the [big] [picture]!
-
Integration tests are a bit more expensive, but don't abuse them. A feature test
-
Integration tests are a bit more expensive, but don't abuse them. A feature test
is often better than an integration test that is stubbing a lot of internals.
is often better than an integration test that is stubbing a lot of internals.
-
System tests are expensive (compared to unit tests), even more if they require
-
System tests are expensive (compared to unit tests), even more if they require
...
@@ -150,6 +174,7 @@ test includes:
...
@@ -150,6 +174,7 @@ test includes:
-
The time it takes to fix the test if it breaks and the underlying code is OK
-
The time it takes to fix the test if it breaks and the underlying code is OK
-
Maybe, the time it takes to change the code to make the code testable.
-
Maybe, the time it takes to change the code to make the code testable.
[
miss
]:
https://twitter.com/ThePracticalDev/status/850748070698651649
[
big
]:
https://twitter.com/timbray/status/822470746773409794
[
big
]:
https://twitter.com/timbray/status/822470746773409794
[
picture
]:
https://twitter.com/withzombies/status/829716565834752000
[
picture
]:
https://twitter.com/withzombies/status/829716565834752000
[
tests-cost
]:
https://medium.com/table-xi/high-cost-tests-and-high-value-tests-a86e27a54df#.2ulyh3a4e
[
tests-cost
]:
https://medium.com/table-xi/high-cost-tests-and-high-value-tests-a86e27a54df#.2ulyh3a4e
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment