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
536b5dfc
Commit
536b5dfc
authored
Feb 20, 2022
by
Andrejs Cunskis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correctly export quarantine status for exported metrics
parent
b627a22a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
1 deletion
+29
-1
qa/qa/support/formatters/test_stats_formatter.rb
qa/qa/support/formatters/test_stats_formatter.rb
+12
-1
qa/spec/support/formatters/test_stats_formatter_spec.rb
qa/spec/support/formatters/test_stats_formatter_spec.rb
+17
-0
No files found.
qa/qa/support/formatters/test_stats_formatter.rb
View file @
536b5dfc
...
@@ -66,7 +66,7 @@ module QA
...
@@ -66,7 +66,7 @@ module QA
file_path:
file_path
,
file_path:
file_path
,
status:
example
.
execution_result
.
status
,
status:
example
.
execution_result
.
status
,
reliable:
example
.
metadata
.
key?
(
:reliable
).
to_s
,
reliable:
example
.
metadata
.
key?
(
:reliable
).
to_s
,
quarantined:
example
.
metadata
.
key?
(
:quarantine
).
to_s
,
quarantined:
quarantined
(
example
.
metadata
)
,
retried:
((
example
.
metadata
[
:retry_attempts
]
||
0
)
>
0
).
to_s
,
retried:
((
example
.
metadata
[
:retry_attempts
]
||
0
)
>
0
).
to_s
,
job_name:
job_name
,
job_name:
job_name
,
merge_request:
merge_request
,
merge_request:
merge_request
,
...
@@ -170,6 +170,17 @@ module QA
...
@@ -170,6 +170,17 @@ module QA
end
end
end
end
# Is spec quarantined
#
# @param [Hash] metadata
# @return [String]
def
quarantined
(
metadata
)
return
"false"
unless
metadata
.
key?
(
:quarantine
)
return
"true"
unless
metadata
[
:quarantine
].
is_a?
(
Hash
)
(
!
Specs
::
Helpers
::
Quarantine
.
quarantined_different_context?
(
metadata
[
:quarantine
])).
to_s
end
# Print log message
# Print log message
#
#
# @param [Symbol] level
# @param [Symbol] level
...
...
qa/spec/support/formatters/test_stats_formatter_spec.rb
View file @
536b5dfc
...
@@ -157,6 +157,23 @@ describe QA::Support::Formatters::TestStatsFormatter do
...
@@ -157,6 +157,23 @@ describe QA::Support::Formatters::TestStatsFormatter do
end
end
end
end
context
'with context quarantined spec'
do
let
(
:quarantined
)
{
'false'
}
it
'exports data to influxdb with correct qurantine tag'
do
run_spec
do
it
(
'spec'
,
quarantine:
{
only:
{
job:
'praefect'
}
},
testcase:
'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/1234'
)
{}
end
expect
(
influx_write_api
).
to
have_received
(
:write
).
once
expect
(
influx_write_api
).
to
have_received
(
:write
).
with
(
data:
[
data
])
end
end
context
'with staging full run'
do
context
'with staging full run'
do
let
(
:run_type
)
{
'staging-full'
}
let
(
:run_type
)
{
'staging-full'
}
...
...
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