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
57fe5a06
Commit
57fe5a06
authored
Apr 13, 2022
by
Andrejs Cunskis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ignore smoke tests in reliable test report
Consistent quotes Fix spec name Quotes v2
parent
2d446d4d
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
13 deletions
+31
-13
qa/qa/support/formatters/test_stats_formatter.rb
qa/qa/support/formatters/test_stats_formatter.rb
+1
-0
qa/qa/tools/reliable_report.rb
qa/qa/tools/reliable_report.rb
+1
-0
qa/spec/support/formatters/test_stats_formatter_spec.rb
qa/spec/support/formatters/test_stats_formatter_spec.rb
+28
-13
qa/spec/tools/reliable_report_spec.rb
qa/spec/tools/reliable_report_spec.rb
+1
-0
No files found.
qa/qa/support/formatters/test_stats_formatter.rb
View file @
57fe5a06
...
...
@@ -64,6 +64,7 @@ module QA
name:
example
.
full_description
,
file_path:
file_path
,
status:
example
.
execution_result
.
status
,
smoke:
example
.
metadata
.
key?
(
:smoke
).
to_s
,
reliable:
example
.
metadata
.
key?
(
:reliable
).
to_s
,
quarantined:
quarantined
(
example
.
metadata
),
retried:
((
example
.
metadata
[
:retry_attempts
]
||
0
)
>
0
).
to_s
,
...
...
qa/qa/tools/reliable_report.rb
View file @
57fe5a06
...
...
@@ -316,6 +316,7 @@ module QA
|> filter(fn: (r) => r.status != "pending" and
r.merge_request == "false" and
r.quarantined == "false" and
r.smoke == "false" and
r.reliable == "
#{
reliable
}
" and
r._field == "id"
)
...
...
qa/spec/support/formatters/test_stats_formatter_spec.rb
View file @
57fe5a06
...
...
@@ -8,14 +8,15 @@ describe QA::Support::Formatters::TestStatsFormatter do
include
QA
::
Specs
::
Helpers
::
RSpec
include
ActiveSupport
::
Testing
::
TimeHelpers
let
(
:url
)
{
"http://influxdb.net"
}
let
(
:token
)
{
"token"
}
let
(
:ci_timestamp
)
{
"2021-02-23T20:58:41Z"
}
let
(
:ci_job_name
)
{
"test-job 1/5"
}
let
(
:ci_job_url
)
{
"url"
}
let
(
:ci_pipeline_url
)
{
"url"
}
let
(
:ci_pipeline_id
)
{
"123"
}
let
(
:url
)
{
'http://influxdb.net'
}
let
(
:token
)
{
'token'
}
let
(
:ci_timestamp
)
{
'2021-02-23T20:58:41Z'
}
let
(
:ci_job_name
)
{
'test-job 1/5'
}
let
(
:ci_job_url
)
{
'url'
}
let
(
:ci_pipeline_url
)
{
'url'
}
let
(
:ci_pipeline_id
)
{
'123'
}
let
(
:run_type
)
{
'staging-full'
}
let
(
:smoke
)
{
'false'
}
let
(
:reliable
)
{
'false'
}
let
(
:quarantined
)
{
'false'
}
let
(
:influx_client
)
{
instance_double
(
'InfluxDB2::Client'
,
create_write_api:
influx_write_api
)
}
...
...
@@ -42,11 +43,12 @@ describe QA::Support::Formatters::TestStatsFormatter do
name:
'stats export spec'
,
file_path:
file_path
.
gsub
(
'./qa/specs/features'
,
''
),
status: :passed
,
smoke:
smoke
,
reliable:
reliable
,
quarantined:
quarantined
,
retried:
"false"
,
job_name:
"test-job"
,
merge_request:
"false"
,
retried:
'false'
,
job_name:
'test-job'
,
merge_request:
'false'
,
run_type:
run_type
,
stage:
stage
.
match
(
%r{
\d
{1,2}_(
\w
+)}
).
captures
.
first
,
testcase:
'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/1234'
...
...
@@ -96,8 +98,8 @@ describe QA::Support::Formatters::TestStatsFormatter do
allow_any_instance_of
(
RSpec
::
Core
::
Example
::
ExecutionResult
).
to
receive
(
:run_time
).
and_return
(
0
)
# rubocop:disable RSpec/AnyInstanceOf
end
context
"without influxdb variables configured"
do
it
"skips export without influxdb url"
do
context
'without influxdb variables configured'
do
it
'skips export without influxdb url'
do
stub_env
(
'QA_INFLUXDB_URL'
,
nil
)
stub_env
(
'QA_INFLUXDB_TOKEN'
,
nil
)
...
...
@@ -106,7 +108,7 @@ describe QA::Support::Formatters::TestStatsFormatter do
expect
(
influx_client
).
not_to
have_received
(
:create_write_api
)
end
it
"skips export without influxdb token"
do
it
'skips export without influxdb token'
do
stub_env
(
'QA_INFLUXDB_URL'
,
url
)
stub_env
(
'QA_INFLUXDB_TOKEN'
,
nil
)
...
...
@@ -146,6 +148,19 @@ describe QA::Support::Formatters::TestStatsFormatter do
end
end
context
'with smoke spec'
do
let
(
:smoke
)
{
'true'
}
it
'exports data to influxdb with correct smoke tag'
do
run_spec
do
it
(
'spec'
,
:smoke
,
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 quarantined spec'
do
let
(
:quarantined
)
{
'true'
}
...
...
qa/spec/tools/reliable_report_spec.rb
View file @
57fe5a06
...
...
@@ -71,6 +71,7 @@ describe QA::Tools::ReliableReport do
|> filter(fn: (r) => r.status != "pending" and
r.merge_request == "false" and
r.quarantined == "false" and
r.smoke == "false" and
r.reliable == "
#{
reliable
}
" and
r._field == "id"
)
...
...
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