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
iv
gitlab-ce
Commits
dbf235f5
Commit
dbf235f5
authored
Jun 07, 2016
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix tests failures
parent
4e38d88d
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
44 additions
and
44 deletions
+44
-44
app/services/ci/create_builds_service.rb
app/services/ci/create_builds_service.rb
+1
-1
spec/features/merge_requests/created_from_fork_spec.rb
spec/features/merge_requests/created_from_fork_spec.rb
+2
-2
spec/features/projects/commit/builds_spec.rb
spec/features/projects/commit/builds_spec.rb
+2
-2
spec/lib/gitlab/badge/build_spec.rb
spec/lib/gitlab/badge/build_spec.rb
+2
-2
spec/models/build_spec.rb
spec/models/build_spec.rb
+1
-1
spec/models/project_spec.rb
spec/models/project_spec.rb
+1
-1
spec/services/create_commit_builds_service_spec.rb
spec/services/create_commit_builds_service_spec.rb
+35
-35
No files found.
app/services/ci/create_builds_service.rb
View file @
dbf235f5
...
...
@@ -5,7 +5,7 @@ module Ci
end
def
execute
(
stage
,
user
,
status
,
trigger_request
=
nil
)
builds_attrs
=
config_processor
.
builds_for_stage_and_ref
(
stage
,
@
commit
.
ref
,
@commit
.
tag
,
trigger_request
)
builds_attrs
=
config_processor
.
builds_for_stage_and_ref
(
stage
,
@
pipeline
.
ref
,
@pipeline
.
tag
,
trigger_request
)
# check when to create next build
builds_attrs
=
builds_attrs
.
select
do
|
build_attrs
|
...
...
spec/features/merge_requests/created_from_fork_spec.rb
View file @
dbf235f5
...
...
@@ -30,8 +30,8 @@ feature 'Merge request created from fork' do
given
(
:pipeline
)
do
create
(
:ci_pipeline_with_two_job
,
project:
fork_project
,
sha:
merge_request
.
last_commit
.
id
,
ref:
merge_request
.
source_branch
)
sha:
merge_request
.
last_commit
.
id
,
ref:
merge_request
.
source_branch
)
end
background
{
pipeline
.
create_builds
(
user
)
}
...
...
spec/features/projects/commit/builds_spec.rb
View file @
dbf235f5
...
...
@@ -12,8 +12,8 @@ feature 'project commit builds' do
context
'when no builds triggered yet'
do
background
do
create
(
:ci_pipeline
,
project:
project
,
sha:
project
.
commit
.
sha
,
ref:
'master'
)
sha:
project
.
commit
.
sha
,
ref:
'master'
)
end
scenario
'user views commit builds page'
do
...
...
spec/lib/gitlab/badge/build_spec.rb
View file @
dbf235f5
...
...
@@ -110,8 +110,8 @@ describe Gitlab::Badge::Build do
def
create_build
(
project
,
sha
,
branch
)
pipeline
=
create
(
:ci_pipeline
,
project:
project
,
sha:
sha
,
ref:
branch
)
sha:
sha
,
ref:
branch
)
create
(
:ci_build
,
pipeline:
pipeline
)
end
...
...
spec/models/build_spec.rb
View file @
dbf235f5
...
...
@@ -219,7 +219,7 @@ describe Ci::Build, models: true do
context
'and trigger variables'
do
let
(
:trigger
)
{
create
(
:ci_trigger
,
project:
project
)
}
let
(
:trigger_request
)
{
create
(
:ci_trigger_request_with_variables
,
pipeline
:
pipeline
,
trigger:
trigger
)
}
let
(
:trigger_request
)
{
create
(
:ci_trigger_request_with_variables
,
commit
:
pipeline
,
trigger:
trigger
)
}
let
(
:trigger_variables
)
do
[
{
key: :TRIGGER_KEY
,
value:
'TRIGGER_VALUE'
,
public:
false
}
...
...
spec/models/project_spec.rb
View file @
dbf235f5
...
...
@@ -401,7 +401,7 @@ describe Project, models: true do
describe
:pipeline
do
let
(
:project
)
{
create
:project
}
let
(
:pipeline
)
{
create
:pipeline
,
project:
project
,
ref:
'master'
}
let
(
:pipeline
)
{
create
:
ci_
pipeline
,
project:
project
,
ref:
'master'
}
subject
{
project
.
pipeline
(
pipeline
.
sha
,
'master'
)
}
...
...
spec/services/create_commit_builds_service_spec.rb
View file @
dbf235f5
...
...
@@ -70,11 +70,11 @@ describe CreateCommitBuildsService, services: true do
stub_ci_pipeline_yaml_file
(
'invalid: file: file'
)
commits
=
[{
message:
message
}]
pipeline
=
service
.
execute
(
project
,
user
,
ref:
'refs/tags/0_1'
,
before:
'00000000'
,
after:
'31das312'
,
commits:
commits
)
ref:
'refs/tags/0_1'
,
before:
'00000000'
,
after:
'31das312'
,
commits:
commits
)
expect
(
pipeline
).
to
be_persisted
expect
(
pipeline
.
builds
.
any?
).
to
be
false
expect
(
pipeline
.
status
).
to
eq
(
'failed'
)
...
...
@@ -91,11 +91,11 @@ describe CreateCommitBuildsService, services: true do
it
"skips builds creation if there is [ci skip] tag in commit message"
do
commits
=
[{
message:
message
}]
pipeline
=
service
.
execute
(
project
,
user
,
ref:
'refs/tags/0_1'
,
before:
'00000000'
,
after:
'31das312'
,
commits:
commits
)
ref:
'refs/tags/0_1'
,
before:
'00000000'
,
after:
'31das312'
,
commits:
commits
)
expect
(
pipeline
).
to
be_persisted
expect
(
pipeline
.
builds
.
any?
).
to
be
false
expect
(
pipeline
.
status
).
to
eq
(
"skipped"
)
...
...
@@ -106,11 +106,11 @@ describe CreateCommitBuildsService, services: true do
commits
=
[{
message:
"some message"
}]
pipeline
=
service
.
execute
(
project
,
user
,
ref:
'refs/tags/0_1'
,
before:
'00000000'
,
after:
'31das312'
,
commits:
commits
)
ref:
'refs/tags/0_1'
,
before:
'00000000'
,
after:
'31das312'
,
commits:
commits
)
expect
(
pipeline
).
to
be_persisted
expect
(
pipeline
.
builds
.
first
.
name
).
to
eq
(
"staging"
)
...
...
@@ -120,11 +120,11 @@ describe CreateCommitBuildsService, services: true do
stub_ci_pipeline_yaml_file
(
'invalid: file: fiile'
)
commits
=
[{
message:
message
}]
pipeline
=
service
.
execute
(
project
,
user
,
ref:
'refs/tags/0_1'
,
before:
'00000000'
,
after:
'31das312'
,
commits:
commits
)
ref:
'refs/tags/0_1'
,
before:
'00000000'
,
after:
'31das312'
,
commits:
commits
)
expect
(
pipeline
).
to
be_persisted
expect
(
pipeline
.
builds
.
any?
).
to
be
false
expect
(
pipeline
.
status
).
to
eq
(
"skipped"
)
...
...
@@ -137,20 +137,20 @@ describe CreateCommitBuildsService, services: true do
commits
=
[{
message:
"message"
}]
pipeline
=
service
.
execute
(
project
,
user
,
ref:
'refs/heads/master'
,
before:
'00000000'
,
after:
'31das312'
,
commits:
commits
)
ref:
'refs/heads/master'
,
before:
'00000000'
,
after:
'31das312'
,
commits:
commits
)
expect
(
pipeline
).
to
be_persisted
expect
(
pipeline
.
builds
.
count
(
:all
)).
to
eq
(
2
)
pipeline
=
service
.
execute
(
project
,
user
,
ref:
'refs/heads/master'
,
before:
'00000000'
,
after:
'31das312'
,
commits:
commits
)
ref:
'refs/heads/master'
,
before:
'00000000'
,
after:
'31das312'
,
commits:
commits
)
expect
(
pipeline
).
to
be_persisted
expect
(
pipeline
.
builds
.
count
(
:all
)).
to
eq
(
2
)
end
...
...
@@ -161,11 +161,11 @@ describe CreateCommitBuildsService, services: true do
commits
=
[{
message:
"some message"
}]
pipeline
=
service
.
execute
(
project
,
user
,
ref:
'refs/tags/0_1'
,
before:
'00000000'
,
after:
'31das312'
,
commits:
commits
)
ref:
'refs/tags/0_1'
,
before:
'00000000'
,
after:
'31das312'
,
commits:
commits
)
expect
(
pipeline
).
to
be_persisted
expect
(
pipeline
.
status
).
to
eq
(
"failed"
)
...
...
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