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
dde06370
Commit
dde06370
authored
Oct 26, 2020
by
alinamihaila
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve usage_data monthly specs
parent
9f498701
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
4 deletions
+16
-4
spec/lib/gitlab/usage_data_spec.rb
spec/lib/gitlab/usage_data_spec.rb
+16
-4
No files found.
spec/lib/gitlab/usage_data_spec.rb
View file @
dde06370
...
@@ -591,9 +591,21 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
...
@@ -591,9 +591,21 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
describe
'.system_usage_data_monthly'
do
describe
'.system_usage_data_monthly'
do
let_it_be
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:project
)
{
create
(
:project
)
}
let!
(
:ud
)
{
build
(
:usage_data
)
}
before
do
before
do
project
=
create
(
:project
)
env
=
create
(
:environment
)
create
(
:package
,
project:
project
,
created_at:
3
.
days
.
ago
)
create
(
:package
,
created_at:
2
.
months
.
ago
,
project:
project
)
[
3
,
31
].
each
do
|
n
|
deployment_options
=
{
created_at:
n
.
days
.
ago
,
project:
env
.
project
,
environment:
env
}
create
(
:deployment
,
:failed
,
deployment_options
)
create
(
:deployment
,
:success
,
deployment_options
)
create
(
:project_snippet
,
project:
project
,
created_at:
n
.
days
.
ago
)
create
(
:personal_snippet
,
created_at:
n
.
days
.
ago
)
end
stub_application_setting
(
self_monitoring_project:
project
)
stub_application_setting
(
self_monitoring_project:
project
)
for_defined_days_back
do
for_defined_days_back
do
...
@@ -609,10 +621,10 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
...
@@ -609,10 +621,10 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
expect
(
counts_monthly
[
:deployments
]).
to
eq
(
2
)
expect
(
counts_monthly
[
:deployments
]).
to
eq
(
2
)
expect
(
counts_monthly
[
:successful_deployments
]).
to
eq
(
1
)
expect
(
counts_monthly
[
:successful_deployments
]).
to
eq
(
1
)
expect
(
counts_monthly
[
:failed_deployments
]).
to
eq
(
1
)
expect
(
counts_monthly
[
:failed_deployments
]).
to
eq
(
1
)
expect
(
counts_monthly
[
:snippets
]).
to
eq
(
3
)
expect
(
counts_monthly
[
:snippets
]).
to
eq
(
2
)
expect
(
counts_monthly
[
:personal_snippets
]).
to
eq
(
1
)
expect
(
counts_monthly
[
:personal_snippets
]).
to
eq
(
1
)
expect
(
counts_monthly
[
:project_snippets
]).
to
eq
(
2
)
expect
(
counts_monthly
[
:project_snippets
]).
to
eq
(
1
)
expect
(
counts_monthly
[
:packages
]).
to
eq
(
3
)
expect
(
counts_monthly
[
:packages
]).
to
eq
(
1
)
expect
(
counts_monthly
[
:promoted_issues
]).
to
eq
(
1
)
expect
(
counts_monthly
[
:promoted_issues
]).
to
eq
(
1
)
end
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