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
73cdcd2f
Commit
73cdcd2f
authored
Feb 05, 2018
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor :trace to :trace_live in spec
parent
95c9f6a7
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
25 additions
and
25 deletions
+25
-25
spec/controllers/projects/jobs_controller_spec.rb
spec/controllers/projects/jobs_controller_spec.rb
+5
-5
spec/factories/ci/builds.rb
spec/factories/ci/builds.rb
+2
-2
spec/features/projects/jobs_spec.rb
spec/features/projects/jobs_spec.rb
+1
-1
spec/javascripts/fixtures/jobs.rb
spec/javascripts/fixtures/jobs.rb
+1
-1
spec/models/ci/build_spec.rb
spec/models/ci/build_spec.rb
+4
-4
spec/requests/api/jobs_spec.rb
spec/requests/api/jobs_spec.rb
+5
-5
spec/requests/api/runner_spec.rb
spec/requests/api/runner_spec.rb
+3
-3
spec/requests/api/v3/builds_spec.rb
spec/requests/api/v3/builds_spec.rb
+4
-4
No files found.
spec/controllers/projects/jobs_controller_spec.rb
View file @
73cdcd2f
...
...
@@ -171,7 +171,7 @@ describe Projects::JobsController do
end
context
'when job has a trace'
do
let
(
:job
)
{
create
(
:ci_build
,
:trace
,
pipeline:
pipeline
)
}
let
(
:job
)
{
create
(
:ci_build
,
:trace
_live
,
pipeline:
pipeline
)
}
it
'returns a trace'
do
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
...
...
@@ -193,7 +193,7 @@ describe Projects::JobsController do
end
context
'when job has a trace with ANSI sequence and Unicode'
do
let
(
:job
)
{
create
(
:ci_build
,
:unicode_trace
,
pipeline:
pipeline
)
}
let
(
:job
)
{
create
(
:ci_build
,
:unicode_trace
_live
,
pipeline:
pipeline
)
}
it
'returns a trace with Unicode'
do
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
...
...
@@ -392,7 +392,7 @@ describe Projects::JobsController do
end
context
'when job is erasable'
do
let
(
:job
)
{
create
(
:ci_build
,
:erasable
,
:trace
,
:trace
_artifact
,
pipeline:
pipeline
)
}
let
(
:job
)
{
create
(
:ci_build
,
:erasable
,
:trace_artifact
,
pipeline:
pipeline
)
}
it
'redirects to the erased job page'
do
expect
(
response
).
to
have_gitlab_http_status
(
:found
)
...
...
@@ -419,7 +419,7 @@ describe Projects::JobsController do
context
'when user is developer'
do
let
(
:role
)
{
:developer
}
let
(
:job
)
{
create
(
:ci_build
,
:erasable
,
:trace
,
pipeline:
pipeline
,
user:
triggered_by
)
}
let
(
:job
)
{
create
(
:ci_build
,
:erasable
,
:trace
_artifact
,
pipeline:
pipeline
,
user:
triggered_by
)
}
context
'when triggered by same user'
do
let
(
:triggered_by
)
{
user
}
...
...
@@ -461,7 +461,7 @@ describe Projects::JobsController do
end
context
'when job has a trace file'
do
let
(
:job
)
{
create
(
:ci_build
,
:trace
,
pipeline:
pipeline
)
}
let
(
:job
)
{
create
(
:ci_build
,
:trace
_live
,
pipeline:
pipeline
)
}
it
'send a trace file'
do
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
...
...
spec/factories/ci/builds.rb
View file @
73cdcd2f
...
...
@@ -135,7 +135,7 @@ FactoryBot.define do
coverage_regex
'/(d+)/'
end
trait
:trace
do
trait
:trace
_live
do
after
(
:create
)
do
|
build
,
evaluator
|
build
.
trace
.
set
(
'BUILD TRACE'
)
end
...
...
@@ -147,7 +147,7 @@ FactoryBot.define do
end
end
trait
:unicode_trace
do
trait
:unicode_trace
_live
do
after
(
:create
)
do
|
build
,
evaluator
|
trace
=
File
.
binread
(
File
.
expand_path
(
...
...
spec/features/projects/jobs_spec.rb
View file @
73cdcd2f
...
...
@@ -7,7 +7,7 @@ feature 'Jobs' do
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:pipeline
)
{
create
(
:ci_pipeline
,
project:
project
)
}
let
(
:job
)
{
create
(
:ci_build
,
:trace
,
pipeline:
pipeline
)
}
let
(
:job
)
{
create
(
:ci_build
,
:trace
_live
,
pipeline:
pipeline
)
}
let
(
:job2
)
{
create
(
:ci_build
)
}
let
(
:artifacts_file
)
do
...
...
spec/javascripts/fixtures/jobs.rb
View file @
73cdcd2f
...
...
@@ -7,7 +7,7 @@ describe Projects::JobsController, '(JavaScript fixtures)', type: :controller do
let
(
:namespace
)
{
create
(
:namespace
,
name:
'frontend-fixtures'
)}
let
(
:project
)
{
create
(
:project_empty_repo
,
namespace:
namespace
,
path:
'builds-project'
)
}
let
(
:pipeline
)
{
create
(
:ci_empty_pipeline
,
project:
project
)
}
let!
(
:build_with_artifacts
)
{
create
(
:ci_build
,
:success
,
:artifacts
,
:trace
,
pipeline:
pipeline
,
stage:
'test'
,
artifacts_expire_at:
Time
.
now
+
18
.
months
)
}
let!
(
:build_with_artifacts
)
{
create
(
:ci_build
,
:success
,
:artifacts
,
:trace
_artifact
,
pipeline:
pipeline
,
stage:
'test'
,
artifacts_expire_at:
Time
.
now
+
18
.
months
)
}
let!
(
:failed_build
)
{
create
(
:ci_build
,
:failed
,
pipeline:
pipeline
,
stage:
'build'
)
}
let!
(
:pending_build
)
{
create
(
:ci_build
,
:pending
,
pipeline:
pipeline
,
stage:
'deploy'
)
}
...
...
spec/models/ci/build_spec.rb
View file @
73cdcd2f
...
...
@@ -694,7 +694,7 @@ describe Ci::Build do
context
'build is erasable'
do
context
'new artifacts'
do
let!
(
:build
)
{
create
(
:ci_build
,
:trace
,
:trace
_artifact
,
:success
,
:artifacts
)
}
let!
(
:build
)
{
create
(
:ci_build
,
:trace_artifact
,
:success
,
:artifacts
)
}
describe
'#erase'
do
before
do
...
...
@@ -728,7 +728,7 @@ describe Ci::Build do
end
describe
'#erased?'
do
let!
(
:build
)
{
create
(
:ci_build
,
:trace
,
:trace
_artifact
,
:success
,
:artifacts
)
}
let!
(
:build
)
{
create
(
:ci_build
,
:trace_artifact
,
:success
,
:artifacts
)
}
subject
{
build
.
erased?
}
context
'job has not been erased'
do
...
...
@@ -763,7 +763,7 @@ describe Ci::Build do
context
'old artifacts'
do
context
'build is erasable'
do
context
'new artifacts'
do
let!
(
:build
)
{
create
(
:ci_build
,
:trace
,
:success
,
:legacy_artifacts
)
}
let!
(
:build
)
{
create
(
:ci_build
,
:trace
_artifact
,
:success
,
:legacy_artifacts
)
}
describe
'#erase'
do
before
do
...
...
@@ -797,7 +797,7 @@ describe Ci::Build do
end
describe
'#erased?'
do
let!
(
:build
)
{
create
(
:ci_build
,
:trace
,
:success
,
:legacy_artifacts
)
}
let!
(
:build
)
{
create
(
:ci_build
,
:trace
_artifact
,
:success
,
:legacy_artifacts
)
}
subject
{
build
.
erased?
}
context
'job has not been erased'
do
...
...
spec/requests/api/jobs_spec.rb
View file @
73cdcd2f
...
...
@@ -479,7 +479,7 @@ describe API::Jobs do
end
context
'when trace is file'
do
let
(
:job
)
{
create
(
:ci_build
,
:trace
,
pipeline:
pipeline
)
}
let
(
:job
)
{
create
(
:ci_build
,
:trace
_live
,
pipeline:
pipeline
)
}
it
'returns specific job trace'
do
expect
(
response
).
to
have_gitlab_http_status
(
200
)
...
...
@@ -572,7 +572,7 @@ describe API::Jobs do
end
context
'job is erasable'
do
let
(
:job
)
{
create
(
:ci_build
,
:trace
,
:trace
_artifact
,
:artifacts
,
:success
,
project:
project
,
pipeline:
pipeline
)
}
let
(
:job
)
{
create
(
:ci_build
,
:trace_artifact
,
:artifacts
,
:success
,
project:
project
,
pipeline:
pipeline
)
}
it
'erases job content'
do
expect
(
response
).
to
have_gitlab_http_status
(
201
)
...
...
@@ -590,7 +590,7 @@ describe API::Jobs do
end
context
'job is not erasable'
do
let
(
:job
)
{
create
(
:ci_build
,
:trace
,
project:
project
,
pipeline:
pipeline
)
}
let
(
:job
)
{
create
(
:ci_build
,
:trace
_live
,
project:
project
,
pipeline:
pipeline
)
}
it
'responds with forbidden'
do
expect
(
response
).
to
have_gitlab_http_status
(
403
)
...
...
@@ -599,7 +599,7 @@ describe API::Jobs do
context
'when a developer erases a build'
do
let
(
:role
)
{
:developer
}
let
(
:job
)
{
create
(
:ci_build
,
:trace
,
:trace
_artifact
,
:artifacts
,
:success
,
project:
project
,
pipeline:
pipeline
,
user:
owner
)
}
let
(
:job
)
{
create
(
:ci_build
,
:trace_artifact
,
:artifacts
,
:success
,
project:
project
,
pipeline:
pipeline
,
user:
owner
)
}
context
'when the build was created by the developer'
do
let
(
:owner
)
{
user
}
...
...
@@ -622,7 +622,7 @@ describe API::Jobs do
context
'artifacts did not expire'
do
let
(
:job
)
do
create
(
:ci_build
,
:trace
,
:artifacts
,
:success
,
create
(
:ci_build
,
:trace
_artifact
,
:artifacts
,
:success
,
project:
project
,
pipeline:
pipeline
,
artifacts_expire_at:
Time
.
now
+
7
.
days
)
end
...
...
spec/requests/api/runner_spec.rb
View file @
73cdcd2f
...
...
@@ -640,7 +640,7 @@ describe API::Runner do
end
describe
'PUT /api/v4/jobs/:id'
do
let
(
:job
)
{
create
(
:ci_build
,
:pending
,
:trace
,
pipeline:
pipeline
,
runner_id:
runner
.
id
)
}
let
(
:job
)
{
create
(
:ci_build
,
:pending
,
:trace
_live
,
pipeline:
pipeline
,
runner_id:
runner
.
id
)
}
before
do
job
.
run!
...
...
@@ -721,7 +721,7 @@ describe API::Runner do
end
describe
'PATCH /api/v4/jobs/:id/trace'
do
let
(
:job
)
{
create
(
:ci_build
,
:running
,
:trace
,
runner_id:
runner
.
id
,
pipeline:
pipeline
)
}
let
(
:job
)
{
create
(
:ci_build
,
:running
,
:trace
_live
,
runner_id:
runner
.
id
,
pipeline:
pipeline
)
}
let
(
:headers
)
{
{
API
::
Helpers
::
Runner
::
JOB_TOKEN_HEADER
=>
job
.
token
,
'Content-Type'
=>
'text/plain'
}
}
let
(
:headers_with_range
)
{
headers
.
merge
({
'Content-Range'
=>
'11-20'
})
}
let
(
:update_interval
)
{
10
.
seconds
.
to_i
}
...
...
@@ -782,7 +782,7 @@ describe API::Runner do
context
'when project for the build has been deleted'
do
let
(
:job
)
do
create
(
:ci_build
,
:running
,
:trace
,
runner_id:
runner
.
id
,
pipeline:
pipeline
)
do
|
job
|
create
(
:ci_build
,
:running
,
:trace
_live
,
runner_id:
runner
.
id
,
pipeline:
pipeline
)
do
|
job
|
job
.
project
.
update
(
pending_delete:
true
)
end
end
...
...
spec/requests/api/v3/builds_spec.rb
View file @
73cdcd2f
...
...
@@ -352,7 +352,7 @@ describe API::V3::Builds do
end
describe
'GET /projects/:id/builds/:build_id/trace'
do
let
(
:build
)
{
create
(
:ci_build
,
:trace
,
pipeline:
pipeline
)
}
let
(
:build
)
{
create
(
:ci_build
,
:trace
_live
,
pipeline:
pipeline
)
}
before
do
get
v3_api
(
"/projects/
#{
project
.
id
}
/builds/
#{
build
.
id
}
/trace"
,
api_user
)
...
...
@@ -447,7 +447,7 @@ describe API::V3::Builds do
end
context
'job is erasable'
do
let
(
:build
)
{
create
(
:ci_build
,
:trace
,
:artifacts
,
:success
,
project:
project
,
pipeline:
pipeline
)
}
let
(
:build
)
{
create
(
:ci_build
,
:trace
_artifact
,
:artifacts
,
:success
,
project:
project
,
pipeline:
pipeline
)
}
it
'erases job content'
do
expect
(
response
.
status
).
to
eq
201
...
...
@@ -463,7 +463,7 @@ describe API::V3::Builds do
end
context
'job is not erasable'
do
let
(
:build
)
{
create
(
:ci_build
,
:trace
,
project:
project
,
pipeline:
pipeline
)
}
let
(
:build
)
{
create
(
:ci_build
,
:trace
_live
,
project:
project
,
pipeline:
pipeline
)
}
it
'responds with forbidden'
do
expect
(
response
.
status
).
to
eq
403
...
...
@@ -478,7 +478,7 @@ describe API::V3::Builds do
context
'artifacts did not expire'
do
let
(
:build
)
do
create
(
:ci_build
,
:trace
,
:artifacts
,
:success
,
create
(
:ci_build
,
:trace
_artifact
,
:artifacts
,
:success
,
project:
project
,
pipeline:
pipeline
,
artifacts_expire_at:
Time
.
now
+
7
.
days
)
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