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
4d420ac8
Commit
4d420ac8
authored
Feb 04, 2022
by
Andrejs Cunskis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add timestamp field to collected fabrication data
parent
083e8164
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
6 deletions
+24
-6
qa/qa/support/formatters/test_stats_formatter.rb
qa/qa/support/formatters/test_stats_formatter.rb
+3
-2
qa/qa/tools/test_resource_data_processor.rb
qa/qa/tools/test_resource_data_processor.rb
+2
-1
qa/spec/support/formatters/test_stats_formatter_spec.rb
qa/spec/support/formatters/test_stats_formatter_spec.rb
+10
-2
qa/spec/tools/test_resources_data_processor_spec.rb
qa/spec/tools/test_resources_data_processor_spec.rb
+9
-1
No files found.
qa/qa/support/formatters/test_stats_formatter.rb
View file @
4d420ac8
...
...
@@ -99,7 +99,7 @@ module QA
# @param [Symbol] http_method
# @param [Integer] fabrication_time
# @return [Hash]
def
fabrication_stats
(
resource
:,
info
:,
fabrication_method
:,
http_method
:,
fabrication_time
:,
**
)
def
fabrication_stats
(
resource
:,
info
:,
fabrication_method
:,
http_method
:,
fabrication_time
:,
timestamp
:,
**
)
{
name:
'fabrication-stats'
,
time:
time
,
...
...
@@ -113,7 +113,8 @@ module QA
fields:
{
fabrication_time:
fabrication_time
,
info:
info
,
job_url:
QA
::
Runtime
::
Env
.
ci_job_url
job_url:
QA
::
Runtime
::
Env
.
ci_job_url
,
timestamp:
timestamp
}
}
end
...
...
qa/qa/tools/test_resource_data_processor.rb
View file @
4d420ac8
...
...
@@ -38,7 +38,8 @@ module QA
api_path:
api_path
,
fabrication_method:
fabrication_method
,
fabrication_time:
fabrication_time
,
http_method:
resource
.
api_fabrication_http_method
http_method:
resource
.
api_fabrication_http_method
,
timestamp:
Time
.
now
.
to_s
}
end
...
...
qa/spec/support/formatters/test_stats_formatter_spec.rb
View file @
4d420ac8
# frozen_string_literal: true
require
'rspec/core/sandbox'
require
'active_support/testing/time_helpers'
describe
QA
::
Support
::
Formatters
::
TestStatsFormatter
do
include
QA
::
Support
::
Helpers
::
StubEnv
include
QA
::
Specs
::
Helpers
::
RSpec
include
ActiveSupport
::
Testing
::
TimeHelpers
let
(
:url
)
{
"http://influxdb.net"
}
let
(
:token
)
{
"token"
}
...
...
@@ -214,7 +216,8 @@ describe QA::Support::Formatters::TestStatsFormatter do
api_path:
'/project'
,
fabrication_method: :api
,
fabrication_time:
1
,
http_method: :post
http_method: :post
,
timestamp:
Time
.
now
.
to_s
}]
}
end
...
...
@@ -233,11 +236,16 @@ describe QA::Support::Formatters::TestStatsFormatter do
fields:
{
fabrication_time:
1
,
info:
"with id '1'"
,
job_url:
ci_job_url
job_url:
ci_job_url
,
timestamp:
Time
.
now
.
to_s
}
}
end
around
do
|
example
|
freeze_time
{
example
.
run
}
end
it
'exports fabrication stats data to influxdb'
do
run_spec
...
...
qa/spec/tools/test_resources_data_processor_spec.rb
View file @
4d420ac8
# frozen_string_literal: true
require
'active_support/testing/time_helpers'
RSpec
.
describe
QA
::
Tools
::
TestResourceDataProcessor
do
include
QA
::
Support
::
Helpers
::
StubEnv
include
ActiveSupport
::
Testing
::
TimeHelpers
subject
(
:processor
)
{
Class
.
new
(
described_class
).
instance
}
...
...
@@ -19,7 +22,8 @@ RSpec.describe QA::Tools::TestResourceDataProcessor do
api_path:
api_path
,
fabrication_method:
method
,
fabrication_time:
time
,
http_method: :post
http_method: :post
,
timestamp:
Time
.
now
.
to_s
}]
}
end
...
...
@@ -28,6 +32,10 @@ RSpec.describe QA::Tools::TestResourceDataProcessor do
processor
.
collect
(
resource:
resource
,
info:
info
,
fabrication_method:
method
,
fabrication_time:
time
)
end
around
do
|
example
|
freeze_time
{
example
.
run
}
end
describe
'.collect'
do
it
'collects and stores resource'
do
expect
(
processor
.
resources
).
to
eq
(
result
)
...
...
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