view · edit · sidebar · attach · print · history

Index>

20170110-oddb-org-ruby-240

Summary

Commits

Index

Port oddb.org to Ruby 2.4.0

Fixing undefined method `unit' for 1:Integer. Using pry to debug the problem. Created a test case and fixed the problem. Now I can start and visit oddb-ci2. Migel does not work. Doctor http://oddb-ci2.dyndns.org/de/gcc/doctor/ean/7601000850614 displays [] for Facharzttitel. Pages take a long time to display. I think that the ads often point to https pages with an invalid key. E.g. ad.zanox.com, which gets redirected to https://ui.zanox-affiliate.de/bin/z_in_frm.dll and displays

Your connection is not secure
The owner of ui.zanox-affiliate.de has configured their website improperly. To protect your information from being stolen,
Firefox has not connected to this website.

Pushed commits:

Smoketest results are

Finished in 7 minutes 30 seconds (files took 1.67 seconds to load)
30 examples, 11 failures, 1 pending
Failed examples:
rspec ./spec/smoketest_spec.rb:84 # ch.oddb.org should display the correct color iscador U
rspec ./spec/smoketest_spec.rb:107 # ch.oddb.org should display a limitation link for Sevikar
rspec ./spec/smoketest_spec.rb:127 # ch.oddb.org should display lamivudin with SO and SG in category (price comparision)
rspec ./spec/smoketest_spec.rb:185 # ch.oddb.org should have a link to the migel
rspec ./spec/smoketest_spec.rb:192 # ch.oddb.org should find Aspirin
rspec ./spec/smoketest_spec.rb:203 # ch.oddb.org should find inderal
rspec ./spec/smoketest_spec.rb:230 # ch.oddb.org should have a link to the english language versions
rspec ./spec/smoketest_spec.rb:268 # ch.oddb.org should open a package specific patinfo
rspec ./spec/smoketest_spec.rb:286 # ch.oddb.org should show correct Tramal Tropfen Lösung zum Einnehmen ohne Dosierpumpe(4788/01/086)
rspec ./spec/smoketest_spec.rb:312 # ch.oddb.org should download the example
rspec ./spec/smoketest_spec.rb:351 # ch.oddb.org should download the results of a search

The search for "iscador U" fails, because the apache config still contains ruby 1.9 paths. It containts paths like /usr/local/lib64/ruby/gems/1.9.1/gems/sbsm-1.2.3/lib. Running sudo /usr/local/bin/ruby-2.4.0/bin/gem install sbsm --version=1.3.0. Replaced these pahts by /usr/local/bin/ruby-2.4.0/lib/ruby/gems/2.4.0/gems/sbsm-1.3.0

Now I am getting the following errors

==> log/oddb/access_log <==
172.25.1.70 - - [10/Jan/2017:09:31:52 +0100] "GET /de/gcc/search/zone/drugs/search_query/iscador/search_type/st_oddb HTTP/1.1" 404 - "http://oddb-ci2.dyndns.org/" "Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0"

==> log/oddb/error_log <==
[Tue Jan 10 09:31:52 2017] [error] mod_ruby: error in ruby
[Tue Jan 10 09:31:52 2017] [error] mod_ruby: /usr/local/bin/ruby186/lib/ruby/site_ruby/1.8/rubygems/specification.rb:504:in `file?': Insecure operation - file? (SecurityError)
[Tue Jan 10 09:31:52 2017] [error] mod_ruby:   from /usr/local/bin/ruby186/lib/ruby/site_ruby/1.8/rubygems/specification.rb:504:in `load'
[Tue Jan 10 09:31:52 2017] [error] mod_ruby:   from /usr/local/bin/ruby186/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:121:in `load_gems_in'
[Tue Jan 10 09:31:52 2017] [error] mod_ruby:   from /usr/local/bin/ruby186/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:120:in `each'
[Tue Jan 10 09:31:52 2017] [error] mod_ruby:   from /usr/local/bin/ruby186/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:120:in `load_gems_in'
[Tue Jan 10 09:31:52 2017] [error] mod_ruby:   from /usr/local/bin/ruby186/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:117:in `reverse_each'
[Tue Jan 10 09:31:52 2017] [error] mod_ruby:   from /usr/local/bin/ruby186/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:117:in `load_gems_in'
[Tue Jan 10 09:31:52 2017] [error] mod_ruby:   from /usr/local/bin/ruby186/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:313:in `refresh!'
[Tue Jan 10 09:31:52 2017] [error] mod_ruby:   from /usr/local/bin/ruby186/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:72:in `from_gems_in'
[Tue Jan 10 09:31:52 2017] [error] mod_ruby:    ... 6 levels...
[Tue Jan 10 09:31:52 2017] [error] mod_ruby:   from /usr/local/bin/ruby186/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in `require'
[Tue Jan 10 09:31:52 2017] [error] mod_ruby:   from /var/www/oddb.org/doc/index.rbx:7
[Tue Jan 10 09:31:52 2017] [error] mod_ruby:   from /usr/local/bin/ruby186/lib/ruby/1.8/apache/ruby-run.rb:53:in `load'
[Tue Jan 10 09:31:52 2017] [error] mod_ruby:   from /usr/local/bin/ruby186/lib/ruby/1.8/apache/ruby-run.rb:53:in `handler'
[Tue Jan 10 09:31:52 2017] [error] [client 172.25.1.70] File does not exist: /var/www/oddb.org/doc/var/www, referer: http://oddb-ci2.dyndns.org/

But mod_ruby 1.8.6 should not include any Ruby 2.x code. But the SBSM version must be compatible. Maybe I must also use a ::

Changed the paths in /etc/apache2/vhosts.d/oddb.conf to

  RubyAddPath /var/www/oddb.org/src
  RubyAddPath /usr/local/bin/ruby186/lib/ruby/gems/1.8/gems/sbsm-1.2.6/lib
  RubyAddPath /usr/local/bin/ruby186/lib/ruby/gems/1.8/gems/rclconf-1.0.0/lib
  RubyRequire 'sbsm/trans_handler'
  RubyTransHandler SBSM::FlavoredTransHandler.instance

Changed ruby -> ruby193 in line exec sudo -u apache /usr/local/bin/ruby193 bin/migeld of file /service/migeld/run. Same in /service/currency/run

Changed in Gemfile htmlgrid -> 1.0.8 and sbsm -> 1.2.7. Now the migel displays the correct price for Krücke and searching for Iscador U works, too. Running whole spec test now. Got the following errors

Failed examples:

rspec ./spec/address_correction_spec.rb:84 # ch.oddb.org should be possible to correct an address for a company
rspec ./spec/admin_spec.rb:129 # ch.oddb.org should be possible to create a CompanyUser
rspec ./spec/download_spec.rb:45 # ch.oddb.org should be possible to run a bin/admin command
rspec ./spec/download_spec.rb:73 # ch.oddb.org should be possible to run grant_download oddb2.csv
rspec ./spec/evidentia_spec.rb:117 # ch.oddb.org should contain a link to the price comparision in price public
rspec ./spec/preferences_spec.rb:15 # ch.oddb.org should save zsr in preferences
rspec ./spec/rezept_and_instantsearch_spec.rb:374 # ch.oddb.org should print a correct prescription with comments, personal information, doctor info and a drug
rspec ./spec/rezept_and_instantsearch_spec.rb:400 # ch.oddb.org should contain remarks or interaction header only when present
rspec ./spec/rezept_and_instantsearch_spec.rb:420 # ch.oddb.org should print the fachinfo when opening the fachinfo from a prescription
rspec ./spec/rezept_and_instantsearch_spec.rb:439 # ch.oddb.org should enable to go back after printing a prescription
rspec ./spec/rezept_and_instantsearch_spec.rb:452 # ch.oddb.org should not loose existing comment after adding a new prescription
rspec ./spec/rezept_and_instantsearch_spec.rb:571 # ch.oddb.org should be possible to print a presciption with 10 drugs
rspec ./spec/searchbar_spec.rb[1:2] # ch.oddb.org should be possible to find 1,25-Dihydroxycholecalciferol when searching via 125 in analysen
rspec ./spec/searchbar_spec.rb:339 # ch.oddb.org should show no drugs for Fortex via unwanted effects search
rspec ./spec/searchbar_spec.rb:391 # ch.oddb.org should set best_result when searching Rivoleve via search_type
rspec ./spec/smoketest_spec.rb:84 # ch.oddb.org should display the correct color iscador U
rspec ./spec/smoketest_spec.rb:150 # ch.oddb.org should show a registration info
rspec ./spec/smoketest_spec.rb:160 # ch.oddb.org should show a sequence info
rspec ./spec/smoketest_spec.rb:231 # ch.oddb.org should have a link to the english language versions
rspec ./spec/smoketest_spec.rb:269 # ch.oddb.org should open a package specific patinfo
rspec ./spec/smoketest_spec.rb:297 # ch.oddb.org should open print fachinfo in a new window

Fixing smoketest which opens a PDF of a patinfo. Now all failing smoketests passed when running individually. Fixed also an error in spec/evidentia_spec.rb:117. Also fixed spec/address_correction_spec.rb:84.

Added --program-suffix=$RUBY_VERSION to Attach:gen_ruby_240.txt. And changed exec line in /service/ch.oddb/run to exec sudo -u apache bundle exec ruby2.4.0 bin/oddbd

Pushed the following commit Various fixes for watir spec tests before running spec tests again. I have again unexecpted errors, as it seems that loading the ads sometimes takes too long or does produce errors.

Patched to_html method in src/view/google_ad_sense.rb to return '' to avoid fetching any ads. (Will run watir test in the evening)

Running sudo -u apache bundle exec ruby2.4.0 jobs/import_swissmedic. Looks like it is using a lot less memory than with Ruby 1.9.3. E.g. found the following line 2017-01-10 16:37:57 +0100: /var/www/oddb.org/src/plugin/swissmedic.rb:173:in `trace_memory_useage': Using 2640 MB of memory. Limit is 16384. Swissmedic_do_tracing true in /var/www/oddb.org/log/oddb/debug/2017/01.log whereas on thinpower I rarely seen anything below 10 GB and usually running around 14 or 15 GB. import_swissmedic completed without errors. Will compare results tomorrow.

Running rspec spec with ads disabled and no manual interventions completed quite fast and did show some 7 failures (which I think are also present on ch.oddb.org)

Finished in 28 minutes 4 seconds (files took 1.83 seconds to load)
176 examples, 7 failures, 35 pending

Failed examples:

rspec ./spec/admin_spec.rb:129 # ch.oddb.org should be possible to create a CompanyUser
rspec ./spec/download_spec.rb:45 # ch.oddb.org should be possible to run a bin/admin command
rspec ./spec/download_spec.rb:73 # ch.oddb.org should be possible to run grant_download oddb2.csv
rspec ./spec/rezept_and_instantsearch_spec.rb:571 # ch.oddb.org should be possible to print a presciption with 10 drugs
rspec ./spec/searchbar_spec.rb[1:2] # ch.oddb.org should be possible to find 1,25-Dihydroxycholecalciferol when searching via 125 in analysen
rspec ./spec/searchbar_spec.rb:339 # ch.oddb.org should show no drugs for Fortex via unwanted effects search
rspec ./spec/searchbar_spec.rb:391 # ch.oddb.org should set best_result when searching Rivoleve via search_type

Started sudo -u apache bundle exec ruby2.4.0 jobs/import_bsv

view · edit · sidebar · attach · print · history
Page last modified on January 10, 2017, at 08:16 PM