view · edit · sidebar · attach · print · history

Index>

20151223-yus-ruby-2-x

Summary

  • Analyse error "method_missing called on unexpected T_NODE"
  • Run yus under Ruby 2.x in docker

Commits

yus (branch ruby2x)

Index

Keep in Mind for work to do
  • Fix dojo error http://www.sitepen.com/blog/2012/10/31/debugging-dojo-common-error-messages/#forgot-dom-ready
  • I removed on May-27 tests for ix_registrationss, fix_sequences, fix_compositions, fix_packages from test/test_plugin/swissmedic.rb,as he could not find any references for them in the src code. Did I erroneously remove stuff when cleaning up the swissmedic import earlier?
  • The whole test for older/newer Packages must be adapted to xlsx. One must compare the rows (e.g. by creating csv files) and do the same stuff in xlsx!
  • creat gem: task: input=file with ean-codes, standard output show ean-codes + atc-code. Source is Swissmedic Packungen.xlsx or XML.
  • Import via data/medreg_companies.yaml
  • Fix problem with radioactivatum 99m-technetio when parsing Wirkstoffe
  • Fix galenic_forms when parsing swissmedic.xlsx
  • Cleanup generic_type. Replace it everywhere by sl_generic_type and adapt code accordingly.
  • Get updated ATC-codes from EPha for oddb.org, too.
  • Use refdatabase for oddb.org, too.
  • Check whether we should revert the part which touche src/plugin/text_info.rb of commit 17af82ba4d76a5838683411b260de265531f9e74. We should improve test/stub/oddbapp.rb to work similar for update/pointer as the real oddbapp. In this case we would have a good Stub for plugins. May we need a different stub when working with plugins (which create/modify/destroy ODDB-Objects), when in most other cases a very simple stub is sufficient.
  • When a logged in admin user changes an atc_code of a product, the corresponding atc_class must update its sequences, too.
  • Order of entering search type and value should not matter. Both should show long URL with search
  • Remove parser for minifi (but keep the minifi)

Analyse error "method_missing called on unexpected T_NODE"

Found the following error this morning

Plugin: ODDB::TextInfoPlugin
Error: NotImplementedError
Message: method `method_missing' called on unexpected T_NODE object (0x00000059a78510 flags=0x623c klass=0x0)
Backtrace:
/usr/local/lib/ruby/gems/1.9.1/gems/odba-1.1.0/lib/odba/stub.rb:112:in `method_missing'
/var/www/oddb.org/src/plugin/text_info.rb:177:in `block in store_patinfo'
/var/www/oddb.org/src/plugin/text_info.rb:177:in `each'
/var/www/oddb.org/src/plugin/text_info.rb:177:in `collect'
/var/www/oddb.org/src/plugin/text_info.rb:177:in `store_patinfo'
/var/www/oddb.org/src/plugin/text_info.rb:317:in `block in update_patinfo'
/var/www/oddb.org/src/plugin/text_info.rb:307:in `each'
/var/www/oddb.org/src/plugin/text_info.rb:307:in `update_patinfo'
/var/www/oddb.org/src/plugin/text_info.rb:1203:in `parse_and_update'
/var/www/oddb.org/src/plugin/text_info.rb:1213:in `block (3 levels) in import_info'
/var/www/oddb.org/src/plugin/text_info.rb:1212:in `each'
/var/www/oddb.org/src/plugin/text_info.rb:1212:in `block (2 levels) in import_info'
/var/www/oddb.org/src/plugin/text_info.rb:1211:in `each_pair'
/var/www/oddb.org/src/plugin/text_info.rb:1211:in `block in import_info'
/var/www/oddb.org/src/plugin/text_info.rb:1208:in `each_pair'
/var/www/oddb.org/src/plugin/text_info.rb:1208:in `import_info'
/var/www/oddb.org/src/plugin/text_info.rb:1416:in `block in import_swissmedicinfo_by_index'
/var/www/oddb.org/src/plugin/text_info.rb:1415:in `each_pair'
/var/www/oddb.org/src/plugin/text_info.rb:1415:in `import_swissmedicinfo_by_index'
/var/www/oddb.org/src/plugin/text_info.rb:1477:in `import_swissmedicinfo'
/var/www/oddb.org/src/util/updater.rb:573:in `block in update_notify_simple'
/var/www/oddb.org/src/util/updater.rb:549:in `call'
/var/www/oddb.org/src/util/updater.rb:549:in `wrap_update'
/var/www/oddb.org/src/util/updater.rb:567:in `update_notify_simple'
/var/www/oddb.org/src/util/updater.rb:344:in `update_textinfo_swissmedicinfo'
/var/www/oddb.org/src/util/updater.rb:198:in `run'
jobs/import_daily:13:in `block in <module:Util>'
/var/www/oddb.org/src/util/job.rb:40:in `call'
/var/www/oddb.org/src/util/job.rb:40:in `run'
jobs/import_daily:12:in `<module:Util>'
jobs/import_daily:11:in `<module:ODDB>'
jobs/import_daily:10:in `<main>

Found the following entries in the log to see where it comes from

015-12-23 07:19:44 +0100: /var/www/oddb.org/src/plugin/text_info.rb:1197:in `block in parse_and_update': _infos de  NilClass
2015-12-23 07:19:44 +0100: /var/www/oddb.org/src/plugin/text_info.rb:1197:in `block in parse_and_update': _infos fr ellaOne 30 mg comprimé
Qu’est-ce que ellaOne et quand est-il utilisé?
ellaOne est pris sur prescription du médecin.
ellaOne est un contraceptif d'urgen ODDB::PatinfoDocument
2015-12-23 07:19:44 +0100: /var/www/oddb.org/src/plugin/text_info.rb:1202:in `parse_and_update': calling update_patinfo ellaOne 30 mg comprimé, ["62531"]
2015-12-23 07:19:44 CETlog notify Error: Fach- und Patienteninfo Updates (swissmedicinfo.ch): start outgoing process ["log"]. Must attach 0 files and 0 parts. 
2015-12-23 07:19:44 CETUtil.send_mail list_and_recipients ["log"]

On oddb-ci2 the FI and PI was added/updated without any problem this night. On thinpower the FI got updated, but we have no PI. Loading thinpowers database on oddb-ci2 and running update_textinfo_swissmedicinfo --target=pi on oddb-ci2. Could not reproduce the error here. Waiting whether tomorrow we will have the same problem or not.

Run yus under Ruby 2.x in docker

I will start a new github repository oddb-docker where I want to setup an infrastructure which can be easily duplicated to run test (unit-tests and Watir). As some of the tests take many hours to complete, eg. check the whole import_daily it is desirable that the developer has the possibility to run several of these test in parallel. This will allow working on a feature branch and fixing some (hopefully small) problem in the production branch.

Added a readme and documented there some reflections with commits

Looking around for a gem/tool to add spec tests for my dockerfiles/docker-compose.yml. Found Testing Dockerfiles with Serverspec

Installing docker and docker-compose via

  • sudo emerge --sync
  • sudo emerge --oneshot portage
  • sudo emerge docker docker-compose

This seems to work out fine. Got docker 1.9.1 and docker-compose 1.5.2. Change yus like this

  • add docker-compose.yml
  • Dockerfile
  • test/yus_demo.yml (to specify db_host, db_name, etc)
  • modified bin/yusd
    • allow specifying a database host, as the database is running in another container

As I need to create /etc/yus/data/yus.{key,crt} I looked how I did it via a puppet manifest https://github.com/ngiger/vagrant-oddb_org/blob/master/static-modules/oddb_org/templates/yus_create_yml.rb.erb

Now I am asking myself.

  • Should I reuse/adapt all the puppet stuff. It would probably be necessary to port it to a more or less recent version of puppet and correct/add the needed spec test
  • Shall I split it into various part? E.g. yus, migel, oddb.org as other stuff like the currency daemon will probable not need a sophisticated setup.
  • Shall just create some isolated puppet files and call them. What about templates? Inlining them? Installing Puppet?
  • What about the Apache vhosts?
  • If I split it up, how can I access the same hiera configuration?

As shown in https://docs.travis-ci.com/user/docker/ it should be easy to run a docker command when running on travis-ci. Creating a new branch ruby2x. Replaced using hoe by bundler/gem_tasks. Pushed commits

Now docker-compose up begins to start bin/yusd, but has some error because the id_rsa.key and yus.yml are not yet correct. Eg. Output was Failed creating certificate using: openssl req -key /etc/yus_demo/data/yus.key -out /etc/yus_demo/data/yus.crt -new -x509 -batch -passin pass:''

rake test works fine and runs all unit tests. Will work on making rake rspec to run spec tests against a docker instance which has the code installed. Eg. docker-compose build/up must work, yus_add, yus_show, etc will be exercised.

Will fix this next year!

view · edit · sidebar · attach · print · history
Page last modified on December 23, 2015, at 05:09 PM