Skip to content

Commit

Permalink
Add a readme
Browse files Browse the repository at this point in the history
  • Loading branch information
rubys committed Mar 27, 2013
1 parent 5b57afc commit 63eb23a
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 5 deletions.
6 changes: 3 additions & 3 deletions .gitignore
@@ -1,5 +1,5 @@
work
work-*
snapshot
work/
work-*/
snapshot/
dashboard.html
edition4/.DS_Store
87 changes: 87 additions & 0 deletions vagrant/README.md
@@ -0,0 +1,87 @@
Quick Start
=========

Install [vagrant](http://www.vagrantup.com/).

Tweak `awdwr/vagrant/Vagrantfile` if necessary, then run the following command
to install and configure everything needed to run the Agile Web Development
with Rails tests using Vagrant:

cd awdwr/vagrant; vagrant up

Upon completion, the installation will report the address of the web
interface.

Using the Web Interface
===

At the bottom of the table is an input field. Enter any combination of:

- A one digit edition number for the book (currently only 4 is supported)
- A two digit Rails version (e.g., 40 or 32)
- A three digit Ruby version (e.g. 200 or 193)

For convenience, you can click on a column header to sort by that column, and
you can click on an individual time entry to pre-fill in the input field. By
holding down the control key (command on Mac OS X) you can select multiple
builds to be executed sequentially.

Press submit. Status will show up at the bottom. The first time you run
this, it will take some time as it will install the necessary version of Ruby
and download gems and checkout repositories. Once it begins running the
actual test you will be able to see what step it is running.

In the top right is a link to the `logs` directory, which can be useful when
things go wrong.

Using the Command interface
----

Before proceeding, a bit of knowledge as to how the directories are laid out
is in order. As Rails is commonly used, one may have multiple applications
and each is largely self contained. This test suite flips that around, one
has multiple copies of the application(s) and a single checked out copy of
each repository.

vagrant ssh

The command run by the web interface is `testrails` and it can be run directly
from the command line. This does all of the necessary setup, steps that don't
generally need to be repeated.

More commonly, what is needed when running interactively is to make use of the
existing repositories and directories. This involves a number of `git`
commands and a final `cd` command. The `work` alias is set up to do this, and
will allow you to switch quickly and easily from one configuration to another.
Arguments to `work` are the same as to `testrails`, and default to whatever
the current release is. At the moment, that is Book edition 4, Rails 40, and
Ruby 200.

From here, you can ruby `rails new` or `cd depot` and run `rails console` or
`rails server`. Modify the application as you see fit, as it will be
recreated from scratch on the next test run.

Alternately, `depot` can be used to can run all or a subset of steps in the
scenario by identifying the starting and stopping section numbers. For
example,

depot 6.1-10.1

This can be used in combination with `git bisect`:

cd ~/git/rails
git bisect start
git bisect bad
git checkout <revision>
git bisect good
git bisect run depot 6.1-10.1

Other possibilities include pulling or directly applying changes to rails or
other dependencies and restarting the tests at any point.

Cleaning up
===

The entire vm can be removed using the following command:

vagrant destroy
4 changes: 2 additions & 2 deletions vagrant/bootstrap.sh
Expand Up @@ -39,8 +39,8 @@ su --login vagrant << 'eof'
mkdir bin
sed "s'/home/rubys'$HOME'" < ~/git/awdwr/testrails.yml > bin/testrails.yml
cp /vagrant/bin/* bin
echo 'PATH=$PATH:$HOME/bin' >> ~/.bashrc
echo "alias work='source ~/bin/work'" >> ~/.bashrc
echo 'PATH=$PATH:$HOME/bin' >> ~/.bash_profile
echo "alias work='source ~/bin/work'" >> ~/.bash_profile
# web interface
cp /vagrant/www/* /var/www
Expand Down

0 comments on commit 63eb23a

Please sign in to comment.