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
Boxiang Sun
gitlab-ce
Commits
6eee8d2d
Commit
6eee8d2d
authored
Sep 26, 2018
by
Shinya Maeda
Committed by
Alessio Caiazza
Oct 02, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix process build service spec
parent
af4b85ce
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
70 additions
and
16 deletions
+70
-16
spec/factories/ci/builds.rb
spec/factories/ci/builds.rb
+9
-0
spec/services/ci/enqueue_build_service_spec.rb
spec/services/ci/enqueue_build_service_spec.rb
+0
-16
spec/services/ci/process_build_service_spec.rb
spec/services/ci/process_build_service_spec.rb
+61
-0
No files found.
spec/factories/ci/builds.rb
View file @
6eee8d2d
...
@@ -98,6 +98,15 @@ FactoryBot.define do
...
@@ -98,6 +98,15 @@ FactoryBot.define do
success
success
end
end
trait
:schedulable
do
self
.
when
'delayed'
options
start_in:
'1 minute'
end
trait
:actionable
do
self
.
when
'manual'
end
trait
:retried
do
trait
:retried
do
retried
true
retried
true
end
end
...
...
spec/services/ci/enqueue_build_service_spec.rb
deleted
100644 → 0
View file @
af4b85ce
# frozen_string_literal: true
require
'spec_helper'
describe
Ci
::
EnqueueBuildService
,
'#execute'
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:ci_build
)
{
create
(
:ci_build
,
:created
)
}
subject
{
described_class
.
new
(
project
,
user
).
execute
(
ci_build
)
}
it
'enqueues the build'
do
subject
expect
(
ci_build
.
pending?
).
to
be_truthy
end
end
spec/services/ci/process_build_service_spec.rb
0 → 100644
View file @
6eee8d2d
# frozen_string_literal: true
require
'spec_helper'
describe
Ci
::
ProcessBuildService
,
'#execute'
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
)
}
subject
{
described_class
.
new
(
project
,
user
).
execute
(
build
)
}
before
do
project
.
add_maintainer
(
user
)
end
context
'when build is schedulable'
do
let
(
:build
)
{
create
(
:ci_build
,
:created
,
:schedulable
,
user:
user
,
project:
project
)
}
context
'when ci_enable_scheduled_build feature flag is enabled'
do
before
do
stub_feature_flags
(
ci_enable_scheduled_build:
true
)
end
it
'schedules the build'
do
subject
expect
(
build
).
to
be_scheduled
end
end
context
'when ci_enable_scheduled_build feature flag is disabled'
do
before
do
stub_feature_flags
(
ci_enable_scheduled_build:
false
)
end
it
'enqueues the build'
do
subject
expect
(
build
).
to
be_pending
end
end
end
context
'when build is actionable'
do
let
(
:build
)
{
create
(
:ci_build
,
:created
,
:actionable
,
user:
user
,
project:
project
)
}
it
'actionizes the build'
do
subject
expect
(
build
).
to
be_manual
end
end
context
'when build does not have any actions'
do
let
(
:build
)
{
create
(
:ci_build
,
:created
,
user:
user
,
project:
project
)
}
it
'enqueues the build'
do
subject
expect
(
build
).
to
be_pending
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