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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
77715e47
Commit
77715e47
authored
Nov 01, 2018
by
Matija Čupić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Normalizer specs
parent
56a08d23
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
0 deletions
+36
-0
spec/lib/gitlab/ci/config/normalizer_spec.rb
spec/lib/gitlab/ci/config/normalizer_spec.rb
+36
-0
No files found.
spec/lib/gitlab/ci/config/normalizer_spec.rb
0 → 100644
View file @
77715e47
require
'fast_spec_helper'
describe
Gitlab
::
Ci
::
Config
::
Normalizer
do
let
(
:job_name
)
{
:rspec
}
let
(
:job_config
)
{
{
script:
'rspec'
,
parallel:
5
}
}
let
(
:config
)
{
{
job_name
=>
job_config
}
}
describe
'.normalize_jobs'
do
subject
{
described_class
.
normalize_jobs
(
config
)
}
it
'does not have original job'
do
is_expected
.
not_to
include
(
job_name
)
end
it
'has parallelized jobs'
do
job_names
=
described_class
.
send
(
:parallelize_job_names
,
job_name
,
5
).
map
(
&
:to_sym
)
is_expected
.
to
include
(
*
job_names
)
end
it
'parallelizes jobs with original config'
do
original_config
=
config
[
job_name
].
except
(
:name
)
configs
=
subject
.
values
.
map
{
|
config
|
config
.
except
(
:name
)
}
expect
(
configs
).
to
all
(
eq
(
original_config
))
end
end
describe
'.parallelize_job_names'
do
subject
{
described_class
.
send
(
:parallelize_job_names
,
job_name
,
5
)
}
it
'returns parallelized names'
do
is_expected
.
to
all
(
match
(
%r{
#{
job_name
}
\d
+/
\d
+}
))
end
end
end
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