gitlab-qa 0.6.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitlab-ci.yml +6 -0
- data/README.md +45 -122
- data/docs/README.md +3 -0
- data/docs/architecture.md +4 -0
- data/docs/how_it_works.md +37 -0
- data/docs/{macos.md → run_geo_qa_against_gdk.md} +8 -6
- data/docs/trainings.md +8 -0
- data/docs/what_tests_can_be_run.md +266 -0
- data/lib/gitlab/qa/component/specs.rb +1 -1
- data/lib/gitlab/qa/release.rb +2 -2
- data/lib/gitlab/qa/scenario/test/instance/any.rb +3 -7
- data/lib/gitlab/qa/scenario/test/integration/geo.rb +2 -0
- data/lib/gitlab/qa/scenario/test/omnibus/update.rb +6 -3
- data/lib/gitlab/qa/version.rb +1 -1
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 2417c38c75bb22753661942c5431959e224d9439
|
4
|
+
data.tar.gz: de43e7bbe95039d2118d66cbbdb4b1b222efe4cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 561abef16e8297daf5ae70ad37e1f6e05be302815cf0c60088b8bb486af1079d57e96f20e3cbc9d833094479e841fd59ea669da2960a25aacc67bcf2b84d6d4d
|
7
|
+
data.tar.gz: 9a8ebd4089627554cb9f45ac5586c3210441b1a428ac68fbe286742e93b3cd02ba2cd4d2e1293e12d2cefc8d2970d31c64bd0668c69948a0ded5d49816825644
|
data/.gitlab-ci.yml
CHANGED
@@ -118,6 +118,12 @@ ee:update:
|
|
118
118
|
<<: *test
|
119
119
|
<<: *high-capacity
|
120
120
|
|
121
|
+
ee-previous-to-ce-next:update:
|
122
|
+
script:
|
123
|
+
- bin/qa Test::Omnibus::Update EE CE
|
124
|
+
<<: *test
|
125
|
+
<<: *high-capacity
|
126
|
+
|
121
127
|
ce:upgrade:
|
122
128
|
script:
|
123
129
|
- if [[ $RELEASE ]]; then exit 0; fi
|
data/README.md
CHANGED
@@ -1,36 +1,51 @@
|
|
1
1
|
[![Gem Version](https://badge.fury.io/rb/gitlab-qa.svg)](https://rubygems.org/gems/gitlab-qa)
|
2
2
|
[![build status](https://gitlab.com/gitlab-org/gitlab-qa/badges/master/build.svg)](https://gitlab.com/gitlab-org/gitlab-qa/pipelines)
|
3
3
|
|
4
|
-
# GitLab
|
4
|
+
# GitLab QA orchestrator
|
5
|
+
|
6
|
+
## Definitions
|
7
|
+
|
8
|
+
- **GitLab QA framework**: A framework that allows developer to write end-to-end
|
9
|
+
tests simply and efficiently.
|
10
|
+
Located at [`gitlab-org/gitlab-ce@qa/qa/`][qa-framework].
|
11
|
+
- **GitLab QA instance-level scenarios**: RSpec scenarios that are using
|
12
|
+
GitLab QA framework and Capybara to setup and perform individual end-to-end
|
13
|
+
tests against a live GitLab instance.
|
14
|
+
Located at [`gitlab-org/gitlab-ce@qa/qa/specs/features/`][instance-level-scenarios].
|
15
|
+
- **GitLab QA orchestrator** (this project): An orchestration tool that allows to run various
|
16
|
+
QA test suites in a simple manner.
|
17
|
+
- **GitLab QA orchestrated scenarios**: Scenarios where containers are started,
|
18
|
+
configured and that run instance-level scenarios against a live GitLab
|
19
|
+
instance.
|
20
|
+
Located at [`gitlab-org/gitlab-qa@lib/gitlab/qa/scenario/test/`][orchestrated-scenarios].
|
21
|
+
|
22
|
+
[qa-framework]: https://gitlab.com/gitlab-org/gitlab-ce/blob/master/qa/qa/
|
23
|
+
[instance-level-scenarios]: https://gitlab.com/gitlab-org/gitlab-ce/blob/master/qa/qa/specs/features/
|
24
|
+
[orchestrated-scenarios]: https://gitlab.com/gitlab-org/gitlab-qa/blob/master/lib/gitlab/qa/scenario/test/
|
5
25
|
|
6
|
-
|
26
|
+
## Goals and objectives
|
7
27
|
|
8
28
|
GitLab consists of multiple pieces configured and packaged by
|
9
29
|
[GitLab Omnibus](https://gitlab.com/gitlab-org/omnibus-gitlab).
|
10
30
|
|
11
|
-
The purpose of
|
12
|
-
|
13
|
-
## Architecture
|
14
|
-
|
15
|
-
See the [GitLab QA architecture](/docs/architecture.md).
|
16
|
-
|
17
|
-
## Goals and objectives
|
31
|
+
The purpose of the QA end-to-end test suite is to verify that all pieces
|
32
|
+
integrate well together.
|
18
33
|
|
19
34
|
### GitLab QA tests running in the CI/CD environment
|
20
35
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
36
|
+
Manual steps should not be needed to run the QA test suite.
|
37
|
+
GitLab QA orchestrator is CI/CD environment native, which means that we should
|
38
|
+
add new features and tests when we are comfortable with running new code in the
|
39
|
+
CI/CD environment.
|
25
40
|
|
26
41
|
### GitLab QA test failure are reproducible locally
|
27
42
|
|
28
|
-
Despite the fact that GitLab QA has been built to run in the CI/CD
|
29
|
-
it is really important to make it easy for developers to reproduce
|
43
|
+
Despite the fact that GitLab QA orchestrator has been built to run in the CI/CD
|
44
|
+
environment, it is really important to make it easy for developers to reproduce
|
30
45
|
test failures locally. It is much easier to debug things locally, than in the
|
31
46
|
CI/CD.
|
32
47
|
|
33
|
-
To make it easier to reproduce test failures locally we have published
|
48
|
+
To make it easier to reproduce test failures locally we have published the
|
34
49
|
`gitlab-qa` gem [on rubygems.org](https://rubygems.org/gems/gitlab-qa) and we
|
35
50
|
are using exactly the same approach to run tests in the CI/CD environment.
|
36
51
|
|
@@ -38,7 +53,7 @@ It means that using `gitlab-qa` CLI tool, that orchestrates test environment and
|
|
38
53
|
runs GitLab QA test suite, is a reproducible way of running tests locally and
|
39
54
|
in the CI/CD.
|
40
55
|
|
41
|
-
It also means that we
|
56
|
+
It also means that we cannot have a custom code in `.gitlab-ci.yml` to, for
|
42
57
|
example, start new containers / services.
|
43
58
|
|
44
59
|
### Test installation / deployment process too
|
@@ -47,7 +62,7 @@ We distribute GitLab in a package (like Debian package or a Docker image) so
|
|
47
62
|
we want to test installation process to ensure that our package is not broken.
|
48
63
|
|
49
64
|
But we are also working on making GitLab be a cloud native product. This means
|
50
|
-
that using Helm becomes
|
65
|
+
that using Helm becomes yet another installation / deployment process that we
|
51
66
|
want to test with GitLab QA.
|
52
67
|
|
53
68
|
Keeping in mind that we want to test our Kubernetes deployments is especially
|
@@ -55,8 +70,8 @@ important with consideration of the need of testing changes in merge requests.
|
|
55
70
|
|
56
71
|
### Testing changes in merge requests before the merge
|
57
72
|
|
58
|
-
The ultimate goal
|
59
|
-
merge
|
73
|
+
The ultimate goal is to make it possible to run the QA test suite for any
|
74
|
+
merge request, even before merging code into the `master` branch.
|
60
75
|
|
61
76
|
### We can run tests against any instance of GitLab
|
62
77
|
|
@@ -64,12 +79,16 @@ GitLab QA is a click-driven, black-box testing tool. We also use it to run
|
|
64
79
|
tests against the staging, and we strive for making it useful for our users
|
65
80
|
as well.
|
66
81
|
|
82
|
+
## Documentation
|
83
|
+
|
84
|
+
All the documentation can be found under [`docs/`](/docs/README.md).
|
85
|
+
|
67
86
|
## How do we use it
|
68
87
|
|
69
88
|
Currently we trigger test suite against GitLab Docker images created by Omnibus
|
70
89
|
nightly.
|
71
90
|
|
72
|
-
We also trigger GitLab QA pipelines whenever someone clicks `package-qa` manual
|
91
|
+
We also trigger GitLab QA pipelines whenever someone clicks `package-and-qa` manual
|
73
92
|
action in a merge request.
|
74
93
|
|
75
94
|
## How can you use it
|
@@ -80,115 +99,19 @@ You can install it with `gem install gitlab-qa`. It will expose a `gitlab-qa`
|
|
80
99
|
command in your system.
|
81
100
|
|
82
101
|
If you want to run the scenarios or develop them on Mac OS, please read
|
83
|
-
[Mac OS specific documentation](/docs/
|
102
|
+
[Mac OS specific documentation](/docs/run_geo_qa_against_gdk.md) as there are caveats and things
|
84
103
|
that may work differently.
|
85
104
|
|
86
|
-
|
87
|
-
|
88
|
-
`gitlab-qa Test::Instance::Image CE|EE|<full image address>`
|
89
|
-
|
90
|
-
1. Run tests against a Docker image with GitLab and Mattermost:
|
91
|
-
|
92
|
-
`gitlab-qa Test::Integration::Mattermost CE|EE|<full image address>`
|
93
|
-
|
94
|
-
1. Run tests agains a Docker image with GitLab Geo:
|
95
|
-
|
96
|
-
`export EE_LICENSE=$(cat /path/to/Geo.gitlab_license)`
|
97
|
-
|
98
|
-
`gitlab-qa Test::Integration::Geo EE`
|
99
|
-
|
100
|
-
1. Test update process between two CE or EE subsequent versions:
|
101
|
-
|
102
|
-
`gitlab-qa Test::Omnibus::Update CE|EE|<full image address>`
|
103
|
-
|
104
|
-
1. Test upgrade process from CE to EE:
|
105
|
-
|
106
|
-
`gitlab-qa Test::Omnibus::Upgrade CE|<full CE image address>`
|
107
|
-
|
108
|
-
1. Run tests against any existing instance:
|
109
|
-
|
110
|
-
`gitlab-qa Test::Instance::Any CE|EE nightly|latest http://your.instance.gitlab`
|
111
|
-
|
112
|
-
For instance, to run it against https://staging.gitlab.com:
|
113
|
-
|
114
|
-
`GITLAB_USERNAME=your_username GITLAB_PASSWORD=your_password gitlab-qa Test::Instance::Any EE latest https://staging.gitlab.com`
|
105
|
+
All the scenarios you can run are described in the
|
106
|
+
[What tests can be run?](/docs/what_tests_can_be_run.md) documentation.
|
115
107
|
|
116
108
|
### How to add new scenarios
|
117
109
|
|
118
110
|
Scenarios (test cases) and scripts to run them are located in
|
119
111
|
[CE](https://gitlab.com/gitlab-org/gitlab-ce/tree/master/qa) and
|
120
112
|
[EE](https://gitlab.com/gitlab-org/gitlab-ee/tree/master/qa)
|
121
|
-
repositories under qa
|
122
|
-
|
123
|
-
## How does it work?
|
124
|
-
|
125
|
-
GitLab QA handles a few scenarios:
|
126
|
-
|
127
|
-
### `Test::Omnibus::Image CE|EE|<full image address>`
|
128
|
-
|
129
|
-
This scenario only tests that a GitLab Docker container can be run.
|
130
|
-
|
131
|
-
This spins up a GitLab Docker container based on the given edition or image:
|
132
|
-
- `gitlab/gitlab-ce:nightly` for `CE`
|
133
|
-
- `gitlab/gitlab-ee:nightly` for `EE`
|
134
|
-
- the given custom image for `<full image address>`
|
135
|
-
|
136
|
-
### `Test::Omnibus::Upgrade CE|EE|<full image address>`
|
137
|
-
|
138
|
-
This scenario tests that:
|
139
|
-
|
140
|
-
- the GitLab Docker container works as expected by running tests against it (see
|
141
|
-
`Test::Instance::Image` below)
|
142
|
-
- that it can be upgraded to a new (`nightly` or custom image) container
|
143
|
-
- that the new GitLab container still works as expected
|
144
|
-
|
145
|
-
### `Test::Instance::Image CE|EE|<full image address>`
|
146
|
-
|
147
|
-
This scenario tests that the GitLab Docker container works as expected by
|
148
|
-
running tests against it.
|
149
|
-
|
150
|
-
To run tests against the GitLab containers, a GitLab QA (`gitlab/gitlab-qa`)
|
151
|
-
container is spun up and tests are run from it by running the `Test::Instance`
|
152
|
-
scenario (located under `qa/scenario/test/instance` in the GitLab codebase).
|
153
|
-
|
154
|
-
### `Test::Integration::Mattermost CE|EE|<full image address>`
|
155
|
-
|
156
|
-
This scenario tests that GitLab instance works as expected when
|
157
|
-
enabling the embedded Mattermost server (see `Test::Instance::Image`
|
158
|
-
above).
|
159
|
-
|
160
|
-
### `Test::Integration::LDAP CE|EE|<full image address>`
|
161
|
-
|
162
|
-
This scenario tests that GitLab instance works as expected with an external
|
163
|
-
LDAP server. The scenario spins up an OpenLDAP server, seeds users, and
|
164
|
-
attempts to LDAP-related tests against a GitLab instance.
|
165
|
-
|
166
|
-
In EE, both the GitLab standard and LDAP credentials are needed:
|
167
|
-
|
168
|
-
1. The first is used to login as an Admin to enter in the EE license.
|
169
|
-
2. The second is used to conduct LDAP-related tasks
|
170
|
-
|
171
|
-
### `Test::Instance::Any CE|EE|<full image address>`
|
172
|
-
|
173
|
-
This scenario tests that the any GitLab instance works as expected by running
|
174
|
-
tests against it (see `Test::Instance::Image` above).
|
175
|
-
|
176
|
-
## Supported environment variables
|
177
|
-
|
178
|
-
* `GITLAB_USERNAME` - username to use when signing into GitLab
|
179
|
-
* `GITLAB_PASSWORD` - password to use when signing into GitLab
|
180
|
-
* `GITLAB_USER_TYPE` - type of user to use when signing into GitLab: standard (default), ldap
|
181
|
-
* `GITLAB_LDAP_USERNAME` - LDAP username to use when signing into GitLab
|
182
|
-
* `GITLAB_LDAP_PASSWORD` - LDAP password to use when signing into GitLab
|
183
|
-
* `GITLAB_SANDBOX_NAME` - The sandbox group name test suite is going to use (default: `gitlab-qa-sandbox`)
|
184
|
-
* `EE_LICENSE` - Enterprise Edition license
|
185
|
-
* `QA_SCREENSHOTS_DIR` - Path to a directory where screenshots for failing tests
|
186
|
-
will be saved (default: `/tmp/gitlab-qa/screenshots`)
|
187
|
-
* `QA_LOGS_DIR` - Path to a directory where logs will be saved (default:
|
188
|
-
`/tmp/gitlab-qa/logs`)
|
189
|
-
* `DOCKER_HOST` - Docker host to run tests against (default: `http://localhost`)
|
190
|
-
* `CHROME_HEADLESS` - when running locally, set to `false` to allow Chrome tests to be visible - watch your tests being run
|
113
|
+
repositories under `qa/` directory, so please also check the documentation there.
|
191
114
|
|
192
115
|
## Contributing
|
193
116
|
|
194
|
-
Please see the [contribution guidelines](CONTRIBUTING.md)
|
117
|
+
Please see the [contribution guidelines](CONTRIBUTING.md).
|
data/docs/README.md
CHANGED
data/docs/architecture.md
CHANGED
@@ -3,3 +3,7 @@
|
|
3
3
|
<img src="https://docs.google.com/drawings/d/e/2PACX-1vTBlBcIBFFnQOd9xGQ7-2rij96mP2-ajNd9sQILhSI2D7x-q_8oMuO_GFG8-BWRoQZkVHWdQZTdXF8c/pub?w=855&h=2426">
|
4
4
|
|
5
5
|
_[edit diagram (for GitLab team members only)](https://docs.google.com/drawings/d/12mTCF7BU-xaxxS9MmIjkSYnf31RN4wgkkHcXTmS0NoA/edit)_
|
6
|
+
|
7
|
+
----
|
8
|
+
|
9
|
+
[Back to README.md](../README.md)
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# How it works
|
2
|
+
|
3
|
+
## Architecture
|
4
|
+
|
5
|
+
For a visual architecture explanation, please read the
|
6
|
+
[GitLab QA architecture](./architecture.md) documentation.
|
7
|
+
|
8
|
+
## What happens when you run `gitlab-qa Test::Instance::Image CE`
|
9
|
+
|
10
|
+
1. `bin/qa` calls [`.perform`][instance-image] on the fully qualified constant
|
11
|
+
`Gitlab::QA::Scenario::` + the scenario name, e.g. `QA::Scenario::Test::Instance::Image`
|
12
|
+
1. A new `gitlab-ce` container is started with `Component::Gitlab.perform`
|
13
|
+
1. Then `Component::Specs.perform` is called, which starts a `gitlab/gitlab-qa`
|
14
|
+
container (from [`gitlab-org/gitlab-ce@qa/Dockerfile`][gitlab-dockerfile])
|
15
|
+
and pass it the instance-level scenario to run (e.g. `Test::Instance` for
|
16
|
+
[`gitlab-org/gitlab-qa@lib/gitlab/qa/scenario/test/instance/image.rb`][instance-image]),
|
17
|
+
then the address of the live instance to be tested, and optional extra arguments.
|
18
|
+
1. Within the `gitlab/gitlab-qa` container, these arguments are passed to `bin/test` (since it's
|
19
|
+
the
|
20
|
+
[`ENTRYPOINT` defined at `gitlab-org/gitlab-ce@qa/Dockerfile`][gitlab-dockerfile]),
|
21
|
+
and then to `bin/qa`.
|
22
|
+
1. `bin/qa` then calls `.launch!` on the fully qualified constant `QA::Scenario::` +
|
23
|
+
the scenario name, e.g. `QA::Scenario::Test::Instance`, and ultimately calls
|
24
|
+
[`.perform`][instance]
|
25
|
+
1. The `.perform` method [saves the instance address for later][instance], then sets up an
|
26
|
+
`RSpec::Core::Runner`, pass it the extra arguments,
|
27
|
+
[configure the `Capybara` browser environment][runner],
|
28
|
+
and [starts the actual `RSpec` run][runner].
|
29
|
+
|
30
|
+
[instance-image]: https://gitlab.com/gitlab-org/gitlab-qa/blob/master/lib/gitlab/qa/scenario/test/instance/image.rb
|
31
|
+
[gitlab-dockerfile]: https://gitlab.com/gitlab-org/gitlab-ce/blob/60f51cd20af5db8759c31c32a9c45db5b5be2199/qa/Dockerfile
|
32
|
+
[instance]: https://gitlab.com/gitlab-org/gitlab-ce/blob/60f51cd20af5db8759c31c32a9c45db5b5be2199/qa/qa/scenario/test/instance.rb
|
33
|
+
[runner]: https://gitlab.com/gitlab-org/gitlab-ce/blob/60f51cd20af5db8759c31c32a9c45db5b5be2199/qa/qa/specs/runner.rb
|
34
|
+
|
35
|
+
----
|
36
|
+
|
37
|
+
[Back to README.md](../README.md)
|
@@ -25,10 +25,10 @@ docker-machine and possibly customizing network settings in the virtualization p
|
|
25
25
|
|
26
26
|
Native Docker bundles it's own lightweight virtualization technology that works just like VirtualBox,
|
27
27
|
but without requiring manual intervention. This provides less opportunity to customize network between
|
28
|
-
docker containers and the host machine, but works out of the box when mapping container ports to ports
|
28
|
+
docker containers and the host machine, but works out of the box when mapping container ports to ports
|
29
29
|
on localhost.
|
30
30
|
|
31
|
-
The major difference is that it never exposes the network as `bridge` to macOS, and so `--hostname`
|
31
|
+
The major difference is that it never exposes the network as `bridge` to macOS, and so `--hostname`
|
32
32
|
and `--network` only work inside docker, it has no effect when trying to access the containers from macOS.
|
33
33
|
|
34
34
|
There are people in Docker's forum that claim to be able to [expose the network][Docker Route]
|
@@ -43,11 +43,10 @@ your DNS and point to the IP/port of `dnsdock` application.
|
|
43
43
|
When using OS X Docker, you need to go to Preferences > Advanced and allocate at least **5.0 GB**,
|
44
44
|
otherwise some steps may fail to execute the `chrome-webdriver`.
|
45
45
|
|
46
|
-
When using docker-machine, see [this StackOverflow link for increasing memory]
|
47
|
-
(https://stackoverflow.com/questions/32834082/how-to-increase-docker-machine-memory-mac/36982696#36982696).
|
46
|
+
When using docker-machine, see [this StackOverflow link for increasing memory](https://stackoverflow.com/questions/32834082/how-to-increase-docker-machine-memory-mac/36982696#36982696).
|
48
47
|
|
49
48
|
This is required because chrome-webdriver makes use of `/dev/shm` shared memory. The VM will normally use
|
50
|
-
~
|
49
|
+
~3GB but unless you allocate 5GB or more some magic numbers may not enable a bigger `/dev/shm` in the
|
51
50
|
'host' VM that "native" docker runs on.
|
52
51
|
|
53
52
|
Please note that while it's possible to run multi-node tests like Geo Primary and Secondary, you can't
|
@@ -55,7 +54,7 @@ access the machines from your host machine, as they are all exposed as `0.0.0.0:
|
|
55
54
|
of that they don't match the configured VHOSTs in your GitLab installation, so the redirect login
|
56
55
|
fails.
|
57
56
|
|
58
|
-
It has to do with the lack of `bridge` support from Docker on macOS, also this is also something
|
57
|
+
It has to do with the lack of `bridge` support from Docker on macOS, also this is also something
|
59
58
|
Docker Inc [doesn't want to fix][Docker bridge issue].
|
60
59
|
|
61
60
|
To see if this limitation is still present, check the [documentation][Docker Networking].
|
@@ -112,3 +111,6 @@ You should be able to use your navigator and point it to `http://gitlab-primary.
|
|
112
111
|
[Docker bridge issue]: https://github.com/moby/moby/issues/22753#issuecomment-253534261
|
113
112
|
[dnsdock]: https://github.com/aacebedo/dnsdock
|
114
113
|
|
114
|
+
----
|
115
|
+
|
116
|
+
[Back to README.md](../README.md)
|
data/docs/trainings.md
CHANGED
@@ -6,3 +6,11 @@ A great introduction to the GitLab QA project, its internal structure, how it's
|
|
6
6
|
used, and how to start contributing to it. Check out the
|
7
7
|
[video](https://youtu.be/Ym159ATYN_g) and
|
8
8
|
[slides](https://docs.google.com/presentation/d/1-3YlYTIBzd2kSjGVYGPq1xqz4O7qtfABhoZRi_PcGRg/edit?usp=sharing).
|
9
|
+
|
10
|
+
## GitLab QA at FOSDEM
|
11
|
+
|
12
|
+
[Grzegorz's presentation of GitLab QA at FOSDEM 2018](https://youtu.be/arPxzixIl38).
|
13
|
+
|
14
|
+
----
|
15
|
+
|
16
|
+
[Back to README.md](../README.md)
|
@@ -0,0 +1,266 @@
|
|
1
|
+
# What tests can be run?
|
2
|
+
|
3
|
+
## The two types of QA tests
|
4
|
+
|
5
|
+
First of all, the first thing to choose is whether you want to run orchestrated
|
6
|
+
tests (various Docker containers are spun up and tests are run against them,
|
7
|
+
also from a specific Docker container) or instance-level tests (tests are run
|
8
|
+
from your host machine against a live instance: a local GDK installation or a staging/production instance).
|
9
|
+
|
10
|
+
Ultimately, orchestrated tests run instance-level tests, the difference being
|
11
|
+
that these tests are run from a specific Docker container instead of from your
|
12
|
+
host machine.
|
13
|
+
|
14
|
+
## Orchestrated tests
|
15
|
+
|
16
|
+
Orchestrated tests are run with the `gitlab-qa` binary (from the
|
17
|
+
`gitlab-qa` gem), or in the `gitlab-qa` project, with the `bin/qa` binary
|
18
|
+
(useful if you're working on the `gitlab-qa` project itself and want to test
|
19
|
+
your changes).
|
20
|
+
|
21
|
+
These tests spin up Docker containers specifically to run tests against them.
|
22
|
+
Orchestrated tests are usually used for features that involve external services
|
23
|
+
or complex setup (e.g. LDAP, Geo etc.), or for generic Omnibus checks (ensure
|
24
|
+
our Omnibus package works, can be updated / upgraded to EE etc.).
|
25
|
+
|
26
|
+
For more details on the internals, please read the
|
27
|
+
[How it works](./how_it_works.md) documentation.
|
28
|
+
|
29
|
+
## Supported environment variables
|
30
|
+
|
31
|
+
* `GITLAB_USERNAME` - username to use when signing into GitLab
|
32
|
+
* `GITLAB_PASSWORD` - password to use when signing into GitLab
|
33
|
+
* `GITLAB_USER_TYPE` - type of user to use when signing into GitLab: standard (default), ldap
|
34
|
+
* `GITLAB_LDAP_USERNAME` - LDAP username to use when signing into GitLab
|
35
|
+
* `GITLAB_LDAP_PASSWORD` - LDAP password to use when signing into GitLab
|
36
|
+
* `GITLAB_SANDBOX_NAME` - The sandbox group name the test suite is going to use (default: `gitlab-qa-sandbox`)
|
37
|
+
* `EE_LICENSE` - Enterprise Edition license
|
38
|
+
* `QA_SCREENSHOTS_DIR` - Path to a directory where screenshots for failing tests
|
39
|
+
will be saved (default: `/tmp/gitlab-qa/screenshots`)
|
40
|
+
* `QA_LOGS_DIR` - Path to a directory where logs will be saved (default:
|
41
|
+
`/tmp/gitlab-qa/logs`)
|
42
|
+
* `DOCKER_HOST` - Docker host to run tests against (default: `http://localhost`)
|
43
|
+
* `CHROME_HEADLESS` - when running locally, set to `false` to allow Chrome tests to be visible - watch your tests being run
|
44
|
+
|
45
|
+
### `Test::Instance::Image CE|EE|<full image address>`
|
46
|
+
|
47
|
+
This tests that a GitLab Docker container works as expected by running
|
48
|
+
instance-level tests against it.
|
49
|
+
|
50
|
+
To run tests against the GitLab containers, a GitLab QA (`gitlab/gitlab-qa`)
|
51
|
+
container is spun up and tests are run from it by running the `Test::Instance`
|
52
|
+
scenario (located under
|
53
|
+
[`gitlab-org/gitlab-ce@qa/qa/scenario/test/instance.rb`][test-instance] in the
|
54
|
+
GitLab CE project).
|
55
|
+
|
56
|
+
Example:
|
57
|
+
|
58
|
+
```
|
59
|
+
$ gitlab-qa Test::Instance::Image CE
|
60
|
+
```
|
61
|
+
|
62
|
+
### `Test::Omnibus::Image CE|EE|<full image address>`
|
63
|
+
|
64
|
+
This tests that a GitLab Docker container can start without any error.
|
65
|
+
|
66
|
+
This spins up a GitLab Docker container based on the given edition or image:
|
67
|
+
|
68
|
+
- `gitlab/gitlab-ce:nightly` for `CE`
|
69
|
+
- `gitlab/gitlab-ee:nightly` for `EE`
|
70
|
+
- the given custom image for `<full image address>`
|
71
|
+
|
72
|
+
Example:
|
73
|
+
|
74
|
+
```
|
75
|
+
$ gitlab-qa Test::Omnibus::Image CE
|
76
|
+
```
|
77
|
+
|
78
|
+
### `Test::Omnibus::Update CE|EE|<full image address>`
|
79
|
+
|
80
|
+
This tests that:
|
81
|
+
|
82
|
+
- the GitLab Docker `latest` container works as expected by running
|
83
|
+
instance-level tests against it (see `Test::Instance::Image` above)
|
84
|
+
- it can be updated to a new (`nightly` or `<full image address>`) container
|
85
|
+
- the new GitLab container still works as expected by running
|
86
|
+
`Test::Instance::Image` against it
|
87
|
+
|
88
|
+
Example:
|
89
|
+
|
90
|
+
```
|
91
|
+
# Update from gitlab/gitlab-ce:latest to gitlab/gitlab-ce:nightly
|
92
|
+
$ gitlab-qa Test::Omnibus::Update CE
|
93
|
+
|
94
|
+
# Update from gitlab/gitlab-ee:latest to gitlab/gitlab-ee:nightly
|
95
|
+
$ gitlab-qa Test::Omnibus::Update EE
|
96
|
+
|
97
|
+
# Update from gitlab/gitlab-ce:latest to gitlab/gitlab-ce:my-custom-tag
|
98
|
+
$ gitlab-qa Test::Omnibus::Update gitlab/gitlab-ce:my-custom-tag
|
99
|
+
```
|
100
|
+
|
101
|
+
### `Test::Omnibus::Upgrade CE|<full image address>`
|
102
|
+
|
103
|
+
This tests that:
|
104
|
+
|
105
|
+
- the GitLab Docker container works as expected by running instance-level tests
|
106
|
+
against it (see `Test::Instance::Image` above)
|
107
|
+
- it can be upgraded to a corresponding EE container
|
108
|
+
- the new GitLab container still works as expected by running
|
109
|
+
`Test::Instance::Image` against it
|
110
|
+
|
111
|
+
Example:
|
112
|
+
|
113
|
+
```
|
114
|
+
# Ugrade from gitlab/gitlab-ce:nightly to gitlab/gitlab-ee:nightly
|
115
|
+
$ gitlab-qa Test::Omnibus::Upgrade CE
|
116
|
+
|
117
|
+
# Ugrade from gitlab/gitlab-ce:my-custom-tag to gitlab/gitlab-ee:my-custom-tag
|
118
|
+
$ gitlab-qa Test::Omnibus::Upgrade gitlab/gitlab-ce:my-custom-tag
|
119
|
+
```
|
120
|
+
|
121
|
+
### `Test::Integration::Geo EE|<full image address>`
|
122
|
+
|
123
|
+
This tests that two GitLab Geo instances work as expected.
|
124
|
+
|
125
|
+
The scenario spins up a primary and secondary GitLab Geo nodes, and verifies
|
126
|
+
that the replications (repository, attachments, project rename etc.) work as
|
127
|
+
expected.
|
128
|
+
|
129
|
+
To run tests against the GitLab containers, a GitLab QA (`gitlab/gitlab-qa`)
|
130
|
+
container is spun up and tests are run from it by running the
|
131
|
+
`QA::EE::Scenario::Test::Geo` scenario (located under
|
132
|
+
[`gitlab-org/gitlab-ee@qa/qa/ee/scenario/test/geo.rb`][test-geo] in the GitLab
|
133
|
+
EE project).
|
134
|
+
|
135
|
+
**Required environment variables:**
|
136
|
+
|
137
|
+
- `EE_LICENSE`: A valid EE license.
|
138
|
+
|
139
|
+
Example:
|
140
|
+
|
141
|
+
```
|
142
|
+
$ export EE_LICENSE=$(cat /path/to/Geo.gitlab_license)
|
143
|
+
$ gitlab-qa Test::Integration::Geo EE
|
144
|
+
```
|
145
|
+
|
146
|
+
[test-geo]: https://gitlab.com/gitlab-org/gitlab-ee/blob/master/qa/qa/ee/scenario/test/geo.rb
|
147
|
+
|
148
|
+
### `Test::Integration::LDAP CE|EE|<full image address>`
|
149
|
+
|
150
|
+
This tests that a GitLab instance works as expected with an external
|
151
|
+
LDAP server.
|
152
|
+
|
153
|
+
The scenario spins up an OpenLDAP server, seeds users, and verifies
|
154
|
+
that LDAP-related features work as expected.
|
155
|
+
|
156
|
+
To run tests against the GitLab containers, a GitLab QA (`gitlab/gitlab-qa`)
|
157
|
+
container is spun up and tests are run from it by running the
|
158
|
+
`Test::Integration::LDAP` scenario (located under
|
159
|
+
[`gitlab-org/gitlab-ce@qa/qa/scenario/test/integration/ldap.rb`][test-integration-ldap]
|
160
|
+
in the GitLab CE project).
|
161
|
+
|
162
|
+
In EE, both the GitLab standard and LDAP credentials are needed:
|
163
|
+
|
164
|
+
1. The first is used to login as an Admin to enter in the EE license.
|
165
|
+
2. The second is used to conduct LDAP-related tasks
|
166
|
+
|
167
|
+
**Required environment variables:**
|
168
|
+
|
169
|
+
- [For EE only] `EE_LICENSE`: A valid EE license.
|
170
|
+
|
171
|
+
Example:
|
172
|
+
|
173
|
+
```
|
174
|
+
$ gitlab-qa Test::Integration::LDAP CE
|
175
|
+
|
176
|
+
# For EE
|
177
|
+
$ export EE_LICENSE=$(cat /path/to/Geo.gitlab_license)
|
178
|
+
|
179
|
+
$ gitlab-qa Test::Integration::LDAP EE
|
180
|
+
```
|
181
|
+
|
182
|
+
[test-integration-ldap]: https://gitlab.com/gitlab-org/gitlab-ce/blob/master/qa/qa/scenario/test/integration/ldap.rb
|
183
|
+
|
184
|
+
### `Test::Integration::Mattermost CE|EE|<full image address>`
|
185
|
+
|
186
|
+
This tests that a GitLab instance works as expected when enabling the embedded
|
187
|
+
Mattermost server (see `Test::Instance::Image` above).
|
188
|
+
|
189
|
+
To run tests against the GitLab container, a GitLab QA (`gitlab/gitlab-qa`)
|
190
|
+
container is spun up and tests are run from it by running the
|
191
|
+
`Test::Integration::Mattermost` scenario (located under
|
192
|
+
[`gitlab-org/gitlab-ce@qa/qa/scenario/test/integration/mattermost.rb`][test-integration-mattermost]
|
193
|
+
in the GitLab CE project).
|
194
|
+
|
195
|
+
**Required environment variables:**
|
196
|
+
|
197
|
+
- [For EE only] `EE_LICENSE`: A valid EE license.
|
198
|
+
|
199
|
+
Example:
|
200
|
+
|
201
|
+
```
|
202
|
+
$ gitlab-qa Test::Integration::Mattermost CE
|
203
|
+
|
204
|
+
# For EE
|
205
|
+
$ export EE_LICENSE=$(cat /path/to/Geo.gitlab_license)
|
206
|
+
|
207
|
+
$ gitlab-qa Test::Integration::Mattermost EE
|
208
|
+
```
|
209
|
+
|
210
|
+
[test-integration-mattermost]: https://gitlab.com/gitlab-org/gitlab-ce/blob/master/qa/qa/scenario/test/integration/mattermost.rb
|
211
|
+
|
212
|
+
### `Test::Instance::Any CE|EE|<full image address>:nightly|latest|any_tag http://your.instance.gitlab`
|
213
|
+
|
214
|
+
This tests that a live GitLab instance works as expected by running tests
|
215
|
+
against it.
|
216
|
+
|
217
|
+
To run tests against the GitLab instance, a GitLab QA (`gitlab/gitlab-qa`)
|
218
|
+
container is spun up and tests are run from it by running the
|
219
|
+
`Test::Instance` scenario (located under
|
220
|
+
[`gitlab-org/gitlab-ce@qa/qa/scenario/test/instance.rb`][test-instance] in the
|
221
|
+
in the GitLab CE project).
|
222
|
+
|
223
|
+
Example:
|
224
|
+
|
225
|
+
```
|
226
|
+
$ export GITLAB_USERNAME=your_username
|
227
|
+
$ export GITLAB_PASSWORD=your_password
|
228
|
+
|
229
|
+
# Runs the QA suite for an instance running GitLab CE 10.8.1
|
230
|
+
$ gitlab-qa Test::Instance::Any EE:10.8.1-ce https://your.instance.gitlab
|
231
|
+
|
232
|
+
# Runs the QA suite for an instance running GitLab EE 10.7.3
|
233
|
+
$ gitlab-qa Test::Instance::Any EE:10.7.3-ee https://your.instance.gitlab
|
234
|
+
```
|
235
|
+
|
236
|
+
### `Test::Instance::Staging`
|
237
|
+
|
238
|
+
This scenario tests that the [`staging.gitlab.com`](https://staging.gitlab.com)
|
239
|
+
works as expected by running tests against it.
|
240
|
+
|
241
|
+
To run tests against the GitLab instance, a GitLab QA (`gitlab/gitlab-qa`)
|
242
|
+
container is spun up and tests are run from it by running the
|
243
|
+
`Test::Instance` scenario (located under
|
244
|
+
[`gitlab-org/gitlab-ce@qa/qa/scenario/test/instance.rb`][test-instance] in the
|
245
|
+
in the GitLab CE project).
|
246
|
+
|
247
|
+
**Required environment variables:**
|
248
|
+
|
249
|
+
- `GITLAB_QA_ACCESS_TOKEN`: A valid personal access token with the `api` scope.
|
250
|
+
This is used to retrieve the version that staging is currently running.
|
251
|
+
|
252
|
+
Example:
|
253
|
+
|
254
|
+
```
|
255
|
+
$ export GITLAB_QA_ACCESS_TOKEN=your_api_access_token
|
256
|
+
$ export GITLAB_USERNAME="gitlab-qa"
|
257
|
+
$ export GITLAB_PASSWORD="$GITLAB_QA_PASSWORD"
|
258
|
+
|
259
|
+
$ gitlab-qa Test::Instance::Staging
|
260
|
+
```
|
261
|
+
|
262
|
+
[test-instance]: https://gitlab.com/gitlab-org/gitlab-ce/blob/master/qa/qa/scenario/test/instance.rb
|
263
|
+
|
264
|
+
----
|
265
|
+
|
266
|
+
[Back to README.md](../README.md)
|
@@ -17,7 +17,7 @@ module Gitlab
|
|
17
17
|
|
18
18
|
puts "Running test suite `#{suite}` for #{release.project_name}"
|
19
19
|
|
20
|
-
@docker.run(release.qa_image, release.
|
20
|
+
@docker.run(release.qa_image, release.qa_tag, suite, *args) do |command|
|
21
21
|
command << "-t --rm --net=#{network || 'bridge'}"
|
22
22
|
|
23
23
|
variables = Runtime::Env.variables
|
data/lib/gitlab/qa/release.rb
CHANGED
@@ -8,15 +8,11 @@ module Gitlab
|
|
8
8
|
# including staging and on-premises installation.
|
9
9
|
#
|
10
10
|
class Any < Scenario::Template
|
11
|
-
def perform(
|
12
|
-
release = Release.new(edition).tap do |r|
|
13
|
-
r.tag = tag
|
14
|
-
end
|
15
|
-
|
11
|
+
def perform(edition_and_tag, address, *rspec_args)
|
16
12
|
Component::Specs.perform do |specs|
|
17
13
|
specs.suite = 'Test::Instance'
|
18
|
-
specs.release =
|
19
|
-
specs.args = [address]
|
14
|
+
specs.release = Release.new(edition_and_tag)
|
15
|
+
specs.args = [address, *rspec_args]
|
20
16
|
end
|
21
17
|
end
|
22
18
|
end
|
@@ -27,6 +27,7 @@ module Gitlab
|
|
27
27
|
postgresql['md5_auth_cidr_addresses'] = ['0.0.0.0/0'];
|
28
28
|
postgresql['max_replication_slots'] = 1;
|
29
29
|
gitlab_rails['db_key_base'] = '4dd58204865eb41bca93bd38131d51cc';
|
30
|
+
gitlab_rails['monitoring_whitelist'] = ['0.0.0.0/0'];
|
30
31
|
sidekiq['concurrency'] = 2;
|
31
32
|
unicorn['worker_processes'] = 2;
|
32
33
|
OMNIBUS
|
@@ -41,6 +42,7 @@ module Gitlab
|
|
41
42
|
gitlab_rails['db_key_base'] = '4dd58204865eb41bca93bd38131d51cc';
|
42
43
|
sidekiq['concurrency'] = 2;
|
43
44
|
unicorn['worker_processes'] = 2;
|
45
|
+
gitlab_rails['monitoring_whitelist'] = ['0.0.0.0/0'];
|
44
46
|
OMNIBUS
|
45
47
|
|
46
48
|
secondary.act do
|
@@ -7,12 +7,15 @@ module Gitlab
|
|
7
7
|
module Test
|
8
8
|
module Omnibus
|
9
9
|
class Update < Scenario::Template
|
10
|
-
def perform(
|
11
|
-
|
10
|
+
def perform(previous_edition, next_edition = nil)
|
11
|
+
next_edition ||= previous_edition
|
12
|
+
|
13
|
+
previous_release = Release.new(previous_edition).previous_stable
|
14
|
+
next_release = Release.new(next_edition)
|
12
15
|
|
13
16
|
Docker::Volumes.new.with_temporary_volumes do |volumes|
|
14
17
|
Scenario::Test::Instance::Image
|
15
|
-
.perform(
|
18
|
+
.perform(previous_release) do |scenario|
|
16
19
|
scenario.volumes = volumes
|
17
20
|
end
|
18
21
|
|
data/lib/gitlab/qa/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gitlab-qa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Grzegorz Bizon
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-06-
|
11
|
+
date: 2018-06-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gitlab-styles
|
@@ -118,8 +118,10 @@ files:
|
|
118
118
|
- bin/setup
|
119
119
|
- docs/README.md
|
120
120
|
- docs/architecture.md
|
121
|
-
- docs/
|
121
|
+
- docs/how_it_works.md
|
122
|
+
- docs/run_geo_qa_against_gdk.md
|
122
123
|
- docs/trainings.md
|
124
|
+
- docs/what_tests_can_be_run.md
|
123
125
|
- exe/gitlab-qa
|
124
126
|
- fixtures/ldap/tanuki.ldif
|
125
127
|
- gitlab-qa.gemspec
|
@@ -167,7 +169,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
167
169
|
version: '0'
|
168
170
|
requirements: []
|
169
171
|
rubyforge_project:
|
170
|
-
rubygems_version: 2.
|
172
|
+
rubygems_version: 2.5.2
|
171
173
|
signing_key:
|
172
174
|
specification_version: 4
|
173
175
|
summary: Integration tests for GitLab
|