Last modified: 2013-09-24 01:32:42 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T56384, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 54384 - browsertests: figure out how to install qa/browsertests gems
browsertests: figure out how to install qa/browsertests gems
Status: RESOLVED FIXED
Product: Wikimedia
Classification: Unclassified
Continuous integration (Other open bugs)
wmf-deployment
All All
: Unprioritized normal (vote)
: ---
Assigned To: Antoine "hashar" Musso (WMF)
:
Depends on:
Blocks: 54388
  Show dependency treegraph
 
Reported: 2013-09-20 16:45 UTC by Antoine "hashar" Musso (WMF)
Modified: 2013-09-24 01:32 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Antoine "hashar" Musso (WMF) 2013-09-20 16:45:10 UTC
We will need the ruby-bundler package to install the qa/browsertests repository

The following sequence seems to provide the desired effect:


sudo apt-get install ruby-bundler rubygems
git clone https://gerrit.wikimedia.org/r/qa/browsertests
cd browsertests
bundle install --path .

That needs to be done in the Jenkins jobs.
Comment 1 Antoine "hashar" Musso (WMF) 2013-09-20 19:36:42 UTC
CCing Željko Filipin on any continuous bug related to browsertests. Main tracking bug is: bug 53697, see https://bugzilla.wikimedia.org/showdependencytree.cgi?id=53697&hide_resolved=0
Comment 2 Antoine "hashar" Musso (WMF) 2013-09-23 19:23:26 UTC
When executing the browser tests, I end up with a syntax error:

$ bundle exec cucumber
/mnt/workspace/browsertests/features/support/env.rb:71: syntax error, unexpected ':', expecting ')'
    http_client: Selenium::WebDriver::Remote::Http::Persistent.new,
$

This is because our implementations require ruby 1.9.x and Precise comes by default with ruby1.8.  The bundle exec uses a /usr/bin/ruby shebang :/


According to https://devcenter.heroku.com/articles/ruby-versions , version 1.2.0 of bundle comes with a keyword to let us specify the version to use:

 source "https://rubygems.org"
 ruby "1.9.3"
 # ...


So we should backport the Ubuntu package ruby-bundler from a more recent distribution.
Comment 3 Antoine "hashar" Musso (WMF) 2013-09-23 19:59:10 UTC
Another way would be to install bundler from gem and provide it in qa/browsertests:

 gem install --verbose bundler -i bundler

That install it under bundler/bundler-1.3.5/lib , I could not find out how to have ruby load the gems using that path though :/
Comment 4 Antoine "hashar" Musso (WMF) 2013-09-24 00:27:56 UTC
Here is the trick:

Install the bundle gem locally:

 gem install --verbose -i bundle bundle

Gem will need to lookup up the bundle gem in the bundle directory. To show the default gem search paths use:

 ruby -r rubygems -e "p Gem.path"


Then tweak it with GEM_PATH:

 GEM_PATH=`pwd`/bundle ./bundle/bin/bundle --version
 Bundler version 1.3.5

This way we can add a dependency upon ruby: 1.9.3 in the gem file :-]
Comment 5 Antoine "hashar" Musso (WMF) 2013-09-24 00:39:55 UTC
I also had to get a different shebang for bundle since it uses /usr/bin/ruby by default.

  gem install --verbose --env-shebang -i bundle bundle
Comment 6 Antoine "hashar" Musso (WMF) 2013-09-24 00:48:00 UTC
Ask bundle to install everything to vendor:

 GEM_PATH=`pwd`/bundle ./bundle/bin/bundle install --path vendor

Append the vendor dir to GEM_PATH and exec cucumber:

  GEM_PATH=`pwd`/bundle:`pwd`vendor ./bundle/bin/bundle  exec cucumber


Tada! Firefox launching :-]
Comment 7 Antoine "hashar" Musso (WMF) 2013-09-24 01:32:42 UTC
I got it working on my laptop using phantomjs or firefox :-D  The Jenkins job configuration is tracked by bug 54388.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links