Commit 1dd1f6a0 authored by Harald Sitter's avatar Harald Sitter

softfail is now a result key

previously softfailures had nested screenshots, apparently they can now
simply also have a result type of softfail but no nested screenshot detail

map the new behavior. softfaildetail now accepts such failure hashes, gets
mapped to passed in junit same as the previous softfail which was result
unknown

I kinda thing this should skipped but whatever, I presume past-me knew
what he was doing
parent 66a049d6
......@@ -36,6 +36,7 @@ class JUnit
ok: JenkinsJunitBuilder::Case::RESULT_PASSED,
fail: JenkinsJunitBuilder::Case::RESULT_FAILURE,
unknown: JenkinsJunitBuilder::Case::RESULT_PASSED,
softfail: JenkinsJunitBuilder::Case::RESULT_PASSED,
# It's actually unclear why canceled appears. Code suggests it's set when
# the test runner gets TERM. Question is why it would I guess. In any
# event we'll consider this a failure.
......@@ -88,12 +89,19 @@ class JUnit
# to give useful data.
super
self.name = detail.title
screenshot = ''
# In newer os-autoinst softfails may also simply have result:softfail
# instead of nesting another detail with screenshot. In that case
# we have nothing to add and can simply leave the empty string
unless detail.result.is_a?(Symbol)
screenshot = artifact_url(detail.result.screenshot)
end
system_out << <<-STDOUT
We recorded a soft failure, this isn't a failed assertion but rather
indicates that something is (temporarily) wrong with the expecations.
This event was programtically created, check the code of the test case.
#{artifact_url(detail.text)}
#{artifact_url(detail.result.screenshot)}
#{screenshot}
STDOUT
end
......
......@@ -141,7 +141,8 @@ module OSAutoInst
end
def init_result
results = { 'unk' => :unknown, 'ok' => :ok, 'fail' => :fail }
results = { 'unk' => :unknown, 'ok' => :ok, 'fail' => :fail,
'softfail' => :softfail }
@result = results.fetch(result) do
result.is_a?(Hash)
begin
......@@ -210,11 +211,13 @@ module OSAutoInst
# differently when converting to junit.
def self.need?(data)
data[:result] && data[:result].is_a?(Hash)
(data[:result] && data[:result].is_a?(Hash)) ||
data[:result] == 'softfail'
end
def self.want?(data)
data[:result] && data[:result].is_a?(Hash)
(data[:result] && data[:result].is_a?(Hash)) ||
data[:result] == 'softfail'
end
end
......
......@@ -677,7 +677,12 @@
"similarity" : 100
}
]
}
},
{
"result": "softfail",
"text": "first_start-119.txt",
"title": "Soft Failed"
}
],
"result" : "ok",
"dents" : 0
......
{
"result": "softfail",
"text": "first_start-119.txt",
"title": "Soft Failed"
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment