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
26371f63
Commit
26371f63
authored
May 17, 2021
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add build specs for transitioning to running state
parent
2ca0eae0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
4 deletions
+16
-4
spec/models/ci/build_spec.rb
spec/models/ci/build_spec.rb
+16
-4
No files found.
spec/models/ci/build_spec.rb
View file @
26371f63
...
...
@@ -377,8 +377,6 @@ RSpec.describe Ci::Build do
describe
'#enqueue_preparing'
do
let
(
:build
)
{
create
(
:ci_build
,
:preparing
)
}
subject
{
build
.
enqueue_preparing
}
before
do
allow
(
build
).
to
receive
(
:any_unmet_prerequisites?
).
and_return
(
has_unmet_prerequisites
)
end
...
...
@@ -387,9 +385,10 @@ RSpec.describe Ci::Build do
let
(
:has_unmet_prerequisites
)
{
false
}
it
'transitions to pending'
do
subject
build
.
enqueue_preparing
expect
(
build
).
to
be_pending
expect
(
build
.
queuing_entry
).
to
be_present
end
end
...
...
@@ -397,9 +396,10 @@ RSpec.describe Ci::Build do
let
(
:has_unmet_prerequisites
)
{
true
}
it
'remains in preparing'
do
subject
build
.
enqueue_preparing
expect
(
build
).
to
be_preparing
expect
(
build
.
queuing_entry
).
not_to
be_present
end
end
end
...
...
@@ -428,6 +428,18 @@ RSpec.describe Ci::Build do
end
end
describe
'#run'
do
let
(
:build
)
{
create
(
:ci_build
,
:created
)
}
it
'creates queuing entry and then removes it'
do
build
.
enqueue!
expect
(
build
.
queuing_entry
).
to
be_present
build
.
run!
expect
(
build
.
reload
.
queuing_entry
).
not_to
be_present
end
end
describe
'#schedulable?'
do
subject
{
build
.
schedulable?
}
...
...
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