yus (branch ruby2x)
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.
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
This seems to work out fine. Got docker 1.9.1 and docker-compose 1.5.2. Change yus like this
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.
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!