aboutsummaryrefslogtreecommitdiff
path: root/bin/test-website
diff options
context:
space:
mode:
Diffstat (limited to 'bin/test-website')
-rwxr-xr-xbin/test-website49
1 files changed, 34 insertions, 15 deletions
diff --git a/bin/test-website b/bin/test-website
index 2e91f364..be223d94 100755
--- a/bin/test-website
+++ b/bin/test-website
@@ -2,9 +2,9 @@
USAGE = <<EOT
-This is Mechanical-Rob - an automated web server tester for
- Genenetwork.org that uses the brilliant
- mechanize gem.
+This is Mechanical-Rob - an automated web server tester for
+ Genenetwork.org that uses the brilliant
+ mechanize gem with minitest.
To use this software you need to install mechanize. Run it from
the root of the genenetwork2 source tree as, for example,
@@ -15,8 +15,16 @@ If you are using the small deployment database you can use
./bin/test-website --skip -n
+To run all tests
+
+ ./bin/test-website --all
+
+To run individual tests on localhost you can do
+
+ ruby -Itest -Itest/lib test/lib/mapping.rb --name="/Mapping/"
+
For more information see http://genenetwork.org/
-
+
EOT
$stderr.print USAGE
@@ -25,7 +33,7 @@ require 'optparse'
options = { database: :small, link_checker: false}
opts = OptionParser.new do |o|
o.banner = "Usage: #{File.basename($0)} [options] URL"
-
+
o.on('-d','--database', String, 'Use database (default db_webqtl_s)') do |s|
options[:database] =
case s
@@ -36,12 +44,20 @@ opts = OptionParser.new do |o|
end
end
+ o.on('--all', 'Run all tests') do
+ options[:all] = true
+ end
+
o.on('-l','--link-checker', 'Check for dead links') do
options[:link_checker] = true
end
-
- o.on('-n','--navigation-test', 'Check for navigation test results') do
- options[:navigation_test] = true
+
+ o.on('--navigation', 'Check for navigation') do
+ options[:navigation] = true
+ end
+
+ o.on('--mapping', 'Check for mapping') do
+ options[:mapping] = true
end
o.on('--skip-broken', 'Skip tests that are known to be broken') do
@@ -62,7 +78,7 @@ if options[:show_help]
end
$options = options # we are using a global here
-$host =
+$host =
if ARGV.size>0
ARGV.shift
else
@@ -80,13 +96,16 @@ require 'minitest/autorun'
libpath = File.dirname(File.dirname(__FILE__))
$: << File.join(libpath,'test/lib')
-if options[:link_checker]
+require 'main_web_functionality'
+
+if options[:all] or options[:mapping]
+ require 'mapping'
+end
+
+if options[:all] or options[:link_checker]
require 'link_checker'
-else
- require 'main_web_functionality'
end
-
-if options[:navigation_test]
+
+if options[:all] or options[:navigation]
require 'navigation'
end
-