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
583b49f0
Commit
583b49f0
authored
Feb 28, 2018
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add spec for workers
parent
824af79d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
4 deletions
+32
-4
spec/workers/archive_legacy_trace_worker_spec.rb
spec/workers/archive_legacy_trace_worker_spec.rb
+30
-0
spec/workers/create_trace_artifact_worker_spec.rb
spec/workers/create_trace_artifact_worker_spec.rb
+2
-4
No files found.
spec/workers/archive_legacy_trace_worker_spec.rb
0 → 100644
View file @
583b49f0
require
'spec_helper'
describe
ArchiveLegacyTraceWorker
do
it
{
is_expected
.
to
be_a
(
ObjectStorageQueue
)
}
it
{
is_expected
.
not_to
be_a
(
PipelineQueue
)
}
describe
'#perform'
do
subject
{
described_class
.
new
.
perform
(
job
&
.
id
)
}
context
'when job is found'
do
let
(
:job
)
{
create
(
:ci_build
)
}
it
'executes service'
do
expect_any_instance_of
(
Gitlab
::
Ci
::
Trace
).
to
receive
(
:archive!
)
subject
end
end
context
'when job is not found'
do
let
(
:job
)
{
nil
}
it
'does not execute service'
do
expect_any_instance_of
(
Gitlab
::
Ci
::
Trace
).
not_to
receive
(
:archive!
)
subject
end
end
end
end
spec/workers/create_trace_artifact_worker_spec.rb
View file @
583b49f0
...
@@ -8,8 +8,7 @@ describe CreateTraceArtifactWorker do
...
@@ -8,8 +8,7 @@ describe CreateTraceArtifactWorker do
let
(
:job
)
{
create
(
:ci_build
)
}
let
(
:job
)
{
create
(
:ci_build
)
}
it
'executes service'
do
it
'executes service'
do
expect_any_instance_of
(
Ci
::
CreateTraceArtifactService
)
expect_any_instance_of
(
Gitlab
::
Ci
::
Trace
).
to
receive
(
:archive!
)
.
to
receive
(
:execute
).
with
(
job
)
subject
subject
end
end
...
@@ -19,8 +18,7 @@ describe CreateTraceArtifactWorker do
...
@@ -19,8 +18,7 @@ describe CreateTraceArtifactWorker do
let
(
:job
)
{
nil
}
let
(
:job
)
{
nil
}
it
'does not execute service'
do
it
'does not execute service'
do
expect_any_instance_of
(
Ci
::
CreateTraceArtifactService
)
expect_any_instance_of
(
Gitlab
::
Ci
::
Trace
).
not_to
receive
(
:archive!
)
.
not_to
receive
(
:execute
)
subject
subject
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