diff options
author | Muriithi Frederick Muriuki | 2018-04-05 09:35:41 +0300 |
---|---|---|
committer | Muriithi Frederick Muriuki | 2018-04-05 09:35:41 +0300 |
commit | 90c367b206a846a08ce4bb06eeed7be31fe1c367 (patch) | |
tree | fe47ef5f4158494d49fdbca5a85c3985b37bed7c /bin | |
parent | 31747256e466456cc88aac60780836a6534f18cd (diff) | |
parent | b152aca03be73655d2fb5eda17d533504ed900e2 (diff) | |
download | genenetwork2-90c367b206a846a08ce4bb06eeed7be31fe1c367.tar.gz |
Merge branch 'testing' of https://github.com/genenetwork/genenetwork2 into testing
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/genenetwork2 | 18 | ||||
-rwxr-xr-x | bin/mechnical-rob | 111 |
2 files changed, 12 insertions, 117 deletions
diff --git a/bin/genenetwork2 b/bin/genenetwork2 index 3f06e7f9..18e02388 100755 --- a/bin/genenetwork2 +++ b/bin/genenetwork2 @@ -21,10 +21,18 @@ # # env GN2_PROFILE=~/opt/gn-latest-guix ./bin/genenetwork2 ~/my_settings.py # -# To run a maintenance script with settings (instead of the webserver) add that with -# a -c switch, e.g. +# To run a maintenance python script with settings (instead of the +# webserver) add that with a -c switch, e.g. # -# env GN2_PROFILE=~/opt/gn-latest-guix ./bin/genenetwork2 ~/my_overrides.json -c ./wqflask/maintenance/gen_select_dataset.py +# env GN2_PROFILE=~/opt/gn-latest-guix ./bin/genenetwork2 -c ./wqflask/maintenance/gen_select_dataset.py +# +# To run any script in the environment +# +# env GN2_PROFILE=~/opt/gn-latest-guix ./bin/genenetwork2 ./etc/default_settings.py -cli echo "HELLO WORLD" +# +# To get a python REPL(!) +# +# env GN2_PROFILE=~/opt/gn-latest-guix ./bin/genenetwork2 ./etc/default_settings.py -cli python # # For development you may want to run # @@ -114,7 +122,6 @@ else export PATH=$GN2_PROFILE/bin:$PATH export PYTHONPATH="$GN2_PROFILE/lib/python2.7/site-packages" # never inject another PYTHONPATH!! export R_LIBS_SITE=$GN2_PROFILE/site-library - export GEM_PATH=$GN2_PROFILE/lib/ruby/gems/2.4.0 export JS_GUIX_PATH=$GN2_PROFILE/share/genenetwork2/javascript export GUIX_GTK3_PATH="$GN2_PROFILE/lib/gtk-3.0" export GI_TYPELIB_PATH="$GN2_PROFILE/lib/girepository-1.0" @@ -134,7 +141,6 @@ else done done <<< "$PYTHONPATH" if [ ! -d $R_LIBS_SITE ] ; then echo "R_LIBS_SITE not valid "$R_LIBS_SITE ; exit 1 ; fi - if [ ! -d $GEM_PATH ] ; then echo "GEM_PATH not valid "$GEM_PATH ; exit 1 ; fi fi if [ -z $PYTHONPATH ] ; then echo "ERROR PYTHONPATH has not been set - use GN2_PROFILE!" @@ -170,9 +176,9 @@ if [ "$1" = '-c' ] ; then python $cmd $* exit $? fi + # Now handle command parameter -cli which runs in bash if [ "$1" = "-cli" ] ; then - echo "HERE" cd $GN2_BASE_DIR/wqflask cmd=$2 echo PYTHONPATH=$PYTHONPATH diff --git a/bin/mechnical-rob b/bin/mechnical-rob deleted file mode 100755 index be223d94..00000000 --- a/bin/mechnical-rob +++ /dev/null @@ -1,111 +0,0 @@ -#!/usr/bin/env ruby - - -USAGE = <<EOT -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, - - ./bin/test-website http://localhost:5003/ (default) - -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 - -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 - when 'xx' - :unknown - else - :small - 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('--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 - options[:skip_broken] = true - end - - o.separator "" - o.on_tail('-h', '--help', 'display this help and exit') do - options[:show_help] = true - end -end - -opts.parse!(ARGV) - -if options[:show_help] - print opts - exit 1 -end - -$options = options # we are using a global here -$host = - if ARGV.size>0 - ARGV.shift - else - "http://localhost:5003" - end - -$stderr.print "Testing <",$host,">\n" - -require 'mechanize' -require 'minitest/spec' -require 'minitest/autorun' - -# These are the actual testing modules - -libpath = File.dirname(File.dirname(__FILE__)) -$: << File.join(libpath,'test/lib') - -require 'main_web_functionality' - -if options[:all] or options[:mapping] - require 'mapping' -end - -if options[:all] or options[:link_checker] - require 'link_checker' -end - -if options[:all] or options[:navigation] - require 'navigation' -end |