Must create watir tests and clean up my pending changes. Also sbsm should document that a flavor is needed with Ruby 2.3.1. Maybe we should add a constant DEFAULT_FLAVOR='sbsm' to avoid spending too much time when migrating projects.
Pushed commits
Verified that changing sbsm alone would have allowed bbmb 2.0.2 to navigate to customer and its invoices. With bbmb Version 2.0.2 the LNF would not have picked the correct Look and Feel.
Working on watir tests now. Copied spec_helper.rb and smoketest_spec.rb from oddb.org. Now testing the login works. Moving the watir tests to sandoz.bbmb.ch.
The xmlconv gem has unit tests which are based on a custom implementation of mock and runit. They must be converted to flexmock.
Converting the unit test shows that I must replace the tmail in lib/xmlconv/util/mail.rb by a UTF-8 tolerating mail gem.
Converted lib/xmlconv/custom/lookandfeel.r from 8859-1 by UTF-8 using iconv -f ISO-8859-14 -t utf8 lib/xmlconv/custom/lookandfeel.rb -o lib/xmlconv/custom/lookandfeel.rb
Rewriting the mocks for transaction takes some time. Also must convert to use the mail gem. This make sending a test mail easy. Now test/test_util/transaction.rb delivers two test mails successfully.
Running all unit test fails, because we require rockit. Must remove it.
The following errors are present:
# encoding: ASCII-8BIT
Renamed bin/admin bin/xmlconv_admin to avoid conflict with admin from gem bbmb. Now I can succesfully install the new version using rake clean gem; sudo /usr/local/bin/gem231 install pkg/xmlconv-1.0.2.gem
Copying /var/www/sandoz.xmlconv.bbmb.ch/etc/xmlconv.yml from fastpower to oddb-ci2.
Simplyfied sudo -u bbmb /usr/local/bin/ruby231 -I/var/www/sandoz.bbmb.ch/lib -rydim/invoice /usr/local/bin/bbmbd config=/var/www/sandoz.bbmb.ch/etc/config.yml to contain only
sudo -u bbmb /usr/local/bin/ruby231 -I/var/www/sandoz.bbmb.ch/lib -rydim/invoice /usr/local/bin/bbmbd config=/var/www/sandoz.bbmb.ch/etc/config.yml
Now I am able to test it using sudo -u bbmb /usr/local/bin/ruby231 /usr/local/bin/xmlconvd config=/var/www/sandoz.xmlconv.bbmb.ch/etc/xmlconv.yml
which fails now because of the failing rockit parser
<..> D, [2016-06-08T13:55:50.973500 #31338] DEBUG -- XmlConv2: checking directory '/var/www/sandoz.xmlconv.bbmb.ch/lib/conversion' for plugins D, [2016-06-08T13:55:50.973615 #31338] DEBUG -- XmlConv2: loading plugin: 'conversion/pharmacieplus_bdd' (pharmacieplus_bdd.rb) D, [2016-06-08T13:55:51.057285 #31338] DEBUG -- XmlConv2: loading plugin: 'conversion/bdd_csv' (bdd_csv.rb) D, [2016-06-08T13:55:51.071754 #31338] DEBUG -- XmlConv2: loading plugin: 'conversion/bdd_i2' (bdd_i2.rb) D, [2016-06-08T13:55:51.077617 #31338] DEBUG -- XmlConv2: loading plugin: 'conversion/propharma_bdd' (propharma_bdd.rb) /usr/local/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:120:in `require': cannot load such file -- rockit/rockit (LoadError) from /usr/local/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:120:in `require' from /var/www/sandoz.xmlconv.bbmb.ch/lib/conversion/propharma_bdd.rb:4:in `<top (required)>' from /usr/local/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:120:in `require' from /usr/local/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:120:in `require' from /usr/local/lib/ruby/gems/2.3.0/gems/xmlconv-1.0.2/lib/xmlconv/util/autoload.rb:25:in `block in autoload' from /usr/local/lib/ruby/gems/2.3.0/gems/xmlconv-1.0.2/lib/xmlconv/util/autoload.rb:16:in `glob' from /usr/local/lib/ruby/gems/2.3.0/gems/xmlconv-1.0.2/lib/xmlconv/util/autoload.rb:16:in `autoload' from /usr/local/lib/ruby/gems/2.3.0/gems/xmlconv-1.0.2/bin/xmlconvd:28:in `<top (required)>' from /usr/local/bin/xmlconvd:23:in `load' from /usr/local/bin/xmlconvd:23:in `<main>'
Now I must fix the unit test found in https://github.com/zdavatz/sandoz.xmlconv.bbmb.ch.git.
Rockit is used for ProPharmaBdd. Is this still needed? For the moment replacing the parser by a very dumb mock.
Zeno prefers to see whether we can use rockit for this task, as the propharma is the most important part. Copied all rockit files from fastpower /usr/local/bin/ruby186/lib/ruby/site_ruby/1.8/rockit and added them to /home/niklaus/git/sandoz.xmlconv.bbmb.ch/lib. After converting the files lib/rockit/conflict_resolution.rb, lib/rockit/rockit_grammars_parser.rb and lib/rockit/token.rb from ISO-8859 to utf-8, I get the following error when running ruby231 test/test_conversion/propharma_bdd.rb
test/test_conversion/propharma_bdd.rb: /home/niklaus/git/sandoz.xmlconv.bbmb.ch/lib/rockit/rockit_grammars_parser.rb:9: /.../n has a non escaped non ASCII character in non ASCII-8BIT script: /^(Ċ~~ĊĊ~^^~5348086680)/ (SyntaxError)
This is the definition of the EofToken which has some weired bytes in it. 2t1 = EofToken.new("EOF",/^(�~~��~^^~5348086680)/n),
. The relevant parts produced by hexdump -C /usr/local/bin/ruby186/lib/ruby/site_ruby/1.8/rockit/rockit_grammars_parser.rb
ard
00000110 3d 20 5b 0a 20 20 20 20 74 31 20 3d 20 45 6f 66 |= [. t1 = Eof| 00000120 54 6f 6b 65 6e 2e 6e 65 77 28 22 45 4f 46 22 2c |Token.new("EOF",| 00000130 2f 5e 28 a4 7e 7e a4 a4 7e 5e 5e 7e 35 33 34 38 |/^(.~~..~^^~5348| 00000140 30 38 36 36 38 30 29 2f 6e 29 2c 0a 20 20 20 20 |086680)/n),. |
Tried the following definitions to get rid of the error
But still got the error /home/niklaus/git/sandoz.xmlconv.bbmb.ch/lib/rockit/grammar.rb:82:in `make_element': cannot make an element from nil (ArgumentError)
It looks like porting rockit to ruby 2.3.1 and UTF-8 is not such an easy task. Therefore I will see whether parsing using regular expression works.
Used 5 minutes to make test/test_conversion/sunstore_bdd.rb run and found out that the generated XML has the following differences:
When looking at the test I see that its is more or less an ini file. Trying the inifile.gem
Added the gem soap4r (1.5.8). Copyied in /etc/apache2/vhosts.d sandoz.bbmb.ch.conf to sandoz.xmlconv.bbmb.ch.conf and changed sandoz.bbmb by sandoz.xmlconv.bbmb. Now the service starts. See
Clicking on the link "28250" shows
We must correct the default lookandfeel. Fixed by moving doc/resources/xmlconv.css to directory doc/resources/sbsm.
Pushed commits
Fixed an error in sandoz.xmlconv.bbmb.ch.conf. See Attach:sandoz.xmlconv.bbmb.ch.conf.txt
Now the list displays in the correct lnf.
Will convert the database to utf8 next week.