NIHVIVO-76 First pass at actually ignoring tests
This commit is contained in:
parent
854f256a05
commit
786321b54d
3 changed files with 50 additions and 4 deletions
|
@ -4,16 +4,17 @@
|
||||||
website_url = http://localhost:8080/vivo/
|
website_url = http://localhost:8080/vivo/
|
||||||
test_root_directory = /home/jeb228/Documents/workspaces/vivo/utilities/acceptance-tests/suites
|
test_root_directory = /home/jeb228/Documents/workspaces/vivo/utilities/acceptance-tests/suites
|
||||||
output_directory = /home/jeb228/Documents/workspaces/vivo/utilities/acceptance-tests/output
|
output_directory = /home/jeb228/Documents/workspaces/vivo/utilities/acceptance-tests/output
|
||||||
|
ignored_tests_file = /home/jeb228/Documents/workspaces/vivo/utilities/acceptance-tests/script/ignored_tests.txt
|
||||||
user_extensions_path = /home/jeb228/Documents/workspaces/vivo/utilities/acceptance-tests/selenium/user-extensions.js
|
user_extensions_path = /home/jeb228/Documents/workspaces/vivo/utilities/acceptance-tests/selenium/user-extensions.js
|
||||||
firefox_profile_template_path = /home/jeb228/Documents/workspaces/vivo/utilities/acceptance-tests/selenium/firefox-profile
|
firefox_profile_template_path = /home/jeb228/Documents/workspaces/vivo/utilities/acceptance-tests/selenium/firefox-profile
|
||||||
suite_timeout_limit = 180
|
suite_timeout_limit = 210
|
||||||
selenium_jar_path = /home/jeb228/Documents/workspaces/vivo/utilities/acceptance-tests/selenium/selenium-server.jar
|
selenium_jar_path = /home/jeb228/Documents/workspaces/vivo/utilities/acceptance-tests/selenium/selenium-server.jar
|
||||||
|
|
||||||
#
|
#
|
||||||
# These properties are needed to cleanse the data model between test suites.
|
# These properties are needed to cleanse the data model between test suites.
|
||||||
#
|
#
|
||||||
tomcat_stop_command = /usr/local/tomcat/bin/shutdown.sh
|
tomcat_stop_command = /usr/local/tomcat/bin/shutdown.sh
|
||||||
tomcat_stop_delay = 2
|
tomcat_stop_delay = 5
|
||||||
tomcat_start_command = /usr/local/tomcat/bin/startup.sh
|
tomcat_start_command = /usr/local/tomcat/bin/startup.sh
|
||||||
tomcat_start_delay = 180
|
tomcat_start_delay = 180
|
||||||
mysql_username = vitrodbUsername
|
mysql_username = vitrodbUsername
|
||||||
|
|
2
utilities/acceptance-tests/script/ignored_tests.txt
Normal file
2
utilities/acceptance-tests/script/ignored_tests.txt
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
# This test is known to fail, because not all pages come up properly if bookmarked.
|
||||||
|
user-management, Bookmark Without Logging In
|
|
@ -80,6 +80,42 @@ class OutputManager
|
||||||
if !File.writable?(@output_directory)
|
if !File.writable?(@output_directory)
|
||||||
raise "Output directory '#{@output_directory}' is not writable."
|
raise "Output directory '#{@output_directory}' is not writable."
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if @ignored_tests_file == nil
|
||||||
|
raise("Properties file must contain a value for 'ignored_tests_file'")
|
||||||
|
end
|
||||||
|
|
||||||
|
if !File.exist?(@ignored_tests_file)
|
||||||
|
raise "Ignored tests file '#{@ignored_tests_file}' does not exist."
|
||||||
|
end
|
||||||
|
|
||||||
|
if !File.readable?(@ignored_tests_file)
|
||||||
|
raise "Ignored tests file '#{@ignored_tests_file}' is not readable."
|
||||||
|
end
|
||||||
|
|
||||||
|
if !File.file?(@ignored_tests_file)
|
||||||
|
raise "Ignored tests file '#{@ignored_tests_file}' is not a file."
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# Load the list of ignored tests. Each line is [suite_name], [test_name]
|
||||||
|
#
|
||||||
|
def load_list_of_ignored_tests()
|
||||||
|
ignored_tests = []
|
||||||
|
File.open(@ignored_tests_file) do |f|
|
||||||
|
f.each_line do |line|
|
||||||
|
line.strip!
|
||||||
|
if line.length == 0 || line[0] == ?# || line[0] == ?!
|
||||||
|
# ignore blank lines, and lines starting with '#' or '!'.
|
||||||
|
elsif line =~ /^([^,]+),([^,]+)$/
|
||||||
|
# suite name and test name separated by ',' and optional whitespace.
|
||||||
|
ignored_tests << [$1.strip, $2.strip]
|
||||||
|
else
|
||||||
|
raise "Invalid line in ignored tests file: '#{line}'"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return ignored_tests
|
||||||
end
|
end
|
||||||
|
|
||||||
# The CSS file for the output summary exists in the script directory.
|
# The CSS file for the output summary exists in the script directory.
|
||||||
|
@ -99,14 +135,18 @@ class OutputManager
|
||||||
#
|
#
|
||||||
def initialize(properties)
|
def initialize(properties)
|
||||||
@output_directory = properties['output_directory']
|
@output_directory = properties['output_directory']
|
||||||
|
@ignored_tests_file = properties['ignored_tests_file']
|
||||||
|
|
||||||
sanity_checks_on_parameters()
|
sanity_checks_on_parameters()
|
||||||
|
|
||||||
@log_file = File.expand_path("log_file.txt", @output_directory)
|
@log_file = File.expand_path("log_file.txt", @output_directory)
|
||||||
FileUtils::remove_file(@log_file) if File.exist?(@log_file)
|
FileUtils::remove_file(@log_file) if File.exist?(@log_file)
|
||||||
|
|
||||||
@output_summary_file = File.expand_path("summary.html", @output_directory)
|
@output_summary_file = File.expand_path("index.html", @output_directory)
|
||||||
FileUtils::remove_file(@output_summary_file) if File.exist?(@output_summary_file)
|
FileUtils::remove_file(@output_summary_file) if File.exist?(@output_summary_file)
|
||||||
|
|
||||||
|
@ignored_tests = load_list_of_ignored_tests()
|
||||||
|
puts ">>>ignored tests: #{@ignored_tests}"
|
||||||
end
|
end
|
||||||
|
|
||||||
# Write a message to the log file
|
# Write a message to the log file
|
||||||
|
@ -126,7 +166,10 @@ class OutputManager
|
||||||
# Have we decided to ignore this test if it fails?
|
# Have we decided to ignore this test if it fails?
|
||||||
#
|
#
|
||||||
def ignore_test?(suite_name, test_name)
|
def ignore_test?(suite_name, test_name)
|
||||||
false
|
@ignored_tests.each do |pair|
|
||||||
|
return true if pair[0] == suite_name && pair[1] == test_name
|
||||||
|
end
|
||||||
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
def summarize()
|
def summarize()
|
||||||
|
|
Loading…
Add table
Reference in a new issue