Must update the DDD values for 2017 with the file received from Zeno. These are XML files, but as we have a working jobs/import_whocc (which parses the online database) we decided to postpone creating a new importer for the XML-files as our expectation is that the result should be the same as the existing job.
We want to port oddb.org to Ruby 2.4.0 (or 2.3.x) and first using mod_ruby, then using rack. I want the following steps:
Running watir tests in /home/niklaus/git/oddb.org with command rspec 2>&1 | tee rspec-1.9.3.log
. Many failures, because the evidentia setup is missing. Also I must fix paypal as there is a new confirm question. Done with commit Fix paypal. New confirm question
Create gen_ruby_240 (See Attach:gen_ruby_240.txt) script to compile from src.
Running all the specs takes around 45 minutes. Having 29 failures and 18 pending (skipped) tests. 5 of the failures stem from the fact that the ZSR does not work any longer and leads to failure in rezept_and_instantsearch_spec.
Some spec tests work fine when running isolated. Not skipping them. Added skip 'check_nutriflex_56091 only works with sequence, not with package'. The watir test for the sponsored login of desitin fails on oddb-ci2, but works on ch.oddb.org. Skipping it. Pushed Fix some watir tests
Merged recent changes into ruby2x branch and running test/suite.rb with Ruby 1.9.3. I have the following lines with failures
877 runs, 969 assertions, 3 failures, 5 errors, 46 skips 39 runs, 38 assertions, 1 failures, 0 errors, 0 skips 2 runs, 9 assertions, 0 failures, 1 errors, 0 skips 16 runs, 13 assertions, 0 failures, 3 errors, 0 skips 81 runs, 76 assertions, 1 failures, 0 errors, 6 skips 67 runs, 71 assertions, 2 failures, 0 errors, 1 skips 1 runs, 1 assertions, 1 failures, 0 errors, 0 skips
When running bundle install with ruby 2.4.0 I get the following errors
bigdecimal.c: Auf höchster Ebene: cc1: Warnung: nicht erkannte Kommandozeilenoption »-Wno-self-assign« cc1: Warnung: nicht erkannte Kommandozeilenoption »-Wno-constant-logical-operand« cc1: Warnung: nicht erkannte Kommandozeilenoption »-Wno-parentheses-equality« cc1: Warnung: nicht erkannte Kommandozeilenoption »-Wno-tautological-compare« Makefile:260: die Regel für Ziel „bigdecimal.o“ scheiterte make: *** [bigdecimal.o] Fehler 1
Do I run I too old version of gcc (gcc-Version 4.9.3)? Using sudo emerge gcc
to install gcc 5.3. This was not successfull as I had not enough space in / (var or tmp)
Copied Gemfile.lock to /var/www/oddb.org and pulled the changes. Now trying to start using sudo -u apache /usr/local/bin/ruby-2.4.0/bin/bundle exec bin/oddbd
fails
niklaus@oddb-ci2 /v/w/oddb.org> sudo -u apache /usr/local/bin/ruby-2.4.0/bin/bundle exec bin/oddbd bundler: failed to load command: bin/oddbd (bin/oddbd) NameError: uninitialized constant Psych::ENGINE /var/www/oddb.org/src/util/oddbapp.rb:8:in `<top (required)>' bin/oddbd:13:in `require' bin/oddbd:13:in `<top (required)>'
Pushed the commits
Now I have the following startup problem
process: Oddb (OddbApp) bundler: failed to load command: bin/oddbd (bin/oddbd) NameError: undefined method `odba_id' for module `Kernel' /usr/local/bin/ruby-2.4.0/lib/ruby/2.4.0/delegate.rb:85:in `instance_method' /usr/local/bin/ruby-2.4.0/lib/ruby/2.4.0/delegate.rb:85:in `method_missing' /var/www/oddb.org/vendor/ruby/2.4.0/gems/odba-1.1.0/lib/odba/cache_entry.rb:49:in `block in odba_add_reference' /var/www/oddb.org/vendor/ruby/2.4.0/gems/odba-1.1.0/lib/odba/cache_entry.rb:48:in `synchronize' /var/www/oddb.org/vendor/ruby/2.4.0/gems/odba-1.1.0/lib/odba/cache_entry.rb:48:in `odba_add_reference' /var/www/oddb.org/vendor/ruby/2.4.0/gems/odba-1.1.0/lib/odba/cache.rb:322:in `block (3 levels) in fetch_or_restore' /var/www/oddb.org/vendor/ruby/2.4.0/gems/odba-1.1.0/lib/odba/cache.rb:313:in `fetch_or_do' /var/www/oddb.org/vendor/ruby/2.4.0/gems/odba-1.1.0/lib/odba/cache.rb:320:in `block (2 levels) in fetch_or_restore' /var/www/oddb.org/vendor/ruby/2.4.0/gems/odba-1.1.0/lib/odba/cache.rb:319:in `synchronize' /var/www/oddb.org/vendor/ruby/2.4.0/gems/odba-1.1.0/lib/odba/cache.rb:319:in `block in fetch_or_restore' /var/www/oddb.org/vendor/ruby/2.4.0/gems/odba-1.1.0/lib/odba/cache.rb:313:in `fetch_or_do' /var/www/oddb.org/vendor/ruby/2.4.0/gems/odba-1.1.0/lib/odba/cache.rb:317:in `fetch_or_restore' /var/www/oddb.org/vendor/ruby/2.4.0/gems/odba-1.1.0/lib/odba/cache.rb:304:in `block in fetch_named' /var/www/oddb.org/vendor/ruby/2.4.0/gems/odba-1.1.0/lib/odba/cache.rb:313:in `fetch_or_do' /var/www/oddb.org/vendor/ruby/2.4.0/gems/odba-1.1.0/lib/odba/cache.rb:296:in `fetch_named' /var/www/oddb.org/src/util/oddbapp.rb:1549:in `initialize' bin/oddbd:46:in `new' bin/oddbd:46:in `<top (required)>'
Updating to odba 1.1.2 (from 1.1.0) fixed this problem. Next error is
FEHLER: Relation »target_id_oddb_package_name_with_size_company_name_and_ean13« existiert bereits process: Oddb (OddbApp) init system init system: 4.971053319 setup drb-delegation reset reset: 4.971164932 system initialized initialized: 4.971254943 error in SBSM::Session#to_html: / NoMethodError undefined method `unit' for 1:Integer /var/www/oddb.org/src/model/dose.rb:127:in `rescue in <=>' /var/www/oddb.org/src/model/dose.rb:122:in `<=>' /var/www/oddb.org/src/model/part.rb:188:in `==' /var/www/oddb.org/src/model/part.rb:188:in `size' /var/www/oddb.org/vendor/ruby/2.4.0/gems/odba-1.1.2/lib/odba/stub.rb:112:in `method_missing' /var/www/oddb.org/src/model/package.rb:446:in `block in size' /var/www/oddb.org/vendor/ruby/2.4.0/gems/odba-1.1.2/lib/odba/stub.rb:112:in `collect' /var/www/oddb.org/vendor/ruby/2.4.0/gems/odba-1.1.2/lib/odba/stub.rb:112:in `method_missing' /var/www/oddb.org/src/model/package.rb:446:in `size' /var/www/oddb.org/vendor/ruby/2.4.0/gems/odba-1.1.2/lib/odba/stub.rb:112:in `method_missing'
I think I must fix now first the unit tests, as I have quite a few errors there. Fixed some more errors because of yaml/syck problem with commit Update tests to yaml/syck under ruby 2.x
Seems like the CGI implementation has changed too.
1) Error: ODDB::View::TestPager#test_to_html: NoMethodError: undefined method `element_init' for #<CGI:0x0055d50943d530> /home/niklaus/git/oddb.org/test/stub/cgi.rb:13:in `initialize' test/test_view/pager.rb:72:in `new' test/test_view/pager.rb:72:in `test_to_html'
Fixed by removing the call to element_init in the stub. Fixed test_generics_xls.rb where Ruby 2.4.0 treats floats a little bit different.
Must changed expected raises from RuntimeError -> StandardError in test/test_plugin/bsv_xml.rb. Pushed commit Fix some warnings/errors/rounding
Still having the error undefined method `unit' for 1:Integer
. Will see tomorrow how to fix it. Maybe I need to update sbsm or htmlgrid.