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
c456c179
Commit
c456c179
authored
Oct 05, 2019
by
Matija Čupić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add E2E CI config bridge need specs
parent
7316400f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
75 additions
and
1 deletion
+75
-1
spec/lib/gitlab/ci/yaml_processor_spec.rb
spec/lib/gitlab/ci/yaml_processor_spec.rb
+75
-1
No files found.
spec/lib/gitlab/ci/yaml_processor_spec.rb
View file @
c456c179
...
...
@@ -1253,7 +1253,7 @@ module Gitlab
end
end
describe
"Needs"
do
describe
"
Job
Needs"
do
let
(
:needs
)
{
}
let
(
:dependencies
)
{
}
...
...
@@ -1325,6 +1325,80 @@ module Gitlab
end
end
describe
'Bridge Needs'
do
let
(
:config
)
do
{
build:
{
stage:
'build'
,
script:
'test'
},
bridge:
{
stage:
'test'
,
needs:
needs
}
}
end
subject
{
Gitlab
::
Ci
::
YamlProcessor
.
new
(
YAML
.
dump
(
config
))
}
context
'needs upstream pipeline'
do
let
(
:needs
)
{
{
pipeline:
'some/project'
}
}
it
'creates jobs with valid specification'
do
expect
(
subject
.
builds
.
size
).
to
eq
(
2
)
expect
(
subject
.
builds
[
0
]).
to
eq
(
stage:
"build"
,
stage_idx:
0
,
name:
"build"
,
options:
{
script:
[
"test"
]
},
when:
"on_success"
,
allow_failure:
false
,
yaml_variables:
[]
)
expect
(
subject
.
builds
[
1
]).
to
eq
(
stage:
"test"
,
stage_idx:
1
,
name:
"bridge"
,
options:
{
bridge_needs:
{
pipeline:
'some/project'
}
},
when:
"on_success"
,
allow_failure:
false
,
yaml_variables:
[]
)
end
end
context
'needs both job and pipeline'
do
let
(
:needs
)
{
[
'build'
,
{
pipeline:
'some/project'
}]
}
it
'creates jobs with valid specification'
do
expect
(
subject
.
builds
.
size
).
to
eq
(
2
)
expect
(
subject
.
builds
[
0
]).
to
eq
(
stage:
"build"
,
stage_idx:
0
,
name:
"build"
,
options:
{
script:
[
"test"
]
},
when:
"on_success"
,
allow_failure:
false
,
yaml_variables:
[]
)
expect
(
subject
.
builds
[
1
]).
to
eq
(
stage:
"test"
,
stage_idx:
1
,
name:
"bridge"
,
options:
{
bridge_needs:
{
pipeline:
'some/project'
}
},
needs_attributes:
[
{
name:
"build"
}
],
when:
"on_success"
,
allow_failure:
false
,
yaml_variables:
[]
)
end
end
end
context
'with when/rules conflict'
do
subject
{
Gitlab
::
Ci
::
YamlProcessor
.
new
(
YAML
.
dump
(
config
))
}
...
...
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