Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
6528c713c1d3
Commit
6528c713
authored
Dec 11, 2015
by
Kamil Trzcinski
Browse files
Fix specs
parent
aaa101f56f76
Changes
7
Hide whitespace changes
Inline
Side-by-side
app/models/project.rb
View file @
6528c713
...
...
@@ -830,6 +830,6 @@
end
def
valid_runners_token?
token
self
.
token
&&
self
.
token
==
token
self
.
runners_
token
&&
self
.
runners_
token
==
token
end
...
...
@@ -834,3 +834,5 @@
end
# TODO (ayufan): For now we use runners_token (backward compatibility)
# In 8.4 every build will have its own individual token valid for time of build
def
valid_build_token?
token
...
...
@@ -836,5 +838,5 @@
def
valid_build_token?
token
self
.
token
&&
self
.
token
==
token
self
.
builds_enabled?
&&
self
.
runners_
token
&&
self
.
runners_
token
==
token
end
def
build_coverage_enabled?
...
...
app/views/projects/commit/_builds.html.haml
View file @
6528c713
...
...
@@ -39,8 +39,8 @@
%th
Name
%th
Duration
%th
Finished at
-
if
@ci_commit
.
project
.
coverage_enabled?
-
if
@ci_commit
.
project
.
build_
coverage_enabled?
%th
Coverage
%th
-
@ci_commit
.
refs
.
each
do
|
ref
|
=
render
partial:
"projects/commit_statuses/commit_status"
,
collection:
@ci_commit
.
statuses
.
for_ref
(
ref
).
latest
.
ordered
,
...
...
@@ -43,8 +43,8 @@
%th
Coverage
%th
-
@ci_commit
.
refs
.
each
do
|
ref
|
=
render
partial:
"projects/commit_statuses/commit_status"
,
collection:
@ci_commit
.
statuses
.
for_ref
(
ref
).
latest
.
ordered
,
locals:
{
coverage:
@ci_commit
.
project
.
coverage_enabled?
,
stage:
true
,
allow_retry:
true
}
locals:
{
coverage:
@ci_commit
.
project
.
build_
coverage_enabled?
,
stage:
true
,
allow_retry:
true
}
-
if
@ci_commit
.
retried
.
any?
.gray-content-block.second-block
...
...
@@ -61,7 +61,7 @@
%th
Name
%th
Duration
%th
Finished at
-
if
@ci_commit
.
project
.
coverage_enabled?
-
if
@ci_commit
.
project
.
build_
coverage_enabled?
%th
Coverage
%th
=
render
partial:
"projects/commit_statuses/commit_status"
,
collection:
@ci_commit
.
retried
,
...
...
@@ -65,4 +65,4 @@
%th
Coverage
%th
=
render
partial:
"projects/commit_statuses/commit_status"
,
collection:
@ci_commit
.
retried
,
locals:
{
coverage:
@ci_commit
.
project
.
coverage_enabled?
,
stage:
true
}
locals:
{
coverage:
@ci_commit
.
project
.
build_
coverage_enabled?
,
stage:
true
}
app/views/projects/triggers/index.html.haml
View file @
6528c713
...
...
@@ -68,4 +68,4 @@
-F token=TOKEN \
-F "ref=REF_NAME" \
-F "variables[RUN_NIGHTLY_BUILD]=true" \
#{
builds_trigger_url
(
@project
.
id
,
'TOKEN'
)
}
#{
builds_trigger_url
(
@project
.
id
)
}
lib/gitlab/backend/grack_auth.rb
View file @
6528c713
...
...
@@ -78,7 +78,7 @@
underscored_service
=
matched_login
[
's'
].
underscore
if
underscored_service
==
'gitlab_ci'
return
project
&&
project
.
builds_enabled?
&&
project
.
valid_build_token?
(
password
)
return
project
&&
project
.
valid_build_token?
(
password
)
elsif
Service
.
available_services_names
.
include?
(
underscored_service
)
service_method
=
"
#{
underscored_service
}
_service"
service
=
project
.
send
(
service_method
)
...
...
spec/models/build_spec.rb
View file @
6528c713
...
...
@@ -386,7 +386,7 @@
it
{
is_expected
.
to
be_a
(
String
)
}
it
{
is_expected
.
to
end_with
(
".git"
)
}
it
{
is_expected
.
to
start_with
(
project
.
web_url
[
0
..
6
])
}
it
{
is_expected
.
to
include
(
project
.
token
)
}
it
{
is_expected
.
to
include
(
build
.
token
)
}
it
{
is_expected
.
to
include
(
'gitlab-ci-token'
)
}
it
{
is_expected
.
to
include
(
project
.
web_url
[
7
..-
1
])
}
end
...
...
spec/models/commit_status_spec.rb
View file @
6528c713
...
...
@@ -39,8 +39,10 @@
it
{
is_expected
.
to
belong_to
(
:commit
)
}
it
{
is_expected
.
to
belong_to
(
:user
)
}
it
{
is_expected
.
to
belong_to
(
:project
)
}
it
{
is_expected
.
to
validate_presence_of
(
:name
)
}
it
{
is_expected
.
to
validate_inclusion_of
(
:status
).
in_array
(
%w(pending running failed success canceled)
)
}
it
{
is_expected
.
to
delegate_method
(
:sha
).
to
(
:commit
)
}
it
{
is_expected
.
to
delegate_method
(
:short_sha
).
to
(
:commit
)
}
...
...
@@ -42,9 +44,8 @@
it
{
is_expected
.
to
validate_presence_of
(
:name
)
}
it
{
is_expected
.
to
validate_inclusion_of
(
:status
).
in_array
(
%w(pending running failed success canceled)
)
}
it
{
is_expected
.
to
delegate_method
(
:sha
).
to
(
:commit
)
}
it
{
is_expected
.
to
delegate_method
(
:short_sha
).
to
(
:commit
)
}
it
{
is_expected
.
to
delegate_method
(
:project
).
to
(
:commit
)
}
it
{
is_expected
.
to
respond_to
:success?
}
it
{
is_expected
.
to
respond_to
:failed?
}
...
...
spec/services/create_commit_builds_service_spec.rb
View file @
6528c713
...
...
@@ -20,7 +20,7 @@
)
end
it
{
expect
(
commit
).
to
be_kind_of
(
Commit
)
}
it
{
expect
(
commit
).
to
be_kind_of
(
Ci
::
Commit
)
}
it
{
expect
(
commit
).
to
be_valid
}
it
{
expect
(
commit
).
to
be_persisted
}
it
{
expect
(
commit
).
to
eq
(
project
.
ci_commits
.
last
)
}
...
...
@@ -24,7 +24,7 @@
it
{
expect
(
commit
).
to
be_valid
}
it
{
expect
(
commit
).
to
be_persisted
}
it
{
expect
(
commit
).
to
eq
(
project
.
ci_commits
.
last
)
}
it
{
expect
(
commit
.
builds
.
first
).
to
be_kind_of
(
Build
)
}
it
{
expect
(
commit
.
builds
.
first
).
to
be_kind_of
(
Ci
::
Build
)
}
end
context
"skip tag if there is no build for it"
do
...
...
Write
Preview
Supports
Markdown
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