view · edit · sidebar · attach · print · history

Index>

20151209-rss-yearly-feeds

Summary

  • RSS-Feeds should show only last year + earlier in a separate
  • Fix watir tests before start migrating to Ruby 2.2.x
  • Ideas for migrating and desired environment
  • Evidentia: trademark first must place out of trade at the end

Commits

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

RSS-Feeds should show only last year + earlier in a separate

Limit RSS feedback to year or so. Allow accessing RSS feeds of past years.

Analysing the code (for fachinfo) I find that the feeds are generated in src/plugin/plugin.rb via a SessionStub where a view_class view_klass.new(model, stub, nil) is called. The view_klass in this case is in src/view/rss/fachinfo.rb which is quite small and only implements a to_html method.

My plan therefore would be something like (first just for the fachinfo):

  • create watir tests to download yearly feeds and to check that the default rss-feed contains no item older than 1 year
  • extract code from View::Rss::Swissmedic.to_html to display just one item into a method item_to_html
  • change View::Rss::Swissmedic.to_htm to throw ignore items older than 1 year
  • create method View::Rss::Swissmedic.to_html_for_year(context, year) returns the HTML code or nil when nothing is found for
  • add a new jobs/export_yearly_feeds
  • adapt the layers to call to make it call View::Rss::Swissmedic.to_html_for_year for past years, till we found nothing more.

Fix watir tests before start migrating to Ruby 2.2.x

xvfb_rspec.sh ran fine and shows me 23 failing watir tests

rspec ./spec/admin_spec.rb:125 # ch.oddb.org should be possible to create a CompanyUser
rspec ./spec/doctors_spec.rb:64 # ch.oddb.org check doctors
rspec ./spec/download_spec.rb:26 # ch.oddb.org should download the results of a search to Marcoumar
rspec ./spec/download_spec.rb:74 # ch.oddb.org should be possible to run grant_download oddb2.csv
rspec ./spec/home_2_list_spec.rb[1:1] # ch.oddb.org in home_companies should be possible consult the corresponding list of companies
rspec ./spec/home_2_list_spec.rb:70 # ch.oddb.org in home_companies we should have the link active_companies if logged in as admin
rspec ./spec/paypal_spec.rb:191 # ch.oddb.org should be checkout via paypal a poweruser
rspec ./spec/paypal_spec.rb:222 # ch.oddb.org should return a correct link to a CSV file if the payment is okay
rspec ./spec/paypal_spec.rb:250 # ch.oddb.org should not download a CSV file if the payment was not accepted
rspec ./spec/paypal_spec.rb:265 # ch.oddb.org should be possible to cancel a paypal before login
rspec ./spec/paypal_spec.rb:278 # ch.oddb.org should be possible to cancel a paypal after login but before paying
rspec ./spec/pharmacies_spec.rb:52 # ch.oddb.org check pharmacy
rspec ./spec/preferences_spec.rb:16 # ch.oddb.org should save zsr in preferences
rspec ./spec/rezept_and_instantsearch_spec.rb:371 # ch.oddb.org should print a correct prescription with comments, personal information, doctor info and a drug
rspec ./spec/rezept_and_instantsearch_spec.rb:567 # 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:153 # ch.oddb.org should work with the privatetemplate searchbar
rspec ./spec/searchbar_spec.rb[1:27] # ch.oddb.org Interaktion should display not found for Warfarin which is not registered in Switzerland 
rspec ./spec/searchbar_spec.rb[1:29] # ch.oddb.org Preisvergleich should display not found for Warfarin which is not registered in Switzerland 
rspec ./spec/searchbar_spec.rb[1:31] # ch.oddb.org Preisvergleich und Inhaltsstoff should display not found for Warfarin which is not registered in Switzerland 
rspec ./spec/smoketest_spec.rb:228 # ch.oddb.org should have a link to the english language versions
rspec ./spec/smoketest_spec.rb:311 # ch.oddb.org should download the results of a search
rspec ./spec/visit_all_spec.rb:24 # ch.oddb.org should open all sequence as admin

The failure for Dihydroxycholecalciferol is expected. The other 22 specs all ran once fine and I must check why they failed running in the last months.

It is well possible that some of these failure are false negatives, as e.g. I discovered that search for Warfarin displays correctly Too Many results.

The paypal failures might well all be caused by the test account be no longer valid. Here I must refactor, as one smoketest does also not work, because we cannot proceed with paypal. I add new helper to login via correctly setup paypal account. This proved to be the case. The etc/oddb.yml will no be create with default values for the sandbox.paypal.com if not present. Pushed commit Fixed watir-tests with paypal, Fixed some watir specs and Fixed even more watir specs

The preferences_spec.rb was broken for a long time, because the ZSR did not work for some time. Found out that saving preferences did not work on oddb-ci2, but they work for ch.oddb.org

Many seem to suffer that it looks as on oddb-ci2 the used admin user does not have enough privileges.

Looks like de/gcc/companylist/ really has some problems. What did got wrong? Should it really display all names in view? Why does it not have a link 'Aktuelle Einträge'? No. Just one test checked it, even when there were more specific tests, which checked the behaviour.

Running all watir tests to see whether I am down to 5 or less errors.

Got the following errors

159 examples, 15 failures, 22 pending

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:125 # ch.oddb.org should be possible to create a CompanyUser
rspec ./spec/preferences_spec.rb:15 # ch.oddb.org should save zsr in preferences
rspec ./spec/rezept_and_instantsearch_spec.rb:371 # ch.oddb.org should print a correct prescription with comments, personal information, doctor info and a drug
rspec ./spec/rezept_and_instantsearch_spec.rb:567 # 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/smoketest_spec.rb:229 # ch.oddb.org should have a link to the english language versions
rspec ./spec/welcome_spec.rb[1:1] # ch.oddb.org should be possible to see the sponsored log-in in zone analysis
rspec ./spec/welcome_spec.rb[1:2] # ch.oddb.org should be possible to see the sponsored log-in in zone pharmacies
rspec ./spec/welcome_spec.rb[1:3] # ch.oddb.org should be possible to see the sponsored log-in in zone doctors
rspec ./spec/welcome_spec.rb[1:4] # ch.oddb.org should be possible to see the sponsored log-in in zone interactions
rspec ./spec/welcome_spec.rb[1:5] # ch.oddb.org should be possible to see the sponsored log-in in zone migel
rspec ./spec/welcome_spec.rb[1:6] # ch.oddb.org should be possible to see the sponsored log-in in zone user
rspec ./spec/welcome_spec.rb[1:7] # ch.oddb.org should be possible to see the sponsored log-in in zone hospitals
rspec ./spec/welcome_spec.rb[1:8] # ch.oddb.org should be possible to see the sponsored log-in in zone companies

The welcome_spec error are because somehow running my specs changed the desitin user's flavor to another one. This must be fixed. Probable the best thing would be to create users when starting the watir tests.

Ideas for migrating and desired environment

When I look at all these problems accumulated I would love to have next year a better test environment. It specification should encompass:

  • run unit tests after check-in (already realized via Travis-CI)
  • run also all unit-tests currently not activated (e.g. many plugin tests)
  • Run it in a separate public accessible site, which satisfy the following requirement
    • Has a top level name like test.oddb.org and
    • sub-names for each flavor like evidentia.test.oddb.org
    • hosted on a separate server oder running as a VM inside another server
    • not on my machine, but Jenkins-CI setup tested first on my machine
  • have a Jenkins-CI environment running, having
    • recent version of docker installed
    • allow (at least 2) parallel instances of oddb.org being tested (e.g. bug-fix and feature branch)
    • run watir tests for all relevant branches (at least each night, better after each commit)

This should allow to develop features in parallel before merging them as a block. It would also allow Zeno and customers to give their okay.

Jenkins-CI seems not to be available via the official the gentoo/funtoo portage, but there is an old howto from 2011. But there are (in my experience) quite good official docker images for Jenkins. But the docker version on oddb-ci2 is way too old (0.8.1) to be useful.

Therefore the way to got seems to be emerge -sync && emerge docker to get a new one. But will this break my machine. Currently my /usr/portage is at commit 8030f2b37512a03af3c07777b2f2c469d745d053 from March 2014.

Evidentia: trademark first must place out of trade at the end

Non-SL entries and Out of trade must come after priorized trademarks. Example is Keppra. The (black) Keppra 100 mg is out of trade and should be displayed as the last one.

This should be fixed with commit Evidentia. Fix sort order for out-of-trade, but matching trademark

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