:::: MENU ::::
Posts tagged with: ruby

Run ownCloud Cucumber tests on Fedora 17

ownCloud uses automated testing to check for problems, and writing and executing these tests is important for any contributor. In my capacity as an ownCloud systems developer I use these tests to quickly verify that my apps don’t break after merging or pulling new code. For those less familiar with Ruby however, getting the Cucumber based behaviour tests running can be confusing. Here’s how to do it on Fedora.

  • Install the necessary dependencies:
    sudo yum install libxslt libxslt-devel libyaml libyaml-devel xorg-x11-server-Xvfb openssl-devel
  • Install RVM. If you have previously installed it, you may need to reinstall it so that the newly available libraries are used:
    sudo rvm install 1.9.3
  • Install the Selenium gem:
    sudo gem install selenium-webdriver
  • Clone the acceptance-testing repository from GitHub:
    git clone https://github.com/owncloud/acceptance-testing
  • Switch to root (su), and enter the newly created directory (this will trigger the .rvmrc shell script):
    cd acceptance-testing
  • Accept the warning and agree to run the script
  • If the script encounters errors (e.g. “RVM not found” or “RVM is not a function”), then open a new terminal, and repeat steps from “Switch to root”.
  • If you are testing a copy of ownCloud running locally on your machine, start your webserver, e.g.:
    service httpd start
  • Run cucumber to execute the tests:
    cucumber HOST=foo.bar.com features

Install Webgen in Fedora 17 with Ruby 1.8.6 and RVM

Webgen does not work with new versions of Ruby. Using Webgen installed using ruby and rubygems from Fedora repos results in errors including “obsolete and deprecated Config”.

To get webgen to work, we will use RVM (Ruby Version Manager). This allows you install multiple versions of ruby side by side. RVM is not available in Fedora repositories, and must be manually installed.

  1. If you have already installed ruby from a repository, remove it:

    yum remove ruby ruby-libs rubygems

  2. As root, install RVM, and follow the on-screen instructions:

    curl -L https://get.rvm.io | bash -s stable --ruby
    Note: the leading backslash () is intentional and could be important

  3. Install Ruby 1.8.6:

    rvm install 1.8.6
    Note: you can see what versions are available to install using: rvm list known

  4. Switch to use Ruby 1.8.6 by default:

    rvm use 1.8.6
    Note: You can check that it worked using: ruby -v
    Note: If you want this to be permanent, for all shells, and not just the terminal you’re currently using, execute: rvm use 1.8.6 –default

  5. Install webgen:

    gem install webgen

  6. That’s it! Good luck.