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
a48c81c1
Commit
a48c81c1
authored
Nov 23, 2020
by
Andy Soiron
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add 'with runner' context to pipeline data_builder
parent
c0026bcf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
1 deletion
+15
-1
spec/lib/gitlab/data_builder/pipeline_spec.rb
spec/lib/gitlab/data_builder/pipeline_spec.rb
+15
-1
No files found.
spec/lib/gitlab/data_builder/pipeline_spec.rb
View file @
a48c81c1
...
...
@@ -21,9 +21,10 @@ RSpec.describe Gitlab::DataBuilder::Pipeline do
let
(
:data
)
{
described_class
.
build
(
pipeline
)
}
let
(
:attributes
)
{
data
[
:object_attributes
]
}
let
(
:build_data
)
{
data
[
:builds
].
first
}
let
(
:runner_data
)
{
build_data
[
:runner
]
}
let
(
:project_data
)
{
data
[
:project
]
}
it
'has correct attributes'
do
it
'has correct attributes'
,
:aggregate_failures
do
expect
(
attributes
).
to
be_a
(
Hash
)
expect
(
attributes
[
:ref
]).
to
eq
(
pipeline
.
ref
)
expect
(
attributes
[
:sha
]).
to
eq
(
pipeline
.
sha
)
...
...
@@ -36,6 +37,7 @@ RSpec.describe Gitlab::DataBuilder::Pipeline do
expect
(
build_data
[
:id
]).
to
eq
(
build
.
id
)
expect
(
build_data
[
:status
]).
to
eq
(
build
.
status
)
expect
(
build_data
[
:allow_failure
]).
to
eq
(
build
.
allow_failure
)
expect
(
runner_data
).
to
eq
(
nil
)
expect
(
project_data
).
to
eq
(
project
.
hook_attrs
(
backward:
false
))
expect
(
data
[
:merge_request
]).
to
be_nil
expect
(
data
[
:user
]).
to
eq
({
...
...
@@ -46,6 +48,18 @@ RSpec.describe Gitlab::DataBuilder::Pipeline do
})
end
context
'build with runner'
do
let!
(
:build
)
{
create
(
:ci_build
,
pipeline:
pipeline
,
runner:
ci_runner
)
}
let
(
:ci_runner
)
{
create
(
:ci_runner
)
}
it
'has runner attributes'
,
:aggregate_failures
do
expect
(
runner_data
[
:id
]).
to
eq
(
ci_runner
.
id
)
expect
(
runner_data
[
:description
]).
to
eq
(
ci_runner
.
description
)
expect
(
runner_data
[
:active
]).
to
eq
(
ci_runner
.
active
)
expect
(
runner_data
[
:is_shared
]).
to
eq
(
ci_runner
.
instance_type?
)
end
end
context
'pipeline without variables'
do
it
'has empty variables hash'
do
expect
(
attributes
[
:variables
]).
to
be_a
(
Array
)
...
...
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