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
ba3d6e77
Commit
ba3d6e77
authored
Dec 31, 2020
by
charlie ablett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test cases for pipeline statistics different dates
- 31st day of the month - February in non-leap year
parent
879eb7c5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
spec/requests/api/graphql/project/project_pipeline_statistics_spec.rb
...s/api/graphql/project/project_pipeline_statistics_spec.rb
+10
-4
No files found.
spec/requests/api/graphql/project/project_pipeline_statistics_spec.rb
View file @
ba3d6e77
...
@@ -42,13 +42,19 @@ RSpec.describe 'rendering project pipeline statistics' do
...
@@ -42,13 +42,19 @@ RSpec.describe 'rendering project pipeline statistics' do
expect
(
graphql_data_at
(
:project
,
:pipelineAnalytics
,
:weekPipelinesLabels
).
length
).
to
eq
(
8
)
expect
(
graphql_data_at
(
:project
,
:pipelineAnalytics
,
:weekPipelinesLabels
).
length
).
to
eq
(
8
)
end
end
it
"contains two arrays of 31 elements each for the month pipelines"
do
shared_examples
'monthly statistics'
do
|
timestamp
,
expected_quantity
|
post_graphql
(
query
,
current_user:
user
)
it
"contains two arrays of
#{
expected_quantity
}
elements each for the month pipelines"
do
travel_to
(
timestamp
)
{
post_graphql
(
query
,
current_user:
user
)
}
expect
(
graphql_data_at
(
:project
,
:pipelineAnalytics
,
:monthPipelinesTotals
).
length
).
to
eq
(
31
)
expect
(
graphql_data_at
(
:project
,
:pipelineAnalytics
,
:monthPipelinesTotals
).
length
).
to
eq
(
expected_quantity
)
expect
(
graphql_data_at
(
:project
,
:pipelineAnalytics
,
:monthPipelinesLabels
).
length
).
to
eq
(
31
)
expect
(
graphql_data_at
(
:project
,
:pipelineAnalytics
,
:monthPipelinesLabels
).
length
).
to
eq
(
expected_quantity
)
end
end
end
it_behaves_like
'monthly statistics'
,
Time
.
zone
.
local
(
2019
,
2
,
28
),
32
it_behaves_like
'monthly statistics'
,
Time
.
zone
.
local
(
2020
,
12
,
30
),
31
it_behaves_like
'monthly statistics'
,
Time
.
zone
.
local
(
2020
,
12
,
31
),
32
it
"contains two arrays of 13 elements each for the year pipelines"
do
it
"contains two arrays of 13 elements each for the year pipelines"
do
post_graphql
(
query
,
current_user:
user
)
post_graphql
(
query
,
current_user:
user
)
...
...
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