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
2373fb50
Commit
2373fb50
authored
Jan 28, 2019
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a test case for passing bridge variables downstream
parent
408248f4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
12 deletions
+14
-12
ee/spec/services/ci/process_pipeline_service_spec.rb
ee/spec/services/ci/process_pipeline_service_spec.rb
+14
-12
No files found.
ee/spec/services/ci/process_pipeline_service_spec.rb
View file @
2373fb50
...
...
@@ -16,11 +16,11 @@ describe Ci::ProcessPipelineService, '#execute' do
describe
'cross-project pipelines'
do
before
do
create_processable
(
:
ci_
build
,
name:
'test'
,
stage:
'test'
)
create_processable
(
:
ci_bridge
,
name:
'cross'
,
stage:
'build'
,
downstream:
downstream
)
create_processable
(
:
ci_
build
,
name:
'deploy'
,
stage:
'deploy'
)
create_processable
(
:build
,
name:
'test'
,
stage:
'test'
)
create_processable
(
:
bridge
,
:variables
,
name:
'cross'
,
stage:
'build'
,
downstream:
downstream
)
create_processable
(
:build
,
name:
'deploy'
,
stage:
'deploy'
)
stub_ci_pipeline_to_return_yaml_file
end
...
...
@@ -36,6 +36,9 @@ describe Ci::ProcessPipelineService, '#execute' do
expect
(
downstream
.
ci_pipelines
).
to
be_one
expect
(
downstream
.
ci_pipelines
.
first
).
to
be_pending
expect
(
downstream
.
builds
).
not_to
be_empty
expect
(
downstream
.
builds
.
first
.
variables
)
.
to
include
(
key:
'BRIDGE'
,
value:
'cross'
,
public:
false
)
end
end
...
...
@@ -51,15 +54,14 @@ describe Ci::ProcessPipelineService, '#execute' do
pipeline
.
builds
.
find_by
(
name:
name
).
public_send
(
status
)
end
def
create_processable
(
type
,
name
:
,
**
opts
)
def
create_processable
(
type
,
*
traits
,
**
opts
)
stages
=
%w[test build deploy]
index
=
stages
.
index
(
opts
.
fetch
(
:stage
,
'test'
))
create
(
type
,
status: :created
,
name:
name
,
pipeline:
pipeline
,
stage_idx:
index
,
user:
user
,
**
opts
)
create
(
"ci_
#{
type
}
"
,
*
traits
,
status: :created
,
pipeline:
pipeline
,
stage_idx:
index
,
user:
user
,
**
opts
)
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