NIHVIVO-76 Add a reason for ignoring each test.
This commit is contained in:
parent
786321b54d
commit
27f7fc2e85
4 changed files with 26 additions and 9 deletions
|
@ -1,2 +0,0 @@
|
|||
# This test is known to fail, because not all pages come up properly if bookmarked.
|
||||
user-management, Bookmark Without Logging In
|
|
@ -36,6 +36,7 @@ class TestInfo
|
|||
attr :suite_name, true
|
||||
attr :output_link, true
|
||||
attr :status, true
|
||||
attr :reason_for_ignoring, true
|
||||
end
|
||||
|
||||
class SuiteInfo
|
||||
|
@ -107,9 +108,14 @@ class OutputManager
|
|||
line.strip!
|
||||
if line.length == 0 || line[0] == ?# || line[0] == ?!
|
||||
# ignore blank lines, and lines starting with '#' or '!'.
|
||||
elsif line =~ /^([^,]+),([^,]+)$/
|
||||
elsif line =~ /^([^,#]+),([^,#]+)(\s*#(.*))?$/
|
||||
# suite name and test name separated by ',' and optional whitespace.
|
||||
ignored_tests << [$1.strip, $2.strip]
|
||||
# Optional comment on the end of the line, starting with a '#'
|
||||
if $4 == nil
|
||||
ignored_tests << [$1.strip, $2.strip, '']
|
||||
else
|
||||
ignored_tests << [$1.strip, $2.strip, $4]
|
||||
end
|
||||
else
|
||||
raise "Invalid line in ignored tests file: '#{line}'"
|
||||
end
|
||||
|
@ -166,12 +172,23 @@ class OutputManager
|
|||
# Have we decided to ignore this test if it fails?
|
||||
#
|
||||
def ignore_test?(suite_name, test_name)
|
||||
@ignored_tests.each do |pair|
|
||||
return true if pair[0] == suite_name && pair[1] == test_name
|
||||
@ignored_tests.each do |t|
|
||||
return true if t[0] == suite_name && t[1] == test_name
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
# Why are we ignoring this test?
|
||||
#
|
||||
def get_reason_for_ignoring(suite_name, test_name)
|
||||
@ignored_tests.each do |t|
|
||||
return t[2] if t[0] == suite_name && t[1] == test_name
|
||||
end
|
||||
return ''
|
||||
end
|
||||
|
||||
# This is the big one -- produce the output summary.
|
||||
#
|
||||
def summarize()
|
||||
@osp = OutputSuiteParser.new(self, @log_file)
|
||||
@osp.parse()
|
||||
|
|
|
@ -95,6 +95,7 @@ class OutputSuiteParser
|
|||
t.status = Status::GOOD
|
||||
elsif @output_manager.ignore_test?(t.suite_name, t.test_name)
|
||||
t.status = Status::FAIR
|
||||
t.reason_for_ignoring = @output_manager.get_reason_for_ignoring(t.suite_name, t.test_name)
|
||||
else
|
||||
t.status = Status::BAD
|
||||
end
|
||||
|
|
|
@ -55,7 +55,7 @@ class OutputSummaryFormatter
|
|||
<body>
|
||||
|
||||
<div class="heading">
|
||||
Acceptance test results: 3:45 p.m. March 10, 2010
|
||||
Acceptance test results: #{@osp.start_time}
|
||||
<div class="#{html_class} one-word">#{status}</div>
|
||||
</div>
|
||||
|
||||
|
@ -166,7 +166,7 @@ END_STATS
|
|||
end
|
||||
|
||||
f.print " <div class=section>Ignored tests</div>\n\n <table cellspacing=\"0\">\n"
|
||||
f.print " <tr><th>Suite name</th><th>Test name</th></tr>\n"
|
||||
f.print " <tr><th>Suite name</th><th>Test name</th><th>Reason for ignoring</th></tr>\n"
|
||||
|
||||
if ignores.empty?
|
||||
f.print " <tr>\n"
|
||||
|
@ -177,6 +177,7 @@ END_STATS
|
|||
f.print " <tr class=\"#{Status::html_class(t.status)}\">\n"
|
||||
f.print " <td>#{t.suite_name}</td>\n"
|
||||
f.print " <td><a href=\"#{t.output_link}\">#{t.test_name}</a></td>\n"
|
||||
f.print " <td>#{t.reason_for_ignoring}</td>\n"
|
||||
f.print " </tr>\n"
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue