view · edit · sidebar · attach · print · history




  • Port to use rack
  • Fix rapflag problems
  • Keep in Mind



Port to use rack

Must fix the following problems:

Fix non working links:

Download problem oddb2.csvfixed with Fix getting download files

Running the download watir tests produce (among others) the following error

[2017-07-03 08:35:44] ERROR URI::InvalidURIError: URI must be ascii only "\u00FCller&address1=&city=&zip=&redirect_cmd=_xclick&cmd=_ext-enter"
        /usr/local/ruby-2.4.0/lib/ruby/2.4.0/uri/rfc3986_parser.rb:21:in `split'
        /usr/local/ruby-2.4.0/lib/ruby/2.4.0/uri/rfc3986_parser.rb:73:in `parse'
        /usr/local/ruby-2.4.0/lib/ruby/2.4.0/uri/rfc3986_parser.rb:117:in `convert_to_uri'
        /usr/local/ruby-2.4.0/lib/ruby/2.4.0/uri/generic.rb:1099:in `merge'
        /usr/local/ruby-2.4.0/lib/ruby/2.4.0/webrick/httpresponse.rb:277:in `setup_header'
        /var/www/ `setup_header'
        /usr/local/ruby-2.4.0/lib/ruby/2.4.0/webrick/httpresponse.rb:207:in `send_response'
        /usr/local/ruby-2.4.0/lib/ruby/2.4.0/webrick/httpserver.rb:112:in `run'
        /usr/local/ruby-2.4.0/lib/ruby/2.4.0/webrick/server.rb:290:in `block in start_thread'

To log only errors in services log we just have to append in the service/ch.oddb/run "--quiet" to rackup parameters.

Looking why we cannot save the preferences correctly for differenc color. Separated the watir test for ZSR and color. Testing whether a color is used or not is possible in a watir test with an expression like expect(@browser.image(:src => /blue/).exist?).to eql true

Remarked that login(ViewerUser, ViewerPassword) does no longer work when running a watir test. Why? Fixed that problem add added a watir tests for checking colors which passes on and fails on oddb-ci2 with commit Added watir tests for checking preferences color

Looks like we still have problems saving/restoring cookies. Eg. in watir I see a path of /en for the session_id, even if I would expect a path of /

[9] pry(#<RSpec::ExampleGroups::ChOddbOrg>)> @browser.cookies['_session_id']
=> {:name=>"_session_id", :value=>"1dace95de7baa5ab16a90c6184b", :path=>"/en", :domain=>"", :expires=>nil, :secure=>false}
10] pry(#<RSpec::ExampleGroups::ChOddbOrg>)> @browser.cookies['search_form']
=> {:name=>"search_form", :value=>"instant", :path=>"/", :domain=>"", :expires=>nil, :secure=>false}

The the persistent cookie item (self::class::PERSISTENT_COOKIE_NAME or @cookiename) are not saved/restored correctly.

After some changes, the color is preserved unless I change the language. Using yaml to save/restore the persistent user input. But this did not help. Looks like changing the color setting creates a POST request which does not set the cookies correctly. Must place a debug statement there, too.

How did mod_ruby really handle the cookies? If got them from @cgi.cookies and lib/sbsm/request.rb contained a generate_cookie method like

def generate_cookie(cookie_input)
  cookie_pairs = cookie_input.collect { |pair|
  cookie_hash = {
    "name"		=>	@proxy.cookie_name || 'sbsm-persistent-cookie',
    "value"		=>	cookie_pairs,
    "path"		=>	"/",
    "expires"	=>	( + (60 * 60 * 24 * 365 * 10)),

This proved to be a good approach. But I had to add a cuki.split(';') in import_cookies(request) to get the old behaviour. Adding a small unit test for it. Now the spec/preferences_spec.rb passes.

Tried to run the ./spec/download_spec.rb resulted in

Proxy Error

The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request POST /de/gcc.

Reason: Error reading from remote server

and in the error output of the services I see

[2017-07-03 17:01:16] ERROR URI::InvalidURIError: URI must be ascii only "\u00FCller&address1=&city=&zip=&redirect_cmd=_xclick&cmd=_ext-enter"

Did not find an easy solution here. Will continue working on it tomorrow.

view · edit · sidebar · attach · print · history
Page last modified on July 03, 2017, at 06:01 PM