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
8e6e38fc
Commit
8e6e38fc
authored
Feb 05, 2020
by
Tetiana Chupryna
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unused method
parent
fa057b24
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
91 deletions
+0
-91
ee/app/models/ee/ci/pipeline.rb
ee/app/models/ee/ci/pipeline.rb
+0
-6
ee/spec/models/ci/pipeline_spec.rb
ee/spec/models/ci/pipeline_spec.rb
+0
-85
No files found.
ee/app/models/ee/ci/pipeline.rb
View file @
8e6e38fc
...
...
@@ -115,12 +115,6 @@ module EE
.
last
end
def
any_report_artifact_for_type
(
file_type
)
return
unless
available_licensed_report_type?
(
file_type
)
job_artifacts
.
where
(
file_type:
::
Ci
::
JobArtifact
.
file_types
[
file_type
]).
last
end
def
expose_license_scanning_data?
return
unless
available_licensed_report_type?
(
:license_management
)
...
...
ee/spec/models/ci/pipeline_spec.rb
View file @
8e6e38fc
...
...
@@ -62,63 +62,6 @@ describe Ci::Pipeline do
end
end
shared_examples
'unlicensed report type'
do
context
'when there is no licensed feature for artifact file type'
do
it
'returns the artifact'
do
expect
(
subject
).
to
eq
(
expected
)
end
end
end
shared_examples
'licensed report type'
do
|
feature
|
context
'when licensed features is NOT available'
do
it
'returns nil'
do
allow
(
pipeline
.
project
).
to
receive
(
:feature_available?
)
.
with
(
feature
).
and_return
(
false
)
expect
(
subject
).
to
be_nil
end
end
context
'when licensed feature is available'
do
it
'returns the artifact'
do
allow
(
pipeline
.
project
).
to
receive
(
:feature_available?
)
.
with
(
feature
).
and_return
(
true
)
expect
(
subject
).
to
eq
(
expected
)
end
end
end
shared_examples
'multi-licensed report type'
do
|
features
|
context
'when NONE of the licensed features are available'
do
it
'returns nil'
do
features
.
each
do
|
feature
|
allow
(
pipeline
.
project
).
to
receive
(
:feature_available?
)
.
with
(
feature
).
and_return
(
false
)
end
expect
(
subject
).
to
be_nil
end
end
context
'when at least one licensed feature is available'
do
features
.
each
do
|
feature
|
it
'returns the artifact'
do
allow
(
pipeline
.
project
).
to
receive
(
:feature_available?
)
.
with
(
feature
).
and_return
(
true
)
features
.
reject
{
|
f
|
f
==
feature
}.
each
do
|
disabled_feature
|
allow
(
pipeline
.
project
).
to
receive
(
:feature_available?
)
.
with
(
disabled_feature
).
and_return
(
true
)
end
expect
(
subject
).
to
eq
(
expected
)
end
end
end
end
describe
'#batch_lookup_report_artifact_for_file_type'
do
subject
(
:artifact
)
{
pipeline
.
batch_lookup_report_artifact_for_file_type
(
file_type
)
}
...
...
@@ -172,34 +115,6 @@ describe Ci::Pipeline do
end
end
describe
'#any_report_artifact_for_type'
do
let!
(
:build
)
{
create
(
:ci_build
,
pipeline:
pipeline
)
}
let!
(
:artifact
)
do
create
(
:ci_job_artifact
,
job:
build
,
file_type:
file_type
,
file_format:
::
Ci
::
JobArtifact
::
TYPE_AND_FORMAT_PAIRS
[
file_type
])
end
subject
{
pipeline
.
any_report_artifact_for_type
(
file_type
)
}
described_class
::
REPORT_LICENSED_FEATURES
.
each
do
|
file_type
,
licensed_features
|
context
"for file_type:
#{
file_type
}
"
do
let
(
:file_type
)
{
file_type
}
let
(
:expected
)
{
artifact
}
if
licensed_features
.
nil?
it_behaves_like
'unlicensed report type'
elsif
licensed_features
.
size
==
1
it_behaves_like
'licensed report type'
,
licensed_features
.
first
else
it_behaves_like
'multi-licensed report type'
,
licensed_features
end
end
end
end
describe
'#expose_license_scanning_data?'
do
subject
{
pipeline
.
expose_license_scanning_data?
}
...
...
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