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
2ab77fa2
Commit
2ab77fa2
authored
Oct 28, 2019
by
Matija Čupić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move Bridge Needs integration tests to ee/spec
parent
c1b8f3a2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
79 additions
and
74 deletions
+79
-74
ee/spec/lib/gitlab/ci/yaml_processor_spec.rb
ee/spec/lib/gitlab/ci/yaml_processor_spec.rb
+79
-0
spec/lib/gitlab/ci/yaml_processor_spec.rb
spec/lib/gitlab/ci/yaml_processor_spec.rb
+0
-74
No files found.
ee/spec/lib/gitlab/ci/yaml_processor_spec.rb
0 → 100644
View file @
2ab77fa2
# frozen_string_literal: true
require
'spec_helper'
describe
Gitlab
::
Ci
::
YamlProcessor
do
describe
'Bridge Needs'
do
let
(
:config
)
do
{
build:
{
stage:
'build'
,
script:
'test'
},
bridge:
{
stage:
'test'
,
needs:
needs
}
}
end
subject
{
described_class
.
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:
1
,
name:
"build"
,
options:
{
script:
[
"test"
]
},
when:
"on_success"
,
allow_failure:
false
,
yaml_variables:
[]
)
expect
(
subject
.
builds
[
1
]).
to
eq
(
stage:
"test"
,
stage_idx:
2
,
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:
1
,
name:
"build"
,
options:
{
script:
[
"test"
]
},
when:
"on_success"
,
allow_failure:
false
,
yaml_variables:
[]
)
expect
(
subject
.
builds
[
1
]).
to
eq
(
stage:
"test"
,
stage_idx:
2
,
name:
"bridge"
,
options:
{
bridge_needs:
{
pipeline:
'some/project'
}
},
needs_attributes:
[
{
name:
"build"
}
],
when:
"on_success"
,
allow_failure:
false
,
yaml_variables:
[]
)
end
end
end
end
spec/lib/gitlab/ci/yaml_processor_spec.rb
View file @
2ab77fa2
...
...
@@ -1325,80 +1325,6 @@ 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:
1
,
name:
"build"
,
options:
{
script:
[
"test"
]
},
when:
"on_success"
,
allow_failure:
false
,
yaml_variables:
[]
)
expect
(
subject
.
builds
[
1
]).
to
eq
(
stage:
"test"
,
stage_idx:
2
,
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:
1
,
name:
"build"
,
options:
{
script:
[
"test"
]
},
when:
"on_success"
,
allow_failure:
false
,
yaml_variables:
[]
)
expect
(
subject
.
builds
[
1
]).
to
eq
(
stage:
"test"
,
stage_idx:
2
,
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