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
e0057d51
Commit
e0057d51
authored
Mar 15, 2020
by
Takuya Noguchi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use Ruby 2.7 in specs to remove Ruby 2.1/2.2/2.3
Signed-off-by:
Takuya Noguchi
<
takninnovationresearch@gmail.com
>
parent
62945ef8
Changes
20
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
91 additions
and
86 deletions
+91
-86
changelogs/unreleased/195165-replace-eol-ruby-versions-in-specs.yml
.../unreleased/195165-replace-eol-ruby-versions-in-specs.yml
+5
-0
ee/spec/lib/ee/gitlab/path_regex_spec.rb
ee/spec/lib/ee/gitlab/path_regex_spec.rb
+1
-1
ee/spec/lib/gitlab/web_ide/config_spec.rb
ee/spec/lib/gitlab/web_ide/config_spec.rb
+2
-2
ee/spec/models/web_ide_terminal_spec.rb
ee/spec/models/web_ide_terminal_spec.rb
+3
-3
ee/spec/services/ci/create_web_ide_terminal_service_spec.rb
ee/spec/services/ci/create_web_ide_terminal_service_spec.rb
+1
-1
ee/spec/services/dependency_proxy/download_blob_service_spec.rb
...c/services/dependency_proxy/download_blob_service_spec.rb
+1
-1
spec/factories/ci/builds.rb
spec/factories/ci/builds.rb
+2
-2
spec/lib/gitlab/ci/build/image_spec.rb
spec/lib/gitlab/ci/build/image_spec.rb
+1
-1
spec/lib/gitlab/ci/config/entry/image_spec.rb
spec/lib/gitlab/ci/config/entry/image_spec.rb
+8
-8
spec/lib/gitlab/ci/config/entry/root_spec.rb
spec/lib/gitlab/ci/config/entry/root_spec.rb
+7
-7
spec/lib/gitlab/ci/config/external/file/project_spec.rb
spec/lib/gitlab/ci/config/external/file/project_spec.rb
+2
-2
spec/lib/gitlab/ci/config/external/mapper_spec.rb
spec/lib/gitlab/ci/config/external/mapper_spec.rb
+13
-13
spec/lib/gitlab/ci/config/external/processor_spec.rb
spec/lib/gitlab/ci/config/external/processor_spec.rb
+10
-10
spec/lib/gitlab/ci/config_spec.rb
spec/lib/gitlab/ci/config_spec.rb
+13
-13
spec/lib/gitlab/ci/yaml_processor_spec.rb
spec/lib/gitlab/ci/yaml_processor_spec.rb
+10
-10
spec/lib/gitlab/config/loader/yaml_spec.rb
spec/lib/gitlab/config/loader/yaml_spec.rb
+2
-2
spec/models/ci/build_spec.rb
spec/models/ci/build_spec.rb
+3
-3
spec/requests/api/lint_spec.rb
spec/requests/api/lint_spec.rb
+1
-1
spec/requests/api/runner_spec.rb
spec/requests/api/runner_spec.rb
+1
-1
spec/services/ci/create_pipeline_service_spec.rb
spec/services/ci/create_pipeline_service_spec.rb
+5
-5
No files found.
changelogs/unreleased/195165-replace-eol-ruby-versions-in-specs.yml
0 → 100644
View file @
e0057d51
---
title
:
Use Ruby 2.7 in specs to remove Ruby 2.1/2.2/2.3
merge_request
:
27269
author
:
Takuya Noguchi
type
:
other
ee/spec/lib/ee/gitlab/path_regex_spec.rb
View file @
e0057d51
...
@@ -16,7 +16,7 @@ describe Gitlab::PathRegex do
...
@@ -16,7 +16,7 @@ describe Gitlab::PathRegex do
end
end
it
'does not match other non-word characters'
do
it
'does not match other non-word characters'
do
expect
(
subject
.
match
(
'ruby:2.
3.6
'
)[
0
]).
to
eq
(
'ruby'
)
expect
(
subject
.
match
(
'ruby:2.
7.0
'
)[
0
]).
to
eq
(
'ruby'
)
end
end
end
end
...
...
ee/spec/lib/gitlab/web_ide/config_spec.rb
View file @
e0057d51
...
@@ -11,7 +11,7 @@ describe Gitlab::WebIde::Config do
...
@@ -11,7 +11,7 @@ describe Gitlab::WebIde::Config do
let
(
:yml
)
do
let
(
:yml
)
do
<<-
EOS
<<-
EOS
terminal:
terminal:
image: ruby:2.
2
image: ruby:2.
7
before_script:
before_script:
- gem install rspec
- gem install rspec
EOS
EOS
...
@@ -21,7 +21,7 @@ describe Gitlab::WebIde::Config do
...
@@ -21,7 +21,7 @@ describe Gitlab::WebIde::Config do
it
'returns hash created from string'
do
it
'returns hash created from string'
do
hash
=
{
hash
=
{
terminal:
{
terminal:
{
image:
'ruby:2.
2
'
,
image:
'ruby:2.
7
'
,
before_script:
[
'gem install rspec'
]
before_script:
[
'gem install rspec'
]
}
}
}
}
...
...
ee/spec/models/web_ide_terminal_spec.rb
View file @
e0057d51
...
@@ -41,7 +41,7 @@ describe WebIdeTerminal do
...
@@ -41,7 +41,7 @@ describe WebIdeTerminal do
context
'when image does not have an alias'
do
context
'when image does not have an alias'
do
let
(
:config
)
do
let
(
:config
)
do
{
image:
'ruby:2.
1
'
}.
merge
(
services_with_aliases
)
{
image:
'ruby:2.
7
'
}.
merge
(
services_with_aliases
)
end
end
it
'returns services aliases'
do
it
'returns services aliases'
do
...
@@ -51,7 +51,7 @@ describe WebIdeTerminal do
...
@@ -51,7 +51,7 @@ describe WebIdeTerminal do
context
'when both image and services have aliases'
do
context
'when both image and services have aliases'
do
let
(
:config
)
do
let
(
:config
)
do
{
image:
{
name:
'ruby:2.
1
'
,
alias:
'ruby'
}
}.
merge
(
services_with_aliases
)
{
image:
{
name:
'ruby:2.
7
'
,
alias:
'ruby'
}
}.
merge
(
services_with_aliases
)
end
end
it
'returns all aliases'
do
it
'returns all aliases'
do
...
@@ -61,7 +61,7 @@ describe WebIdeTerminal do
...
@@ -61,7 +61,7 @@ describe WebIdeTerminal do
context
'when image and services does not have any alias'
do
context
'when image and services does not have any alias'
do
let
(
:config
)
do
let
(
:config
)
do
{
image:
'ruby:2.
1
'
,
services:
[
'postgres'
]
}
{
image:
'ruby:2.
7
'
,
services:
[
'postgres'
]
}
end
end
it
'returns an empty array'
do
it
'returns an empty array'
do
...
...
ee/spec/services/ci/create_web_ide_terminal_service_spec.rb
View file @
e0057d51
...
@@ -56,7 +56,7 @@ describe Ci::CreateWebIdeTerminalService do
...
@@ -56,7 +56,7 @@ describe Ci::CreateWebIdeTerminalService do
<<-
EOS
<<-
EOS
terminal:
terminal:
image:
image:
name: ruby:2.
2
name: ruby:2.
7
ports:
ports:
- 80
- 80
script: rspec
script: rspec
...
...
ee/spec/services/dependency_proxy/download_blob_service_spec.rb
View file @
e0057d51
...
@@ -6,7 +6,7 @@ describe DependencyProxy::DownloadBlobService do
...
@@ -6,7 +6,7 @@ describe DependencyProxy::DownloadBlobService do
let
(
:image
)
{
'alpine'
}
let
(
:image
)
{
'alpine'
}
let
(
:token
)
{
Digest
::
SHA256
.
hexdigest
(
'123'
)
}
let
(
:token
)
{
Digest
::
SHA256
.
hexdigest
(
'123'
)
}
let
(
:blob_sha
)
{
Digest
::
SHA256
.
hexdigest
(
'ruby:2.
3.9
'
)
}
let
(
:blob_sha
)
{
Digest
::
SHA256
.
hexdigest
(
'ruby:2.
7.0
'
)
}
subject
{
described_class
.
new
(
image
,
blob_sha
,
token
).
execute
}
subject
{
described_class
.
new
(
image
,
blob_sha
,
token
).
execute
}
...
...
spec/factories/ci/builds.rb
View file @
e0057d51
...
@@ -16,7 +16,7 @@ FactoryBot.define do
...
@@ -16,7 +16,7 @@ FactoryBot.define do
options
do
options
do
{
{
image:
'ruby:2.
1
'
,
image:
'ruby:2.
7
'
,
services:
[
'postgres'
],
services:
[
'postgres'
],
script:
[
'ls -a'
]
script:
[
'ls -a'
]
}
}
...
@@ -330,7 +330,7 @@ FactoryBot.define do
...
@@ -330,7 +330,7 @@ FactoryBot.define do
trait
:extended_options
do
trait
:extended_options
do
options
do
options
do
{
{
image:
{
name:
'ruby:2.
1
'
,
entrypoint:
'/bin/sh'
},
image:
{
name:
'ruby:2.
7
'
,
entrypoint:
'/bin/sh'
},
services:
[
'postgres'
,
{
name:
'docker:stable-dind'
,
entrypoint:
'/bin/sh'
,
command:
'sleep 30'
,
alias:
'docker'
}],
services:
[
'postgres'
,
{
name:
'docker:stable-dind'
,
entrypoint:
'/bin/sh'
,
command:
'sleep 30'
,
alias:
'docker'
}],
script:
%w(echo)
,
script:
%w(echo)
,
after_script:
%w(ls date)
,
after_script:
%w(ls date)
,
...
...
spec/lib/gitlab/ci/build/image_spec.rb
View file @
e0057d51
...
@@ -9,7 +9,7 @@ describe Gitlab::Ci::Build::Image do
...
@@ -9,7 +9,7 @@ describe Gitlab::Ci::Build::Image do
subject
{
described_class
.
from_image
(
job
)
}
subject
{
described_class
.
from_image
(
job
)
}
context
'when image is defined in job'
do
context
'when image is defined in job'
do
let
(
:image_name
)
{
'ruby:2.
1
'
}
let
(
:image_name
)
{
'ruby:2.
7
'
}
let
(
:job
)
{
create
(
:ci_build
,
options:
{
image:
image_name
}
)
}
let
(
:job
)
{
create
(
:ci_build
,
options:
{
image:
image_name
}
)
}
context
'when image is defined as string'
do
context
'when image is defined as string'
do
...
...
spec/lib/gitlab/ci/config/entry/image_spec.rb
View file @
e0057d51
...
@@ -6,11 +6,11 @@ describe Gitlab::Ci::Config::Entry::Image do
...
@@ -6,11 +6,11 @@ describe Gitlab::Ci::Config::Entry::Image do
let
(
:entry
)
{
described_class
.
new
(
config
)
}
let
(
:entry
)
{
described_class
.
new
(
config
)
}
context
'when configuration is a string'
do
context
'when configuration is a string'
do
let
(
:config
)
{
'ruby:2.
2
'
}
let
(
:config
)
{
'ruby:2.
7
'
}
describe
'#value'
do
describe
'#value'
do
it
'returns image hash'
do
it
'returns image hash'
do
expect
(
entry
.
value
).
to
eq
({
name:
'ruby:2.
2
'
})
expect
(
entry
.
value
).
to
eq
({
name:
'ruby:2.
7
'
})
end
end
end
end
...
@@ -28,7 +28,7 @@ describe Gitlab::Ci::Config::Entry::Image do
...
@@ -28,7 +28,7 @@ describe Gitlab::Ci::Config::Entry::Image do
describe
'#image'
do
describe
'#image'
do
it
"returns image's name"
do
it
"returns image's name"
do
expect
(
entry
.
name
).
to
eq
'ruby:2.
2
'
expect
(
entry
.
name
).
to
eq
'ruby:2.
7
'
end
end
end
end
...
@@ -46,7 +46,7 @@ describe Gitlab::Ci::Config::Entry::Image do
...
@@ -46,7 +46,7 @@ describe Gitlab::Ci::Config::Entry::Image do
end
end
context
'when configuration is a hash'
do
context
'when configuration is a hash'
do
let
(
:config
)
{
{
name:
'ruby:2.
2
'
,
entrypoint:
%w(/bin/sh run)
}
}
let
(
:config
)
{
{
name:
'ruby:2.
7
'
,
entrypoint:
%w(/bin/sh run)
}
}
describe
'#value'
do
describe
'#value'
do
it
'returns image hash'
do
it
'returns image hash'
do
...
@@ -68,7 +68,7 @@ describe Gitlab::Ci::Config::Entry::Image do
...
@@ -68,7 +68,7 @@ describe Gitlab::Ci::Config::Entry::Image do
describe
'#image'
do
describe
'#image'
do
it
"returns image's name"
do
it
"returns image's name"
do
expect
(
entry
.
name
).
to
eq
'ruby:2.
2
'
expect
(
entry
.
name
).
to
eq
'ruby:2.
7
'
end
end
end
end
...
@@ -80,7 +80,7 @@ describe Gitlab::Ci::Config::Entry::Image do
...
@@ -80,7 +80,7 @@ describe Gitlab::Ci::Config::Entry::Image do
context
'when configuration has ports'
do
context
'when configuration has ports'
do
let
(
:ports
)
{
[{
number:
80
,
protocol:
'http'
,
name:
'foobar'
}]
}
let
(
:ports
)
{
[{
number:
80
,
protocol:
'http'
,
name:
'foobar'
}]
}
let
(
:config
)
{
{
name:
'ruby:2.
2
'
,
entrypoint:
%w(/bin/sh run)
,
ports:
ports
}
}
let
(
:config
)
{
{
name:
'ruby:2.
7
'
,
entrypoint:
%w(/bin/sh run)
,
ports:
ports
}
}
let
(
:entry
)
{
described_class
.
new
(
config
,
{
with_image_ports:
image_ports
})
}
let
(
:entry
)
{
described_class
.
new
(
config
,
{
with_image_ports:
image_ports
})
}
let
(
:image_ports
)
{
false
}
let
(
:image_ports
)
{
false
}
...
@@ -112,7 +112,7 @@ describe Gitlab::Ci::Config::Entry::Image do
...
@@ -112,7 +112,7 @@ describe Gitlab::Ci::Config::Entry::Image do
end
end
context
'when entry value is not correct'
do
context
'when entry value is not correct'
do
let
(
:config
)
{
[
'ruby:2.
2
'
]
}
let
(
:config
)
{
[
'ruby:2.
7
'
]
}
describe
'#errors'
do
describe
'#errors'
do
it
'saves errors'
do
it
'saves errors'
do
...
@@ -129,7 +129,7 @@ describe Gitlab::Ci::Config::Entry::Image do
...
@@ -129,7 +129,7 @@ describe Gitlab::Ci::Config::Entry::Image do
end
end
context
'when unexpected key is specified'
do
context
'when unexpected key is specified'
do
let
(
:config
)
{
{
name:
'ruby:2.
2
'
,
non_existing:
'test'
}
}
let
(
:config
)
{
{
name:
'ruby:2.
7
'
,
non_existing:
'test'
}
}
describe
'#errors'
do
describe
'#errors'
do
it
'saves errors'
do
it
'saves errors'
do
...
...
spec/lib/gitlab/ci/config/entry/root_spec.rb
View file @
e0057d51
...
@@ -29,7 +29,7 @@ describe Gitlab::Ci::Config::Entry::Root do
...
@@ -29,7 +29,7 @@ describe Gitlab::Ci::Config::Entry::Root do
let
(
:hash
)
do
let
(
:hash
)
do
{
{
before_script:
%w(ls pwd)
,
before_script:
%w(ls pwd)
,
image:
'ruby:2.
2
'
,
image:
'ruby:2.
7
'
,
default:
{},
default:
{},
services:
[
'postgres:9.1'
,
'mysql:5.5'
],
services:
[
'postgres:9.1'
,
'mysql:5.5'
],
variables:
{
VAR
:
'root'
},
variables:
{
VAR
:
'root'
},
...
@@ -124,7 +124,7 @@ describe Gitlab::Ci::Config::Entry::Root do
...
@@ -124,7 +124,7 @@ describe Gitlab::Ci::Config::Entry::Root do
{
name: :rspec
,
{
name: :rspec
,
script:
%w[rspec ls]
,
script:
%w[rspec ls]
,
before_script:
%w(ls pwd)
,
before_script:
%w(ls pwd)
,
image:
{
name:
'ruby:2.
2
'
},
image:
{
name:
'ruby:2.
7
'
},
services:
[{
name:
'postgres:9.1'
},
{
name:
'mysql:5.5'
}],
services:
[{
name:
'postgres:9.1'
},
{
name:
'mysql:5.5'
}],
stage:
'test'
,
stage:
'test'
,
cache:
{
key:
'k'
,
untracked:
true
,
paths:
[
'public/'
],
policy:
'pull-push'
},
cache:
{
key:
'k'
,
untracked:
true
,
paths:
[
'public/'
],
policy:
'pull-push'
},
...
@@ -138,7 +138,7 @@ describe Gitlab::Ci::Config::Entry::Root do
...
@@ -138,7 +138,7 @@ describe Gitlab::Ci::Config::Entry::Root do
{
name: :spinach
,
{
name: :spinach
,
before_script:
[],
before_script:
[],
script:
%w[spinach]
,
script:
%w[spinach]
,
image:
{
name:
'ruby:2.
2
'
},
image:
{
name:
'ruby:2.
7
'
},
services:
[{
name:
'postgres:9.1'
},
{
name:
'mysql:5.5'
}],
services:
[{
name:
'postgres:9.1'
},
{
name:
'mysql:5.5'
}],
stage:
'test'
,
stage:
'test'
,
cache:
{
key:
'k'
,
untracked:
true
,
paths:
[
'public/'
],
policy:
'pull-push'
},
cache:
{
key:
'k'
,
untracked:
true
,
paths:
[
'public/'
],
policy:
'pull-push'
},
...
@@ -154,7 +154,7 @@ describe Gitlab::Ci::Config::Entry::Root do
...
@@ -154,7 +154,7 @@ describe Gitlab::Ci::Config::Entry::Root do
before_script:
[],
before_script:
[],
script:
[
"make changelog | tee release_changelog.txt"
],
script:
[
"make changelog | tee release_changelog.txt"
],
release:
{
name:
"Release $CI_TAG_NAME"
,
tag_name:
'v0.06'
,
description:
"./release_changelog.txt"
},
release:
{
name:
"Release $CI_TAG_NAME"
,
tag_name:
'v0.06'
,
description:
"./release_changelog.txt"
},
image:
{
name:
"ruby:2.
2
"
},
image:
{
name:
"ruby:2.
7
"
},
services:
[{
name:
"postgres:9.1"
},
{
name:
"mysql:5.5"
}],
services:
[{
name:
"postgres:9.1"
},
{
name:
"mysql:5.5"
}],
cache:
{
key:
"k"
,
untracked:
true
,
paths:
[
"public/"
],
policy:
"pull-push"
},
cache:
{
key:
"k"
,
untracked:
true
,
paths:
[
"public/"
],
policy:
"pull-push"
},
only:
{
refs:
%w(branches tags)
},
only:
{
refs:
%w(branches tags)
},
...
@@ -173,7 +173,7 @@ describe Gitlab::Ci::Config::Entry::Root do
...
@@ -173,7 +173,7 @@ describe Gitlab::Ci::Config::Entry::Root do
{
before_script:
%w(ls pwd)
,
{
before_script:
%w(ls pwd)
,
after_script:
[
'make clean'
],
after_script:
[
'make clean'
],
default:
{
default:
{
image:
'ruby:2.
1
'
,
image:
'ruby:2.
7
'
,
services:
[
'postgres:9.1'
,
'mysql:5.5'
]
services:
[
'postgres:9.1'
,
'mysql:5.5'
]
},
},
variables:
{
VAR
:
'root'
},
variables:
{
VAR
:
'root'
},
...
@@ -200,7 +200,7 @@ describe Gitlab::Ci::Config::Entry::Root do
...
@@ -200,7 +200,7 @@ describe Gitlab::Ci::Config::Entry::Root do
rspec:
{
name: :rspec
,
rspec:
{
name: :rspec
,
script:
%w[rspec ls]
,
script:
%w[rspec ls]
,
before_script:
%w(ls pwd)
,
before_script:
%w(ls pwd)
,
image:
{
name:
'ruby:2.
1
'
},
image:
{
name:
'ruby:2.
7
'
},
services:
[{
name:
'postgres:9.1'
},
{
name:
'mysql:5.5'
}],
services:
[{
name:
'postgres:9.1'
},
{
name:
'mysql:5.5'
}],
stage:
'test'
,
stage:
'test'
,
cache:
{
key:
'k'
,
untracked:
true
,
paths:
[
'public/'
],
policy:
"pull-push"
},
cache:
{
key:
'k'
,
untracked:
true
,
paths:
[
'public/'
],
policy:
"pull-push"
},
...
@@ -212,7 +212,7 @@ describe Gitlab::Ci::Config::Entry::Root do
...
@@ -212,7 +212,7 @@ describe Gitlab::Ci::Config::Entry::Root do
spinach:
{
name: :spinach
,
spinach:
{
name: :spinach
,
before_script:
[],
before_script:
[],
script:
%w[spinach]
,
script:
%w[spinach]
,
image:
{
name:
'ruby:2.
1
'
},
image:
{
name:
'ruby:2.
7
'
},
services:
[{
name:
'postgres:9.1'
},
{
name:
'mysql:5.5'
}],
services:
[{
name:
'postgres:9.1'
},
{
name:
'mysql:5.5'
}],
stage:
'test'
,
stage:
'test'
,
cache:
{
key:
'k'
,
untracked:
true
,
paths:
[
'public/'
],
policy:
"pull-push"
},
cache:
{
key:
'k'
,
untracked:
true
,
paths:
[
'public/'
],
policy:
"pull-push"
},
...
...
spec/lib/gitlab/ci/config/external/file/project_spec.rb
View file @
e0057d51
...
@@ -71,7 +71,7 @@ describe Gitlab::Ci::Config::External::File::Project do
...
@@ -71,7 +71,7 @@ describe Gitlab::Ci::Config::External::File::Project do
let
(
:root_ref_sha
)
{
project
.
repository
.
root_ref_sha
}
let
(
:root_ref_sha
)
{
project
.
repository
.
root_ref_sha
}
before
do
before
do
stub_project_blob
(
root_ref_sha
,
'/file.yml'
)
{
'image: ruby:2.
1
'
}
stub_project_blob
(
root_ref_sha
,
'/file.yml'
)
{
'image: ruby:2.
7
'
}
end
end
it
'returns true'
do
it
'returns true'
do
...
@@ -96,7 +96,7 @@ describe Gitlab::Ci::Config::External::File::Project do
...
@@ -96,7 +96,7 @@ describe Gitlab::Ci::Config::External::File::Project do
let
(
:ref_sha
)
{
project
.
commit
(
'master'
).
sha
}
let
(
:ref_sha
)
{
project
.
commit
(
'master'
).
sha
}
before
do
before
do
stub_project_blob
(
ref_sha
,
'/file.yml'
)
{
'image: ruby:2.
1
'
}
stub_project_blob
(
ref_sha
,
'/file.yml'
)
{
'image: ruby:2.
7
'
}
end
end
it
'returns true'
do
it
'returns true'
do
...
...
spec/lib/gitlab/ci/config/external/mapper_spec.rb
View file @
e0057d51
...
@@ -15,7 +15,7 @@ describe Gitlab::Ci::Config::External::Mapper do
...
@@ -15,7 +15,7 @@ describe Gitlab::Ci::Config::External::Mapper do
let
(
:file_content
)
do
let
(
:file_content
)
do
<<~
HEREDOC
<<~
HEREDOC
image: 'ruby:2.
2
'
image: 'ruby:2.
7
'
HEREDOC
HEREDOC
end
end
...
@@ -34,7 +34,7 @@ describe Gitlab::Ci::Config::External::Mapper do
...
@@ -34,7 +34,7 @@ describe Gitlab::Ci::Config::External::Mapper do
context
'when the string is a local file'
do
context
'when the string is a local file'
do
let
(
:values
)
do
let
(
:values
)
do
{
include:
local_file
,
{
include:
local_file
,
image:
'ruby:2.
2
'
}
image:
'ruby:2.
7
'
}
end
end
it
'returns File instances'
do
it
'returns File instances'
do
...
@@ -46,7 +46,7 @@ describe Gitlab::Ci::Config::External::Mapper do
...
@@ -46,7 +46,7 @@ describe Gitlab::Ci::Config::External::Mapper do
context
'when the key is a local file hash'
do
context
'when the key is a local file hash'
do
let
(
:values
)
do
let
(
:values
)
do
{
include:
{
'local'
=>
local_file
},
{
include:
{
'local'
=>
local_file
},
image:
'ruby:2.
2
'
}
image:
'ruby:2.
7
'
}
end
end
it
'returns File instances'
do
it
'returns File instances'
do
...
@@ -57,7 +57,7 @@ describe Gitlab::Ci::Config::External::Mapper do
...
@@ -57,7 +57,7 @@ describe Gitlab::Ci::Config::External::Mapper do
context
'when the string is a remote file'
do
context
'when the string is a remote file'
do
let
(
:values
)
do
let
(
:values
)
do
{
include:
remote_url
,
image:
'ruby:2.
2
'
}
{
include:
remote_url
,
image:
'ruby:2.
7
'
}
end
end
it
'returns File instances'
do
it
'returns File instances'
do
...
@@ -69,7 +69,7 @@ describe Gitlab::Ci::Config::External::Mapper do
...
@@ -69,7 +69,7 @@ describe Gitlab::Ci::Config::External::Mapper do
context
'when the key is a remote file hash'
do
context
'when the key is a remote file hash'
do
let
(
:values
)
do
let
(
:values
)
do
{
include:
{
'remote'
=>
remote_url
},
{
include:
{
'remote'
=>
remote_url
},
image:
'ruby:2.
2
'
}
image:
'ruby:2.
7
'
}
end
end
it
'returns File instances'
do
it
'returns File instances'
do
...
@@ -81,7 +81,7 @@ describe Gitlab::Ci::Config::External::Mapper do
...
@@ -81,7 +81,7 @@ describe Gitlab::Ci::Config::External::Mapper do
context
'when the key is a template file hash'
do
context
'when the key is a template file hash'
do
let
(
:values
)
do
let
(
:values
)
do
{
include:
{
'template'
=>
template_file
},
{
include:
{
'template'
=>
template_file
},
image:
'ruby:2.
2
'
}
image:
'ruby:2.
7
'
}
end
end
it
'returns File instances'
do
it
'returns File instances'
do
...
@@ -93,7 +93,7 @@ describe Gitlab::Ci::Config::External::Mapper do
...
@@ -93,7 +93,7 @@ describe Gitlab::Ci::Config::External::Mapper do
context
'when the key is a hash of file and remote'
do
context
'when the key is a hash of file and remote'
do
let
(
:values
)
do
let
(
:values
)
do
{
include:
{
'local'
=>
local_file
,
'remote'
=>
remote_url
},
{
include:
{
'local'
=>
local_file
,
'remote'
=>
remote_url
},
image:
'ruby:2.
2
'
}
image:
'ruby:2.
7
'
}
end
end
it
'returns ambigious specification error'
do
it
'returns ambigious specification error'
do
...
@@ -105,7 +105,7 @@ describe Gitlab::Ci::Config::External::Mapper do
...
@@ -105,7 +105,7 @@ describe Gitlab::Ci::Config::External::Mapper do
context
"when 'include' is defined as an array"
do
context
"when 'include' is defined as an array"
do
let
(
:values
)
do
let
(
:values
)
do
{
include:
[
remote_url
,
local_file
],
{
include:
[
remote_url
,
local_file
],
image:
'ruby:2.
2
'
}
image:
'ruby:2.
7
'
}
end
end
it
'returns Files instances'
do
it
'returns Files instances'
do
...
@@ -117,7 +117,7 @@ describe Gitlab::Ci::Config::External::Mapper do
...
@@ -117,7 +117,7 @@ describe Gitlab::Ci::Config::External::Mapper do
context
"when 'include' is defined as an array of hashes"
do
context
"when 'include' is defined as an array of hashes"
do
let
(
:values
)
do
let
(
:values
)
do
{
include:
[{
remote:
remote_url
},
{
local:
local_file
}],
{
include:
[{
remote:
remote_url
},
{
local:
local_file
}],
image:
'ruby:2.
2
'
}
image:
'ruby:2.
7
'
}
end
end
it
'returns Files instances'
do
it
'returns Files instances'
do
...
@@ -128,7 +128,7 @@ describe Gitlab::Ci::Config::External::Mapper do
...
@@ -128,7 +128,7 @@ describe Gitlab::Ci::Config::External::Mapper do
context
'when it has ambigious match'
do
context
'when it has ambigious match'
do
let
(
:values
)
do
let
(
:values
)
do
{
include:
[{
remote:
remote_url
,
local:
local_file
}],
{
include:
[{
remote:
remote_url
,
local:
local_file
}],
image:
'ruby:2.
2
'
}
image:
'ruby:2.
7
'
}
end
end
it
'returns ambigious specification error'
do
it
'returns ambigious specification error'
do
...
@@ -140,7 +140,7 @@ describe Gitlab::Ci::Config::External::Mapper do
...
@@ -140,7 +140,7 @@ describe Gitlab::Ci::Config::External::Mapper do
context
"when 'include' is not defined"
do
context
"when 'include' is not defined"
do
let
(
:values
)
do
let
(
:values
)
do
{
{
image:
'ruby:2.
2
'
image:
'ruby:2.
7
'
}
}
end
end
...
@@ -155,7 +155,7 @@ describe Gitlab::Ci::Config::External::Mapper do
...
@@ -155,7 +155,7 @@ describe Gitlab::Ci::Config::External::Mapper do
{
'local'
=>
local_file
},
{
'local'
=>
local_file
},
{
'local'
=>
local_file
}
{
'local'
=>
local_file
}
],
],
image:
'ruby:2.
2
'
}
image:
'ruby:2.
7
'
}
end
end
it
'raises an exception'
do
it
'raises an exception'
do
...
@@ -169,7 +169,7 @@ describe Gitlab::Ci::Config::External::Mapper do
...
@@ -169,7 +169,7 @@ describe Gitlab::Ci::Config::External::Mapper do
{
'local'
=>
local_file
},
{
'local'
=>
local_file
},
{
'remote'
=>
remote_url
}
{
'remote'
=>
remote_url
}
],
],
image:
'ruby:2.
2
'
}
image:
'ruby:2.
7
'
}
end
end
before
do
before
do
...
...
spec/lib/gitlab/ci/config/external/processor_spec.rb
View file @
e0057d51
...
@@ -24,7 +24,7 @@ describe Gitlab::Ci::Config::External::Processor do
...
@@ -24,7 +24,7 @@ describe Gitlab::Ci::Config::External::Processor do
subject
{
processor
.
perform
}
subject
{
processor
.
perform
}
context
'when no external files defined'
do
context
'when no external files defined'
do
let
(
:values
)
{
{
image:
'ruby:2.
2
'
}
}
let
(
:values
)
{
{
image:
'ruby:2.
7
'
}
}
it
'returns the same values'
do
it
'returns the same values'
do
expect
(
processor
.
perform
).
to
eq
(
values
)
expect
(
processor
.
perform
).
to
eq
(
values
)
...
@@ -32,7 +32,7 @@ describe Gitlab::Ci::Config::External::Processor do
...
@@ -32,7 +32,7 @@ describe Gitlab::Ci::Config::External::Processor do
end
end
context
'when an invalid local file is defined'
do
context
'when an invalid local file is defined'
do
let
(
:values
)
{
{
include:
'/lib/gitlab/ci/templates/non-existent-file.yml'
,
image:
'ruby:2.
2
'
}
}
let
(
:values
)
{
{
include:
'/lib/gitlab/ci/templates/non-existent-file.yml'
,
image:
'ruby:2.
7
'
}
}
it
'raises an error'
do
it
'raises an error'
do
expect
{
processor
.
perform
}.
to
raise_error
(
expect
{
processor
.
perform
}.
to
raise_error
(
...
@@ -44,7 +44,7 @@ describe Gitlab::Ci::Config::External::Processor do
...
@@ -44,7 +44,7 @@ describe Gitlab::Ci::Config::External::Processor do
context
'when an invalid remote file is defined'
do
context
'when an invalid remote file is defined'
do
let
(
:remote_file
)
{
'http://doesntexist.com/.gitlab-ci-1.yml'
}
let
(
:remote_file
)
{
'http://doesntexist.com/.gitlab-ci-1.yml'
}
let
(
:values
)
{
{
include:
remote_file
,
image:
'ruby:2.
2
'
}
}
let
(
:values
)
{
{
include:
remote_file
,
image:
'ruby:2.
7
'
}
}
before
do
before
do
stub_full_request
(
remote_file
).
and_raise
(
SocketError
.
new
(
'Some HTTP error'
))
stub_full_request
(
remote_file
).
and_raise
(
SocketError
.
new
(
'Some HTTP error'
))
...
@@ -60,7 +60,7 @@ describe Gitlab::Ci::Config::External::Processor do
...
@@ -60,7 +60,7 @@ describe Gitlab::Ci::Config::External::Processor do
context
'with a valid remote external file is defined'
do
context
'with a valid remote external file is defined'
do
let
(
:remote_file
)
{
'https://gitlab.com/gitlab-org/gitlab-foss/blob/1234/.gitlab-ci-1.yml'
}
let
(
:remote_file
)
{
'https://gitlab.com/gitlab-org/gitlab-foss/blob/1234/.gitlab-ci-1.yml'
}
let
(
:values
)
{
{
include:
remote_file
,
image:
'ruby:2.
2
'
}
}
let
(
:values
)
{
{
include:
remote_file
,
image:
'ruby:2.
7
'
}
}
let
(
:external_file_content
)
do
let
(
:external_file_content
)
do
<<-
HEREDOC
<<-
HEREDOC
before_script:
before_script:
...
@@ -94,7 +94,7 @@ describe Gitlab::Ci::Config::External::Processor do
...
@@ -94,7 +94,7 @@ describe Gitlab::Ci::Config::External::Processor do
end
end
context
'with a valid local external file is defined'
do
context
'with a valid local external file is defined'
do
let
(
:values
)
{
{
include:
'/lib/gitlab/ci/templates/template.yml'
,
image:
'ruby:2.
2
'
}
}
let
(
:values
)
{
{
include:
'/lib/gitlab/ci/templates/template.yml'
,
image:
'ruby:2.
7
'
}
}
let
(
:local_file_content
)
do
let
(
:local_file_content
)
do
<<-
HEREDOC
<<-
HEREDOC
before_script:
before_script:
...
@@ -131,7 +131,7 @@ describe Gitlab::Ci::Config::External::Processor do
...
@@ -131,7 +131,7 @@ describe Gitlab::Ci::Config::External::Processor do
let
(
:values
)
do
let
(
:values
)
do
{
{
include:
external_files
,
include:
external_files
,
image:
'ruby:2.
2
'
image:
'ruby:2.
7
'
}
}
end
end
...
@@ -163,7 +163,7 @@ describe Gitlab::Ci::Config::External::Processor do
...
@@ -163,7 +163,7 @@ describe Gitlab::Ci::Config::External::Processor do
end
end
context
'when external files are defined but not valid'
do
context
'when external files are defined but not valid'
do
let
(
:values
)
{
{
include:
'/lib/gitlab/ci/templates/template.yml'
,
image:
'ruby:2.
2
'
}
}
let
(
:values
)
{
{
include:
'/lib/gitlab/ci/templates/template.yml'
,
image:
'ruby:2.
7
'
}
}
let
(
:local_file_content
)
{
'invalid content file ////'
}
let
(
:local_file_content
)
{
'invalid content file ////'
}
...
@@ -185,7 +185,7 @@ describe Gitlab::Ci::Config::External::Processor do
...
@@ -185,7 +185,7 @@ describe Gitlab::Ci::Config::External::Processor do
let
(
:values
)
do
let
(
:values
)
do
{
{
include:
remote_file
,
include:
remote_file
,
image:
'ruby:2.
2
'
image:
'ruby:2.
7
'
}
}
end
end
...
@@ -198,7 +198,7 @@ describe Gitlab::Ci::Config::External::Processor do
...
@@ -198,7 +198,7 @@ describe Gitlab::Ci::Config::External::Processor do
it
'takes precedence'
do
it
'takes precedence'
do
stub_full_request
(
remote_file
).
to_return
(
body:
remote_file_content
)
stub_full_request
(
remote_file
).
to_return
(
body:
remote_file_content
)
expect
(
processor
.
perform
[
:image
]).
to
eq
(
'ruby:2.
2
'
)
expect
(
processor
.
perform
[
:image
]).
to
eq
(
'ruby:2.
7
'
)
end
end
end
end
...
@@ -208,7 +208,7 @@ describe Gitlab::Ci::Config::External::Processor do
...
@@ -208,7 +208,7 @@ describe Gitlab::Ci::Config::External::Processor do
include:
[
include:
[
{
local:
'/local/file.yml'
}
{
local:
'/local/file.yml'
}
],
],
image:
'ruby:2.
2
'
image:
'ruby:2.
7
'
}
}
end
end
...
...
spec/lib/gitlab/ci/config_spec.rb
View file @
e0057d51
...
@@ -20,7 +20,7 @@ describe Gitlab::Ci::Config do
...
@@ -20,7 +20,7 @@ describe Gitlab::Ci::Config do
context
'when config is valid'
do
context
'when config is valid'
do
let
(
:yml
)
do
let
(
:yml
)
do
<<-
EOS
<<-
EOS
image: ruby:2.
2
image: ruby:2.
7
rspec:
rspec:
script:
script:
...
@@ -32,7 +32,7 @@ describe Gitlab::Ci::Config do
...
@@ -32,7 +32,7 @@ describe Gitlab::Ci::Config do
describe
'#to_hash'
do
describe
'#to_hash'
do
it
'returns hash created from string'
do
it
'returns hash created from string'
do
hash
=
{
hash
=
{
image:
'ruby:2.
2
'
,
image:
'ruby:2.
7
'
,
rspec:
{
rspec:
{
script:
[
'gem install rspec'
,
script:
[
'gem install rspec'
,
'rspec'
]
'rspec'
]
...
@@ -105,7 +105,7 @@ describe Gitlab::Ci::Config do
...
@@ -105,7 +105,7 @@ describe Gitlab::Ci::Config do
context
'when using extendable hash'
do
context
'when using extendable hash'
do
let
(
:yml
)
do
let
(
:yml
)
do
<<-
EOS
<<-
EOS
image: ruby:2.
2
image: ruby:2.
7
rspec:
rspec:
script: rspec
script: rspec
...
@@ -118,7 +118,7 @@ describe Gitlab::Ci::Config do
...
@@ -118,7 +118,7 @@ describe Gitlab::Ci::Config do
it
'correctly extends the hash'
do
it
'correctly extends the hash'
do
hash
=
{
hash
=
{
image:
'ruby:2.
2
'
,
image:
'ruby:2.
7
'
,
rspec:
{
script:
'rspec'
},
rspec:
{
script:
'rspec'
},
test:
{
test:
{
extends:
'rspec'
,
extends:
'rspec'
,
...
@@ -208,7 +208,7 @@ describe Gitlab::Ci::Config do
...
@@ -208,7 +208,7 @@ describe Gitlab::Ci::Config do
let
(
:yml
)
do
let
(
:yml
)
do
<<-
EOS
<<-
EOS
image:
image:
name: ruby:2.
2
name: ruby:2.
7
ports:
ports:
- 80
- 80
EOS
EOS
...
@@ -222,12 +222,12 @@ describe Gitlab::Ci::Config do
...
@@ -222,12 +222,12 @@ describe Gitlab::Ci::Config do
context
'in the job image'
do
context
'in the job image'
do
let
(
:yml
)
do
let
(
:yml
)
do
<<-
EOS
<<-
EOS
image: ruby:2.
2
image: ruby:2.
7
test:
test:
script: rspec
script: rspec
image:
image:
name: ruby:2.
2
name: ruby:2.
7
ports:
ports:
- 80
- 80
EOS
EOS
...
@@ -241,11 +241,11 @@ describe Gitlab::Ci::Config do
...
@@ -241,11 +241,11 @@ describe Gitlab::Ci::Config do
context
'in the services'
do
context
'in the services'
do
let
(
:yml
)
do
let
(
:yml
)
do
<<-
EOS
<<-
EOS
image: ruby:2.
2
image: ruby:2.
7
test:
test:
script: rspec
script: rspec
image: ruby:2.
2
image: ruby:2.
7
services:
services:
- name: test
- name: test
alias: test
alias: test
...
@@ -286,7 +286,7 @@ describe Gitlab::Ci::Config do
...
@@ -286,7 +286,7 @@ describe Gitlab::Ci::Config do
-
#{
local_location
}
-
#{
local_location
}
-
#{
remote_location
}
-
#{
remote_location
}
image: ruby:2.
2
image: ruby:2.
7
HEREDOC
HEREDOC
end
end
...
@@ -316,7 +316,7 @@ describe Gitlab::Ci::Config do
...
@@ -316,7 +316,7 @@ describe Gitlab::Ci::Config do
}
}
composed_hash
=
{
composed_hash
=
{
before_script:
before_script_values
,
before_script:
before_script_values
,
image:
"ruby:2.
2
"
,
image:
"ruby:2.
7
"
,
rspec:
{
script:
[
"bundle exec rspec"
]
},
rspec:
{
script:
[
"bundle exec rspec"
]
},
variables:
variables
variables:
variables
}
}
...
@@ -401,7 +401,7 @@ describe Gitlab::Ci::Config do
...
@@ -401,7 +401,7 @@ describe Gitlab::Ci::Config do
include:
include:
-
#{
remote_location
}
-
#{
remote_location
}
image: ruby:2.
2
image: ruby:2.
7
HEREDOC
HEREDOC
end
end
...
@@ -412,7 +412,7 @@ describe Gitlab::Ci::Config do
...
@@ -412,7 +412,7 @@ describe Gitlab::Ci::Config do
end
end
it
'takes precedence'
do
it
'takes precedence'
do
expect
(
config
.
to_hash
).
to
eq
({
image:
'ruby:2.
2
'
})
expect
(
config
.
to_hash
).
to
eq
({
image:
'ruby:2.
7
'
})
end
end
end
end
...
...
spec/lib/gitlab/ci/yaml_processor_spec.rb
View file @
e0057d51
...
@@ -665,7 +665,7 @@ module Gitlab
...
@@ -665,7 +665,7 @@ module Gitlab
describe
"Image and service handling"
do
describe
"Image and service handling"
do
context
"when extended docker configuration is used"
do
context
"when extended docker configuration is used"
do
it
"returns image and service when defined"
do
it
"returns image and service when defined"
do
config
=
YAML
.
dump
({
image:
{
name:
"ruby:2.
1
"
,
entrypoint:
[
"/usr/local/bin/init"
,
"run"
]
},
config
=
YAML
.
dump
({
image:
{
name:
"ruby:2.
7
"
,
entrypoint:
[
"/usr/local/bin/init"
,
"run"
]
},
services:
[
"mysql"
,
{
name:
"docker:dind"
,
alias:
"docker"
,
services:
[
"mysql"
,
{
name:
"docker:dind"
,
alias:
"docker"
,
entrypoint:
[
"/usr/local/bin/init"
,
"run"
],
entrypoint:
[
"/usr/local/bin/init"
,
"run"
],
command:
[
"/usr/local/bin/init"
,
"run"
]
}],
command:
[
"/usr/local/bin/init"
,
"run"
]
}],
...
@@ -683,7 +683,7 @@ module Gitlab
...
@@ -683,7 +683,7 @@ module Gitlab
options:
{
options:
{
before_script:
[
"pwd"
],
before_script:
[
"pwd"
],
script:
[
"rspec"
],
script:
[
"rspec"
],
image:
{
name:
"ruby:2.
1
"
,
entrypoint:
[
"/usr/local/bin/init"
,
"run"
]
},
image:
{
name:
"ruby:2.
7
"
,
entrypoint:
[
"/usr/local/bin/init"
,
"run"
]
},
services:
[{
name:
"mysql"
},
services:
[{
name:
"mysql"
},
{
name:
"docker:dind"
,
alias:
"docker"
,
entrypoint:
[
"/usr/local/bin/init"
,
"run"
],
{
name:
"docker:dind"
,
alias:
"docker"
,
entrypoint:
[
"/usr/local/bin/init"
,
"run"
],
command:
[
"/usr/local/bin/init"
,
"run"
]
}]
command:
[
"/usr/local/bin/init"
,
"run"
]
}]
...
@@ -696,7 +696,7 @@ module Gitlab
...
@@ -696,7 +696,7 @@ module Gitlab
end
end
it
"returns image and service when overridden for job"
do
it
"returns image and service when overridden for job"
do
config
=
YAML
.
dump
({
image:
"ruby:2.
1
"
,
config
=
YAML
.
dump
({
image:
"ruby:2.
7
"
,
services:
[
"mysql"
],
services:
[
"mysql"
],
before_script:
[
"pwd"
],
before_script:
[
"pwd"
],
rspec:
{
image:
{
name:
"ruby:2.5"
,
entrypoint:
[
"/usr/local/bin/init"
,
"run"
]
},
rspec:
{
image:
{
name:
"ruby:2.5"
,
entrypoint:
[
"/usr/local/bin/init"
,
"run"
]
},
...
@@ -731,7 +731,7 @@ module Gitlab
...
@@ -731,7 +731,7 @@ module Gitlab
context
"when etended docker configuration is not used"
do
context
"when etended docker configuration is not used"
do
it
"returns image and service when defined"
do
it
"returns image and service when defined"
do
config
=
YAML
.
dump
({
image:
"ruby:2.
1
"
,
config
=
YAML
.
dump
({
image:
"ruby:2.
7
"
,
services:
[
"mysql"
,
"docker:dind"
],
services:
[
"mysql"
,
"docker:dind"
],
before_script:
[
"pwd"
],
before_script:
[
"pwd"
],
rspec:
{
script:
"rspec"
}
})
rspec:
{
script:
"rspec"
}
})
...
@@ -747,7 +747,7 @@ module Gitlab
...
@@ -747,7 +747,7 @@ module Gitlab
options:
{
options:
{
before_script:
[
"pwd"
],
before_script:
[
"pwd"
],
script:
[
"rspec"
],
script:
[
"rspec"
],
image:
{
name:
"ruby:2.
1
"
},
image:
{
name:
"ruby:2.
7
"
},
services:
[{
name:
"mysql"
},
{
name:
"docker:dind"
}]
services:
[{
name:
"mysql"
},
{
name:
"docker:dind"
}]
},
},
allow_failure:
false
,
allow_failure:
false
,
...
@@ -758,7 +758,7 @@ module Gitlab
...
@@ -758,7 +758,7 @@ module Gitlab
end
end
it
"returns image and service when overridden for job"
do
it
"returns image and service when overridden for job"
do
config
=
YAML
.
dump
({
image:
"ruby:2.
1
"
,
config
=
YAML
.
dump
({
image:
"ruby:2.
7
"
,
services:
[
"mysql"
],
services:
[
"mysql"
],
before_script:
[
"pwd"
],
before_script:
[
"pwd"
],
rspec:
{
image:
"ruby:2.5"
,
services:
[
"postgresql"
,
"docker:dind"
],
script:
"rspec"
}
})
rspec:
{
image:
"ruby:2.5"
,
services:
[
"postgresql"
,
"docker:dind"
],
script:
"rspec"
}
})
...
@@ -1292,7 +1292,7 @@ module Gitlab
...
@@ -1292,7 +1292,7 @@ module Gitlab
describe
"Artifacts"
do
describe
"Artifacts"
do
it
"returns artifacts when defined"
do
it
"returns artifacts when defined"
do
config
=
YAML
.
dump
({
config
=
YAML
.
dump
({
image:
"ruby:2.
1
"
,
image:
"ruby:2.
7
"
,
services:
[
"mysql"
],
services:
[
"mysql"
],
before_script:
[
"pwd"
],
before_script:
[
"pwd"
],
rspec:
{
rspec:
{
...
@@ -1318,7 +1318,7 @@ module Gitlab
...
@@ -1318,7 +1318,7 @@ module Gitlab
options:
{
options:
{
before_script:
[
"pwd"
],
before_script:
[
"pwd"
],
script:
[
"rspec"
],
script:
[
"rspec"
],
image:
{
name:
"ruby:2.
1
"
},
image:
{
name:
"ruby:2.
7
"
},
services:
[{
name:
"mysql"
}],
services:
[{
name:
"mysql"
}],
artifacts:
{
artifacts:
{
name:
"custom_name"
,
name:
"custom_name"
,
...
@@ -1945,7 +1945,7 @@ module Gitlab
...
@@ -1945,7 +1945,7 @@ module Gitlab
context
'when hidden job have a script definition'
do
context
'when hidden job have a script definition'
do
let
(
:config
)
do
let
(
:config
)
do
YAML
.
dump
({
YAML
.
dump
({
'.hidden_job'
=>
{
image:
'ruby:2.
1
'
,
script:
'test'
},
'.hidden_job'
=>
{
image:
'ruby:2.
7
'
,
script:
'test'
},
'normal_job'
=>
{
script:
'test'
}
'normal_job'
=>
{
script:
'test'
}
})
})
end
end
...
@@ -1956,7 +1956,7 @@ module Gitlab
...
@@ -1956,7 +1956,7 @@ module Gitlab
context
"when hidden job doesn't have a script definition"
do
context
"when hidden job doesn't have a script definition"
do
let
(
:config
)
do
let
(
:config
)
do
YAML
.
dump
({
YAML
.
dump
({
'.hidden_job'
=>
{
image:
'ruby:2.
1
'
},
'.hidden_job'
=>
{
image:
'ruby:2.
7
'
},
'normal_job'
=>
{
script:
'test'
}
'normal_job'
=>
{
script:
'test'
}
})
})
end
end
...
...
spec/lib/gitlab/config/loader/yaml_spec.rb
View file @
e0057d51
...
@@ -6,7 +6,7 @@ describe Gitlab::Config::Loader::Yaml do
...
@@ -6,7 +6,7 @@ describe Gitlab::Config::Loader::Yaml do
let
(
:loader
)
{
described_class
.
new
(
yml
)
}
let
(
:loader
)
{
described_class
.
new
(
yml
)
}
context
'when yaml syntax is correct'
do
context
'when yaml syntax is correct'
do
let
(
:yml
)
{
'image: ruby:2.
2
'
}
let
(
:yml
)
{
'image: ruby:2.
7
'
}
describe
'#valid?'
do
describe
'#valid?'
do
it
'returns true'
do
it
'returns true'
do
...
@@ -16,7 +16,7 @@ describe Gitlab::Config::Loader::Yaml do
...
@@ -16,7 +16,7 @@ describe Gitlab::Config::Loader::Yaml do
describe
'#load!'
do
describe
'#load!'
do
it
'returns a valid hash'
do
it
'returns a valid hash'
do
expect
(
loader
.
load!
).
to
eq
(
image:
'ruby:2.
2
'
)
expect
(
loader
.
load!
).
to
eq
(
image:
'ruby:2.
7
'
)
end
end
end
end
end
end
...
...
spec/models/ci/build_spec.rb
View file @
e0057d51
...
@@ -2023,7 +2023,7 @@ describe Ci::Build do
...
@@ -2023,7 +2023,7 @@ describe Ci::Build do
describe
'#options'
do
describe
'#options'
do
let
(
:options
)
do
let
(
:options
)
do
{
{
image:
"ruby:2.
1
"
,
image:
"ruby:2.
7
"
,
services:
[
"postgres"
],
services:
[
"postgres"
],
script:
[
"ls -a"
]
script:
[
"ls -a"
]
}
}
...
@@ -2034,11 +2034,11 @@ describe Ci::Build do
...
@@ -2034,11 +2034,11 @@ describe Ci::Build do
end
end
it
'allows to access with keys'
do
it
'allows to access with keys'
do
expect
(
build
.
options
[
:image
]).
to
eq
(
'ruby:2.
1
'
)
expect
(
build
.
options
[
:image
]).
to
eq
(
'ruby:2.
7
'
)
end
end
it
'allows to access with strings'
do
it
'allows to access with strings'
do
expect
(
build
.
options
[
'image'
]).
to
eq
(
'ruby:2.
1
'
)
expect
(
build
.
options
[
'image'
]).
to
eq
(
'ruby:2.
7
'
)
end
end
context
'when ci_build_metadata_config is set'
do
context
'when ci_build_metadata_config is set'
do
...
...
spec/requests/api/lint_spec.rb
View file @
e0057d51
...
@@ -29,7 +29,7 @@ describe API::Lint do
...
@@ -29,7 +29,7 @@ describe API::Lint do
end
end
it
"responds with errors about invalid configuration"
do
it
"responds with errors about invalid configuration"
do
post
api
(
'/ci/lint'
),
params:
{
content:
'{ image: "ruby:2.
1
", services: ["postgres"] }'
}
post
api
(
'/ci/lint'
),
params:
{
content:
'{ image: "ruby:2.
7
", services: ["postgres"] }'
}
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
expect
(
json_response
[
'status'
]).
to
eq
(
'invalid'
)
expect
(
json_response
[
'status'
]).
to
eq
(
'invalid'
)
...
...
spec/requests/api/runner_spec.rb
View file @
e0057d51
...
@@ -523,7 +523,7 @@ describe API::Runner, :clean_gitlab_redis_shared_state do
...
@@ -523,7 +523,7 @@ describe API::Runner, :clean_gitlab_redis_shared_state do
expect
(
json_response
[
'token'
]).
to
eq
(
job
.
token
)
expect
(
json_response
[
'token'
]).
to
eq
(
job
.
token
)
expect
(
json_response
[
'job_info'
]).
to
eq
(
expected_job_info
)
expect
(
json_response
[
'job_info'
]).
to
eq
(
expected_job_info
)
expect
(
json_response
[
'git_info'
]).
to
eq
(
expected_git_info
)
expect
(
json_response
[
'git_info'
]).
to
eq
(
expected_git_info
)
expect
(
json_response
[
'image'
]).
to
eq
({
'name'
=>
'ruby:2.
1
'
,
'entrypoint'
=>
'/bin/sh'
,
'ports'
=>
[]
})
expect
(
json_response
[
'image'
]).
to
eq
({
'name'
=>
'ruby:2.
7
'
,
'entrypoint'
=>
'/bin/sh'
,
'ports'
=>
[]
})
expect
(
json_response
[
'services'
]).
to
eq
([{
'name'
=>
'postgres'
,
'entrypoint'
=>
nil
,
expect
(
json_response
[
'services'
]).
to
eq
([{
'name'
=>
'postgres'
,
'entrypoint'
=>
nil
,
'alias'
=>
nil
,
'command'
=>
nil
,
'ports'
=>
[]
},
'alias'
=>
nil
,
'command'
=>
nil
,
'ports'
=>
[]
},
{
'name'
=>
'docker:stable-dind'
,
'entrypoint'
=>
'/bin/sh'
,
{
'name'
=>
'docker:stable-dind'
,
'entrypoint'
=>
'/bin/sh'
,
...
...
spec/services/ci/create_pipeline_service_spec.rb
View file @
e0057d51
...
@@ -555,7 +555,7 @@ describe Ci::CreatePipelineService do
...
@@ -555,7 +555,7 @@ describe Ci::CreatePipelineService do
let
(
:ci_yaml
)
do
let
(
:ci_yaml
)
do
<<-
EOS
<<-
EOS
image:
image:
name: ruby:2.
2
name: ruby:2.
7
ports:
ports:
- 80
- 80
EOS
EOS
...
@@ -567,12 +567,12 @@ describe Ci::CreatePipelineService do
...
@@ -567,12 +567,12 @@ describe Ci::CreatePipelineService do
context
'in the job image'
do
context
'in the job image'
do
let
(
:ci_yaml
)
do
let
(
:ci_yaml
)
do
<<-
EOS
<<-
EOS
image: ruby:2.
2
image: ruby:2.
7
test:
test:
script: rspec
script: rspec
image:
image:
name: ruby:2.
2
name: ruby:2.
7
ports:
ports:
- 80
- 80
EOS
EOS
...
@@ -584,11 +584,11 @@ describe Ci::CreatePipelineService do
...
@@ -584,11 +584,11 @@ describe Ci::CreatePipelineService do
context
'in the service'
do
context
'in the service'
do
let
(
:ci_yaml
)
do
let
(
:ci_yaml
)
do
<<-
EOS
<<-
EOS
image: ruby:2.
2
image: ruby:2.
7
test:
test:
script: rspec
script: rspec
image: ruby:2.
2
image: ruby:2.
7
services:
services:
- name: test
- name: test
ports:
ports:
...
...
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