• This repository has been archived on 16/Sep/2020
  • Stars
    star
    130
  • Rank 277,575 (Top 6 %)
  • Language
    Ruby
  • License
    MIT License
  • Created almost 15 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

[Not maintained] Testbot is a test distribution tool that works with Rails, RSpec, RSpec2, Test::Unit and Cucumber

Not maintained

This is not maintained by me anymore. If you want to take over as maintainer for the project, please let me know.

Testbot has helped me ship well tested software for 7+ years, but it hasn't been well maintained for quite a while and I don't use it myself anymore.

I recommend looking at a CI service like CircleCI for parallel tests and Knapsack Pro for test balancing. I've seen the same performance of 10 CircleCI containers with Knapsack Pro balancing compared to 16 CPU cores with testbot. It's a bit more expensive to run, but it's easier to maintain.

Old readme

Testbot is a test distribution tool that works with Rails, RSpec, RSpec2, Test::Unit and Cucumber. The basic idea is that you let testbot spread the load of running your tests across multiple machines to make the tests run faster.

Using testbot on 11 machines (25 cores) we got our test suite down to 2 minutes from 30. More examples of how testbot is used.

If you intend to use testbot with cloud computing (like EC2), take a look at TestbotCloud.

Installing

gem install testbot

Try it out

testbot --server
testbot --runner --connect localhost
sleep 5 # wait for the runner to register with the server

mkdir -p testbotdemo/test; cd testbotdemo
echo 'require "test/unit"' > test/demo_test.rb
echo 'class DemoTest < Test::Unit::TestCase; def test_first; end; end' >> test/demo_test.rb

testbot --test --connect localhost
    
# Cleanup
testbot --server stop
testbot --runner stop
cd ..; rm -rf testbotdemo
rm -rf /tmp/testbot

The project files from the demo project are synced to /tmp/testbot/$USER (default). The runner syncs the files to /tmp/testbot/project (default). The tests are then run and the results returned through the server and displayed.

How it works

Testbot is:

  • A server to distribute test jobs.
  • One or more runners to run test jobs and return the results (this is the "worker" process).
  • One or more requesters that tells the server which tests to distribute and displays the results (the client you use to run tests, for example: rake testbot:spec).
    Requester -- (files to run) --> Server -- (files to run) --> (many-)Runner(s)
        ^                           |    ^                                  |
        |---------------------------|    |----------------------------------|
                 (results)                            (results)

Example setup

Here I make the assumption that you have a user called testbot on a server at 192.168.0.100 that every computer can log into without a password and that you have installed testbot on each computer.

ssh [email protected]
testbot --server

On every computer that should share CPU resources run:

testbot --runner --connect 192.168.0.100

Running tests:

testbot --test --connect 192.168.0.100
# --test could also be --spec (RSpec), --rspec (RSpec 2) or --features

Using testbot with Rails 2:

# Add testbot to your Gemfile if you use bundler. You also need the plugin because
# Rails 2 does not load raketasks from gems.
ruby script/plugin install git://github.com/joakimk/testbot.git -r 'refs/tags/v0.7.8'
script/generate testbot --connect 192.168.0.100

rake testbot:spec (or :rspec, :test, :features)

Using testbot with Rails 3:

rails g testbot --connect 192.168.0.100
rake testbot:spec (or :rspec, :test, :features)

# Gemfile:
gem 'testbot'

You can keep track of the testbots on:

http://192.168.0.100:2288/status

Updating testbot

To simplify updates there is a --auto_update option for the runner. The runner processes that use this option will be automatically updated and restarted when you change the server version.

This requires testbot to be installed without sudo as the update simply runs "gem install testbot -v new_version". I recommend using RVM (it handles paths correctly).

Example: testbot --runner --connect 192.168.0.100 --auto_update

More options

testbot (or testbot --help)

Could this readme be better somehow?

If there is anything missing or unclear you can create an issue (or send me a pull request).

Features

  • You can add and remove computers at any time. Testbot simply gives abandoned jobs to other computers.
  • Testbot will try to balance the testload so that every computer finishes running the tests at the same time to reduce the time it takes to run the entire test suite. It does a good job, but has potential for further improvement.
  • You can access your testbot network through SSH by using the built in SSH tunneling code.
  • You can use the same testbot network with multiple projects.
  • You can abort a test run with ctrl+c and all remote processes will be stopped.
  • It shows you the output as it happens.

Contributing to testbot

First, get the tests to run:

bundle
rake

For development I recommend using guard.

# OSX needs: gem install rb-fsevent
guard

Make your change (don't forget to write tests) and send me a pull request.

You can also contribute by adding to the wiki.

How to add support for more test frameworks and/or programming languages

Add a lib/shared/adapters/framework_name_adapter.rb file and update this readme.

More

  • Check the wiki for more info.

More Repositories

1

toniq

Simple and reliable background job processing library for Elixir.
Elixir
342
star
2

minimapper

A minimalistic way of separating your models from ActiveRecord
Ruby
83
star
3

macruby-docs-js

macruby-docs.user.js - A userscript that adds MacRuby/RubyMotion syntax to Apple's Objective-C/Cocoa docs.
JavaScript
38
star
4

testbot_cloud

A tool for creating and managing testbot clusters in the cloud.
Ruby
16
star
5

pipeline

CI build pipeline status app
Ruby
15
star
6

session_tracker

Track active user sessions in redis
Ruby
9
star
7

rpi-elixir

An Elixir docker image for Raspberry Pi
Makefile
9
star
8

caribbean-onslaught

Ruby
8
star
9

hubreview

Commit-by-commit code review app. No longer maintained, use https://github.com/henrik/remit instead.
Ruby
8
star
10

starsystem

Playing around with Elm and live code updates by building a game.
Elm
7
star
11

dboard

Dashboard framework
Ruby
5
star
12

hoptoad_notifier_merb

*No longer mantained* hoptoad notification client for merb, for a replacement, check the merb_hoptoad_notifier or rack_hoptoad projects.
Ruby
5
star
13

docker_services

A tool to install and run multiple versions of services like redis or postgres on the same computer without having port collisions by using docker.
Elixir
4
star
14

algotrader

Open source algorithmic trader with fast backtesting written in Rust.
Rust
4
star
15

rpi-erlang

Raspberry Pi compatible docker image for Erlang
Makefile
4
star
16

excel_xml

Library for creating Excel XML documents using Ruby.
Ruby
4
star
17

CrimeSweeper

A GTUG Stockholm Android Hackathon 2009 project (see more at http://sites.google.com/site/stockholmgtug/Home/gtug-stockholm-android-hackathon-2009/)
Java
4
star
18

vagrant_example

This is an example of how to use vagrant to setup a rails development environment with REE and Passenger
Ruby
3
star
19

devbox-tools

Ruby
3
star
20

cloud_bot

An example of how to use testbot with Amazon EC2 using fog
Ruby
3
star
21

goos_auction_sniper

Ruby implementation of the AuctionSniper in the Growing Object-Oriented Software Guided by Tests book.
Ruby
3
star
22

proxapi

Proxmox REST API
Ruby
3
star
23

rspec-roles

Experiment in testing definitions and implementations of roles (a class can play many roles, like Persistable or Preparable) in Ruby using RSpec.
Ruby
3
star
24

fast_unit_tests_example

An example of how you can create a separate suite of tests within a rails application that tests code which does not depend on rails (so that you can have faster feedback cycles).
Ruby
3
star
25

xa-006

A demo made using WebGL (three.js) for Edison 2016.
HTML
2
star
26

mtag

Small utility library to keep good and consistent id3 tags and file names when publishing music.
Ruby
2
star
27

debitech_soap

Please use https://github.com/barsoom/debitech_soap/
Ruby
2
star
28

phoenix_example_app

This is a phoenix demo app written for a presentation of phoenix at Stockholm Elixir.
Elixir
2
star
29

engine_experiment

Experiment: I want to see if it's practial to build a large rails app composed of multiple engines.
Ruby
2
star
30

snake-game-mob-elm

A snake game built by a group of people at an Elm meetup
Elm
2
star
31

livecoding_workspace

A javascript live coding (hot code reload) workspace set up using Elixir and Phoenix.
Elixir
2
star
32

solokit

Not maintained anymore.
Ruby
2
star
33

rpi-elixir-phoenix-app-example

An example of how to run a phoenix app using dockerized Elixir on a Raspberry Pi.
Elixir
2
star
34

memo

Memo is a shoppinglist application for Pocket PC and other devices that can run javascript.
JavaScript
2
star
35

joakimk.github.com

The source for rubyblocks.se
JavaScript
1
star
36

dboard_example

Setting up a dashboard using dboard
JavaScript
1
star
37

toniq-admin-ui-example

JavaScript
1
star
38

presentations

JavaScript
1
star
39

acts_as_rails3_generator

Write Rails 2 generators with Rails 3 generator syntax
Ruby
1
star
40

offline

TypeScript
1
star
41

kv

My implementation of the app described in http://elixir-lang.org/getting-started/mix-otp/introduction-to-mix.html
Elixir
1
star
42

app_builder

Experiments with rails 3.1
Ruby
1
star
43

cookbooks

My chef cookbooks
Ruby
1
star
44

devtools

Playing around with elixir by using it to automate various dev tasks.
Elixir
1
star
45

live_coding

JavaScript
1
star
46

vagrant_boxes

1
star
47

xa-007

A demo made using WebGL (three.js) for Edison 2018.
JavaScript
1
star
48

devenv

Ruby
1
star
49

help-search

Exploring elm by building a FAQ search box
Elm
1
star
50

planes

A gosu game
Ruby
1
star