Meego Wiki
Views

Quality/QA-tools/QAReports/Setting up the development environment

From MeeGo wiki
< Quality | QA-tools | QAReports
Revision as of 08:02, 18 October 2011 by Kyranto (Talk | contribs)
Jump to: navigation, search

Contents

Introduction

QA Reports is a Ruby on Rails application so you need to install a bunch of stuff to get it up and running. This documentation is based on Ubuntu 10.10

Install Ruby

Packaged version of Ruby tends to be pretty old and won't probably won't work very well. Thus this guide uses Ruby Version Manager (rvm).

  1. Install dependencies:
    $ sudo apt-get install build-essential bison openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev libqt4-dev
  2. Install rvm: $ bash < <(curl -s https://rvm.beginrescueend.com/install/rvm) # NOTE: if network proxy blocks cloning via git proxy, try download the script and change git to http
  3. Follow the instructions printed once installation is ready
    1. Install needed packages - check section "For Ruby (MRI & ree) you should install the following OS dependencies"
    2. Enable loading of rvm - check section "You must now complete the install by loading RVM in new shells"
      1. Edit .bashrc as described
      2. Restart your shell to have rvm enabled
  4. Install Ruby: $ rvm install ree
  5. Set into use: $ rvm use ree
    1. If you want to use this ruby version as a default, use $ rvm --default use ree
  6. $ gem update --system

Set up QA Reports

  1. Install preqrequisites:
    1. $ sudo apt-get install libmysqlclient-dev mysql-server libxml2-dev libxslt1-dev libsqlite3-dev
    2. $ gem install bundler --no-ri --no-rdoc
  2. Clone qa-reports from git: $ git clone git://gitorious.org/meego-quality-assurance/qa-reports.git
  3. $ cd qa-reports
  4. $ bundle install --without staging production (If bundle install fails, run $ apt-get install libqt4-dev first.)
  5. $ cp config/database.example.yml config/database.yml
  6. $ rake db:migrate


Create MySQL user and two databases, one for development and the other for executing the tests

  1. $ mysql -u root -p
  2. mysql> create user 'qa_reports'@'localhost' identified by '<password_of_your_choosing>';
  3. mysql> create database qa_reports_development;
  4. mysql> create database qa_reports_test;
  5. mysql> grant all on qa_reports_development.* to 'qa_reports'@'localhost';
  6. mysql> grant all on qa_reports_test.* to 'qa_reports'@'localhost';
  7. mysql> exit

Configure QA Reports to use MySQL databases by editing config/database.yml as shown below

 development:
   adapter: mysql2
   encoding: utf8
   reconnect: false
   database: qa_reports_development
   pool: 5
   username: qa_reports
   password: <password_of_your_choosing>
   socket: /var/run/mysqld/mysqld.sock
 
 test:
   adapter: mysql2
   encoding: utf8
   reconnect: false
   database: qa_reports_test
   pool: 5
   username: qa_reports
   password: <password_of_your_choosing>
   socket: /var/run/mysqld/mysqld.sock

Run the migrations

  1. $ rake db:migrate

Run the tests and start the server

  1. $ rake spec, all unit tests should pass
  2. $ rake cucumber, all integration tests should pass
  3. Start the server: $ bundle exec rails server
  4. Register a new user for yourself: http://localhost:3000/users/register
Personal tools