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
Jérome Perrin
gitlab-ce
Commits
bf6126b1
Commit
bf6126b1
authored
Nov 27, 2017
by
Zeger-Jan van de Weg
Committed by
Kamil Trzcinski
Dec 03, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add coverage on legacy artifacts for Ci::Build
parent
e35f1607
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
190 additions
and
77 deletions
+190
-77
spec/models/ci/build_spec.rb
spec/models/ci/build_spec.rb
+171
-70
spec/models/project_statistics_spec.rb
spec/models/project_statistics_spec.rb
+19
-7
No files found.
spec/models/ci/build_spec.rb
View file @
bf6126b1
This diff is collapsed.
Click to expand it.
spec/models/project_statistics_spec.rb
View file @
bf6126b1
...
...
@@ -133,17 +133,29 @@ describe ProjectStatistics do
describe
'#update_build_artifacts_size'
do
let!
(
:pipeline
)
{
create
(
:ci_pipeline
,
project:
project
)
}
let!
(
:ci_build
)
{
create
(
:ci_build
,
pipeline:
pipeline
,
artifacts_size:
45
.
megabytes
)
}
before
do
create
(
:ci_build
,
pipeline:
pipeline
,
artifacts_size:
56
.
megabytes
)
create
(
:ci_job_artifact
,
:archive
,
project:
pipeline
.
project
,
job:
ci_build
)
context
'when new job artifacts are calculated'
do
let
(
:ci_build
)
{
create
(
:ci_build
,
pipeline:
pipeline
)
}
before
do
create
(
:ci_job_artifact
,
:archive
,
project:
pipeline
.
project
,
job:
ci_build
)
end
it
"stores the size of related build artifacts"
do
statistics
.
update_build_artifacts_size
statistics
.
update_build_artifacts_size
expect
(
statistics
.
build_artifacts_size
).
to
be
(
106365
)
end
end
it
"stores the size of related build artifacts"
do
expect
(
statistics
.
build_artifacts_size
).
to
eq
(
106012541
)
context
'when legacy artifacts are used'
do
let!
(
:ci_build
)
{
create
(
:ci_build
,
pipeline:
pipeline
,
artifacts_size:
10
.
megabytes
)
}
it
"stores the size of related build artifacts"
do
statistics
.
update_build_artifacts_size
expect
(
statistics
.
build_artifacts_size
).
to
eq
(
10
.
megabytes
)
end
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