From 6be8ae8ba741c4822470f752f60d85fe54bd90f9 Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Fri, 17 Jun 2016 05:55:02 +0000 Subject: Testing: getting tests to run quietly --- bin/test-website | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'bin/test-website') diff --git a/bin/test-website b/bin/test-website index aeab459b..6912b355 100755 --- a/bin/test-website +++ b/bin/test-website @@ -18,10 +18,20 @@ $stderr.print USAGE require 'optparse' -options = {} +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 + when 'xx' + :unknown + else + :small + end + end + o.on('-l','--link-checker', 'Check for dead links') do options[:link_checker] = true end @@ -30,6 +40,10 @@ opts = OptionParser.new do |o| options[:navigation_test] = true end + o.on('--skip-broken', 'Skip tests that are known to be broken') do + options[:skip_broken] = true + end + o.separator "" o.on_tail('-h', '--help', 'display this help and exit') do options[:show_help] = true @@ -43,6 +57,7 @@ if options[:show_help] exit 1 end +$options = options # we are using a global here $host = if ARGV.size>0 ARGV.shift -- cgit v1.2.3 From 0786e53389669bca94953ebb7b737ce7e59111d9 Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Fri, 17 Jun 2016 05:57:27 +0000 Subject: Testing: do not use camelcase for files --- bin/test-website | 2 +- test/lib/NavigationTest.rb | 45 --------------------------------------------- test/lib/navigation.rb | 45 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 46 insertions(+), 46 deletions(-) delete mode 100644 test/lib/NavigationTest.rb create mode 100644 test/lib/navigation.rb (limited to 'bin/test-website') diff --git a/bin/test-website b/bin/test-website index 6912b355..7c7e4390 100755 --- a/bin/test-website +++ b/bin/test-website @@ -83,6 +83,6 @@ else end if options[:navigation_test] - require 'NavigationTest' + require 'navigation' end diff --git a/test/lib/NavigationTest.rb b/test/lib/NavigationTest.rb deleted file mode 100644 index 676ee90c..00000000 --- a/test/lib/NavigationTest.rb +++ /dev/null @@ -1,45 +0,0 @@ -# In these tests we navigate from the main page to a specific trait then hit the different mapping tool buttons (In this case pylMM and r/qtl) followed by computing the results (marker regressions). - - -class NavigationTest -end - -describe NavigationTest do - before do - @agent = Mechanize.new - @agent.agent.http.ca_file = '/etc/ssl/certs/ca-certificates.crt' - end - - describe NavigationTest do - it "pyLMM mapping tool selection" do - break if $options[:skip_broken] - page = @agent.get($host+'/show_trait?trait_id=1435395_s_at&dataset=HC_M2_0606_P') -#Navigates to http://localhost:5003/show_trait?trait_id=1435395_s_at&dataset=HC_M2_0606_P and clicks respective buttons. - link = page.link_with(text: 'pyLMM') - page = link.click - puts page.uri - link = page.link_with(text: 'Compute') - page = link.click - puts page.uri - probe_link.uri.to_s.must_equal "/marker_regression" - end - end - -end - -describe NavigationTest do - it "R/qtl mapping tool selection" do - break if $options[:skip_broken] - page = @agent.get($host+'/show_trait?trait_id=1435395_s_at&dataset=HC_M2_0606_P') - link = page.link_with(text: 'R/qtl') - page = link.click - puts page.uri - form.field_with(:name => 'Methods').options[2].select - link = page.link_with(text: 'Compute') - page = link.click - puts page.uri - probe_link.uri.to_s.must_equal "/marker_regression" - end -end - - diff --git a/test/lib/navigation.rb b/test/lib/navigation.rb new file mode 100644 index 00000000..676ee90c --- /dev/null +++ b/test/lib/navigation.rb @@ -0,0 +1,45 @@ +# In these tests we navigate from the main page to a specific trait then hit the different mapping tool buttons (In this case pylMM and r/qtl) followed by computing the results (marker regressions). + + +class NavigationTest +end + +describe NavigationTest do + before do + @agent = Mechanize.new + @agent.agent.http.ca_file = '/etc/ssl/certs/ca-certificates.crt' + end + + describe NavigationTest do + it "pyLMM mapping tool selection" do + break if $options[:skip_broken] + page = @agent.get($host+'/show_trait?trait_id=1435395_s_at&dataset=HC_M2_0606_P') +#Navigates to http://localhost:5003/show_trait?trait_id=1435395_s_at&dataset=HC_M2_0606_P and clicks respective buttons. + link = page.link_with(text: 'pyLMM') + page = link.click + puts page.uri + link = page.link_with(text: 'Compute') + page = link.click + puts page.uri + probe_link.uri.to_s.must_equal "/marker_regression" + end + end + +end + +describe NavigationTest do + it "R/qtl mapping tool selection" do + break if $options[:skip_broken] + page = @agent.get($host+'/show_trait?trait_id=1435395_s_at&dataset=HC_M2_0606_P') + link = page.link_with(text: 'R/qtl') + page = link.click + puts page.uri + form.field_with(:name => 'Methods').options[2].select + link = page.link_with(text: 'Compute') + page = link.click + puts page.uri + probe_link.uri.to_s.must_equal "/marker_regression" + end +end + + -- cgit v1.2.3 From 497b72d3496b9368167616774e58250598d7bd83 Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Fri, 17 Jun 2016 06:02:18 +0000 Subject: Testing: added default run --- bin/test-website | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'bin/test-website') diff --git a/bin/test-website b/bin/test-website index 7c7e4390..2e91f364 100755 --- a/bin/test-website +++ b/bin/test-website @@ -11,6 +11,10 @@ the root of the genenetwork2 source tree as, for example, ./bin/test-website http://localhost:5003/ (default) +If you are using the small deployment database you can use + + ./bin/test-website --skip -n + For more information see http://genenetwork.org/ EOT -- cgit v1.2.3