Skip to content

Instantly share code, notes, and snippets.

# Which server to use.
server_host: 192.168.1.10
# server_user: testbot
# Project prefix. Used for prefixing project files
# so that you can run multiple projects in the same testbot network.
# project: project
# RSync settings. The folder where your files are synced to
# and then fetched from before running the tests.
namespace :testbot do
task :before_request do
# This is run after you start a request (ex: rake testbot:spec)
end
task :before_run do
# This is run by the runner after files are synced but before tests are run
# Example: Setting up a test database
database_yml = <<-DB_CONFIG
@joakimk
joakimk / gist:720660
Created November 29, 2010 21:30
Benchmark notes, testbot @ EC2

Most cost effective instance type?

I did a bit of benchmarking using our rspec suite and the most cost effective flavor seems to be "c1.medium". It's almost twice as fast as s1.small but still has the same per-core price. The micro instances were about 4 times slower than c1.medium.

The c1.xlarge instance did not perform better than c1.medium (actually worse) and costs as much per core.

I did not try the cluster nodes as they require you to create your own image to use it.

{
"run_list": [
"role[base]",
"role[staging]"
]
}
project user$ rake testbot:features --trace
(in /Users/user/project)
** Invoke testbot:features (first_time)
** Execute testbot:features
** Invoke testbot:before_request (first_time)
** Invoke testbot:prepare_config (first_time)
** Execute testbot:prepare_config
** Execute testbot:before_request
rake aborted!
undefined method `map' for nil:NilClass
@joakimk
joakimk / vagrant_version_checks.rb
Created March 23, 2011 15:41
Some code we use to ensure that we all use the same VirtualBox and vagrant versions.
REQUIRED_VERSION = "0.7.2"
REQUIRED_VIRTUALBOX_VERSION = "4.0.2"
#Vagrant::Config.run do |config|
# ...
#end
# Ensure a compatible Vagrant and VirtualBox versions.
INSTALL_CMD = "gem uninstall vagrant -a -x &> /dev/null &&" +
"gem install vagrant -v #{REQUIRED_VERSION} --no-ri --no-rdoc &>/dev/null"
@joakimk
joakimk / example_output.txt
Created March 23, 2011 19:19
Example output for the vagrant_example.
Macbook:vagrant_example (master) $ time vagrant up
[default] Provisioning enabled with chef_solo...
[default] Box base was not found. Fetching box from specified URL...
[default] Downloading with Vagrant::Downloaders::HTTP...
[default] Downloading box: http://files.vagrantup.com/lucid32.box
[default] Extracting box...
[default] Verifying box...
[default] Cleaning up downloaded box...
[default] Importing base box 'base'...
[default] Matching MAC address for NAT networking...
@joakimk
joakimk / build_vagrant_gem.sh
Created March 23, 2011 21:34
How to get the vagrant dev-env running
bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )
# follow instructions
rvm install ree
rvm use ree
git clone https://github.com/mitchellh/vagrant.git
cd vagrant
gem install bundler
git checkout 77a1b9a6efe4f5cdc993
#!/usr/bin/env ruby
require 'rubygems'
require 'httparty'
require 'json'
# Get one at https://code.google.com/apis/console/b/0
GOOGLE_TRANSLATE_KEY = ""
def translate_to_en(text)
JSON.parse(HTTParty.get("https://www.googleapis.com/language/translate/v2?key=#{GOOGLE_TRANSLATE_KEY}&q=#{URI.encode(text)}%20d%C3%A5&source=fi&target=en", :format => 'text').to_s)["data"]["translations"][0]["translatedText"]
@joakimk
joakimk / .deploy_config.yml
Created April 11, 2011 13:08
Example of the deploy config for quickly testing changes to testbot (used by "rake deploy")
upload_gem: scp pkg/GEM_FILE user@public_host:/var/www/testbot
update_server: ssh user@server 'wget -q http://public_host/testbot/GEM_FILE && gem install GEM_FILE --no-ri --no-rdoc && rm GEM_FILE'
restart_server: ssh user@server 'testbot --server stop; testbot --server start'
#### To use development versions the runners should be started like this: ####
testbot --runner --connect ... --auto_update --dev_gem_root http://public_host/testbot