gitlab-qa 5.10.1 → 5.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitlab-ci.yml +38 -0
- data/docs/what_tests_can_be_run.md +31 -0
- data/lib/gitlab/qa/component/jira.rb +73 -0
- data/lib/gitlab/qa/runtime/env.rb +4 -1
- data/lib/gitlab/qa/scenario/test/integration/jira.rb +40 -0
- data/lib/gitlab/qa/version.rb +1 -1
- data/lib/gitlab/qa.rb +2 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ca0c9bc180dabbb9cba4984c2f19381d16ae57631e7ca308e38a3649d8d72dbf
|
4
|
+
data.tar.gz: '018c552b3d04932d581872c7ddb3d3199545a868884530e58d57ff0842528134'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c1be4f5eab6dbefb4685dc03f7f12140cc442766f4ec86006a927aa95ae787be6065f762f0ff1b3d6f79ea3158464e9a5e33ac5c7790b75bc31ac3ed005ac19
|
7
|
+
data.tar.gz: abbff15cf25737e634429c22e3a704ec3f933656546243a92b408c6c55baa8056439a2f3a0c0ca1901a2e54f3e166ff16df307d61d6db109e35ed566c914b4dd
|
data/.gitlab-ci.yml
CHANGED
@@ -848,6 +848,44 @@ ee:smtp:
|
|
848
848
|
variables:
|
849
849
|
QA_SCENARIO: "Test::Integration::SMTP"
|
850
850
|
|
851
|
+
ce:jira:
|
852
|
+
extends:
|
853
|
+
- .test
|
854
|
+
- .high-capacity
|
855
|
+
- .ce-qa
|
856
|
+
- .rspec-report-opts
|
857
|
+
variables:
|
858
|
+
QA_SCENARIO: "Test::Integration::Jira"
|
859
|
+
|
860
|
+
ce:jira-quarantine:
|
861
|
+
extends:
|
862
|
+
- .test
|
863
|
+
- .high-capacity
|
864
|
+
- .ce-qa
|
865
|
+
- .quarantine
|
866
|
+
- .rspec-report-opts
|
867
|
+
variables:
|
868
|
+
QA_SCENARIO: "Test::Integration::Jira"
|
869
|
+
|
870
|
+
ee:jira:
|
871
|
+
extends:
|
872
|
+
- .test
|
873
|
+
- .high-capacity
|
874
|
+
- .ee-qa
|
875
|
+
- .rspec-report-opts
|
876
|
+
variables:
|
877
|
+
QA_SCENARIO: "Test::Integration::Jira"
|
878
|
+
|
879
|
+
ee:jira-quarantine:
|
880
|
+
extends:
|
881
|
+
- .test
|
882
|
+
- .high-capacity
|
883
|
+
- .ee-qa
|
884
|
+
- .quarantine
|
885
|
+
- .rspec-report-opts
|
886
|
+
variables:
|
887
|
+
QA_SCENARIO: "Test::Integration::Jira"
|
888
|
+
|
851
889
|
# This job requires the `GITLAB_QA_ACCESS_TOKEN` and `GITLAB_QA_DEV_ACCESS_TOKEN`
|
852
890
|
# variable to be passed when triggered.
|
853
891
|
staging:
|
@@ -80,6 +80,8 @@ For more details on the internals, please read the
|
|
80
80
|
* `CI_SERVER_PERSONAL_ACCESS_TOKEN` - Personal access token of the server that is running the CI pipeline. This is used for pulling CI_RUNNER information in certain tests.
|
81
81
|
* `GEO_MAX_FILE_REPLICATION_TIME` - maximum time that a test will wait for a replicated file to appear on a Geo secondary node (default 120 seconds)
|
82
82
|
* `GEO_MAX_DB_REPLICATION_TIME` - maximum time that a test will wait for database data to appear on a Geo secondary node (default 120 seconds)
|
83
|
+
* `JIRA_ADMIN_USERNAME` - Username for authenticating with Jira server as admin.
|
84
|
+
* `JIRA_ADMIN_PASSWORD` - Password for authenticating with Jira server as admin.
|
83
85
|
|
84
86
|
## [Supported Remote Grid environment variables](./running_against_remote_grid.md)
|
85
87
|
|
@@ -470,6 +472,35 @@ Example:
|
|
470
472
|
$ gitlab-qa Test::Integration::SMTP CE
|
471
473
|
```
|
472
474
|
|
475
|
+
### `Test::Integration::Jira CE|EE|<full image address>`
|
476
|
+
|
477
|
+
This tests that a GitLab instance works as expected with an external
|
478
|
+
Jira server.
|
479
|
+
It starts up a Docker container for Jira Server and another container
|
480
|
+
for GitLab.
|
481
|
+
|
482
|
+
To run tests against the GitLab container, a GitLab QA (`gitlab/gitlab-qa`)
|
483
|
+
container is spun up and tests are run from it by running the
|
484
|
+
`Test::Integration::Jira` scenario.
|
485
|
+
|
486
|
+
**Required environment variables:**
|
487
|
+
|
488
|
+
- [For EE only] `EE_LICENSE`: A valid EE license.
|
489
|
+
- `JIRA_ADMIN_USERNAME`: Username for authenticating with Jira server as admin.
|
490
|
+
- `JIRA_ADMIN_PASSWORD`: Password for authenticating with Jira server as admin.
|
491
|
+
|
492
|
+
Example:
|
493
|
+
|
494
|
+
```
|
495
|
+
$ export JIRA_ADMIN_USERNAME=<jira_admin_username>
|
496
|
+
$ export JIRA_ADMIN_PASSWORD=<jira_admin_password>
|
497
|
+
|
498
|
+
# For EE
|
499
|
+
$ export EE_LICENSE=$(cat /path/to/GitLab.gitlab_license)
|
500
|
+
|
501
|
+
$ gitlab-qa Test::Integration::Jira EE
|
502
|
+
```
|
503
|
+
|
473
504
|
### `Test::Instance::Any CE|EE|<full image address>:nightly|latest|any_tag http://your.instance.gitlab`
|
474
505
|
|
475
506
|
This tests that a live GitLab instance works as expected by running tests
|
@@ -0,0 +1,73 @@
|
|
1
|
+
module Gitlab
|
2
|
+
module QA
|
3
|
+
module Component
|
4
|
+
class Jira
|
5
|
+
include Scenario::Actable
|
6
|
+
|
7
|
+
JIRA_IMAGE = 'registry.gitlab.com/gitlab-org/gitlab-qa/jira-gitlab'.freeze
|
8
|
+
JIRA_IMAGE_TAG = '8.8-project-and-issue'.freeze
|
9
|
+
|
10
|
+
attr_reader :docker
|
11
|
+
attr_accessor :environment, :network
|
12
|
+
attr_writer :name
|
13
|
+
|
14
|
+
def initialize
|
15
|
+
@docker = Docker::Engine.new
|
16
|
+
@environment = {}
|
17
|
+
end
|
18
|
+
|
19
|
+
def name
|
20
|
+
@name ||= "jira"
|
21
|
+
end
|
22
|
+
|
23
|
+
def hostname
|
24
|
+
"#{name}.#{network}"
|
25
|
+
end
|
26
|
+
|
27
|
+
def instance
|
28
|
+
raise 'Please provide a block!' unless block_given?
|
29
|
+
|
30
|
+
prepare
|
31
|
+
start
|
32
|
+
|
33
|
+
yield self
|
34
|
+
ensure
|
35
|
+
teardown
|
36
|
+
end
|
37
|
+
|
38
|
+
def prepare
|
39
|
+
@docker.pull(JIRA_IMAGE, JIRA_IMAGE_TAG)
|
40
|
+
|
41
|
+
return if @docker.network_exists?(network)
|
42
|
+
|
43
|
+
@docker.network_create(network)
|
44
|
+
end
|
45
|
+
|
46
|
+
def start
|
47
|
+
docker.run(JIRA_IMAGE, JIRA_IMAGE_TAG) do |command|
|
48
|
+
command << '-d '
|
49
|
+
command << "--name #{name}"
|
50
|
+
command << "--net #{network}"
|
51
|
+
command << "--hostname #{hostname}"
|
52
|
+
command << "--publish 8080:8080"
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
def restart
|
57
|
+
@docker.restart(name)
|
58
|
+
end
|
59
|
+
|
60
|
+
def teardown
|
61
|
+
raise 'Invalid instance name!' unless name
|
62
|
+
|
63
|
+
@docker.stop(name)
|
64
|
+
@docker.remove(name)
|
65
|
+
end
|
66
|
+
|
67
|
+
def set_jira_hostname
|
68
|
+
::Gitlab::QA::Runtime::Env.jira_hostname = hostname
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
@@ -74,7 +74,10 @@ module Gitlab
|
|
74
74
|
'SLACK_ICON_EMOJI' => :slack_icon_emoji,
|
75
75
|
'GITLAB_QA_FORMLESS_LOGIN_TOKEN' => :gitlab_qa_formless_login_token,
|
76
76
|
'GEO_MAX_FILE_REPLICATION_TIME' => :geo_max_file_replication_time,
|
77
|
-
'GEO_MAX_DB_REPLICATION_TIME' => :geo_max_db_replication_time
|
77
|
+
'GEO_MAX_DB_REPLICATION_TIME' => :geo_max_db_replication_time,
|
78
|
+
'JIRA_HOSTNAME' => :jira_hostname,
|
79
|
+
'JIRA_ADMIN_USERNAME' => :jira_admin_username,
|
80
|
+
'JIRA_ADMIN_PASSWORD' => :jira_admin_password
|
78
81
|
}.freeze
|
79
82
|
|
80
83
|
ENV_VARIABLES.each_value do |accessor|
|
@@ -0,0 +1,40 @@
|
|
1
|
+
module Gitlab
|
2
|
+
module QA
|
3
|
+
module Scenario
|
4
|
+
module Test
|
5
|
+
module Integration
|
6
|
+
class Jira < Scenario::Template
|
7
|
+
def perform(release, *rspec_args)
|
8
|
+
Component::Gitlab.perform do |gitlab|
|
9
|
+
gitlab.release = Release.new(release)
|
10
|
+
gitlab.network = 'test'
|
11
|
+
gitlab.name = 'gitlab-jira'
|
12
|
+
|
13
|
+
Component::Jira.perform do |jira|
|
14
|
+
jira.network = gitlab.network
|
15
|
+
jira.set_jira_hostname
|
16
|
+
|
17
|
+
jira.instance do
|
18
|
+
gitlab.instance do
|
19
|
+
puts 'Running Jira specs!'
|
20
|
+
|
21
|
+
rspec_args << "--" unless rspec_args.include?('--')
|
22
|
+
rspec_args << %w[--tag jira]
|
23
|
+
|
24
|
+
Component::Specs.perform do |specs|
|
25
|
+
specs.suite = 'Test::Instance::All'
|
26
|
+
specs.release = gitlab.release
|
27
|
+
specs.network = gitlab.network
|
28
|
+
specs.args = [gitlab.address, *rspec_args]
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
data/lib/gitlab/qa/version.rb
CHANGED
data/lib/gitlab/qa.rb
CHANGED
@@ -52,6 +52,7 @@ module Gitlab
|
|
52
52
|
autoload :Elasticsearch, 'gitlab/qa/scenario/test/integration/elasticsearch'
|
53
53
|
autoload :SMTP, 'gitlab/qa/scenario/test/integration/smtp'
|
54
54
|
autoload :GitalyHA, 'gitlab/qa/scenario/test/integration/gitaly_ha'
|
55
|
+
autoload :Jira, 'gitlab/qa/scenario/test/integration/jira'
|
55
56
|
end
|
56
57
|
|
57
58
|
module Sanity
|
@@ -72,6 +73,7 @@ module Gitlab
|
|
72
73
|
autoload :Preprod, 'gitlab/qa/component/preprod'
|
73
74
|
autoload :Elasticsearch, 'gitlab/qa/component/elasticsearch'
|
74
75
|
autoload :MailHog, 'gitlab/qa/component/mail_hog'
|
76
|
+
autoload :Jira, 'gitlab/qa/component/jira'
|
75
77
|
autoload :PostgreSQL, 'gitlab/qa/component/postgresql'
|
76
78
|
end
|
77
79
|
|
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: 5.
|
4
|
+
version: 5.12.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: 2020-05-
|
11
|
+
date: 2020-05-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: climate_control
|
@@ -240,6 +240,7 @@ files:
|
|
240
240
|
- lib/gitlab/qa/component/elasticsearch.rb
|
241
241
|
- lib/gitlab/qa/component/gitlab.rb
|
242
242
|
- lib/gitlab/qa/component/internet_tunnel.rb
|
243
|
+
- lib/gitlab/qa/component/jira.rb
|
243
244
|
- lib/gitlab/qa/component/ldap.rb
|
244
245
|
- lib/gitlab/qa/component/mail_hog.rb
|
245
246
|
- lib/gitlab/qa/component/minio.rb
|
@@ -281,6 +282,7 @@ files:
|
|
281
282
|
- lib/gitlab/qa/scenario/test/integration/gitaly_ha.rb
|
282
283
|
- lib/gitlab/qa/scenario/test/integration/group_saml.rb
|
283
284
|
- lib/gitlab/qa/scenario/test/integration/instance_saml.rb
|
285
|
+
- lib/gitlab/qa/scenario/test/integration/jira.rb
|
284
286
|
- lib/gitlab/qa/scenario/test/integration/kubernetes.rb
|
285
287
|
- lib/gitlab/qa/scenario/test/integration/ldap.rb
|
286
288
|
- lib/gitlab/qa/scenario/test/integration/ldap_no_server.rb
|