Skip to content

Instantly share code, notes, and snippets.

View danmayer's full-sized avatar

Dan Mayer danmayer

View GitHub Profile
<script type="text/javascript">
function amChartInited (chart_id){
setTimeout(function() { flashMovie = document.getElementById("amline");
flashMovie.setParam('reload_data_interval',0); }, 60000);
}
</script>
/Users/danmayer/projects/caliper/vendor/bundler_gems/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:105:in `const_missing': uninitialized constant DataMapper::Property::OPTIONS (NameError)
# Example of using monit to monitor a ruby thin instance
# This is part of a monit config file to monitor a cluster of thin servers.
# We have 10 servers 8080-8089 so there are 10 entries like below in the config file
# we automatically generator this file so we don't copy and paste the config 10 times
# you need one of these sections for each thin instance.
# if the total memory exceeds 100 Mb for the single thin instance it is rebooted
# note when starting thin you pass /tmp/devver_api_server.pid, which it converts
# to /tmp/devver_api_server.8080.pid
open '/'
assert_title 'Hosted Ruby/Rails metrics - Caliper'
verify_text_present 'Recently Generated Metrics'
click_and_wait "css=#projects a:contains('Projects')"
verify_text_present 'Browse Projects'
click_and_wait "css=#add-project a:contains('Add Project')"
verify_text_present 'Add Project'
browser.open '/'
assert_equal 'Hosted Ruby/Rails metrics - Caliper', browser.title
assert browser.text?('Recently Generated Metrics')
browser.click "css=#projects a:contains('Projects')", :wait_for => :page
assert browser.text?('Browse Projects')
browser.click "css=#add-project a:contains('Add Project')", :wait_for => :page
assert browser.text?('Add Project')
require "rubygems"
require "test/unit"
gem "selenium-client", ">=1.2.16"
require "selenium/client"
require 'threadify'
class ExampleTest < Test::Unit::TestCase
#SELENIUM_BROWSERS=all
def browsers
namespace :test do
namespace :selenium do
desc "selenium against staging server"
task :staging do
exec "bash -c 'SELENIUM_BROWSERS=all SELENIUM_RC_URL=saucelabs.com SELENIUM_URL=http://caliper-staging.heroku.com/ ruby test/acceptance/walkthrough.rb'"
end
desc "selenium against local server"
task :local do
namespace :test do
namespace :selenium do
desc "selenium against staging server"
task :staging do
exec "bash -c 'SELENIUM_BROWSERS=all SELENIUM_RC_URL=saucelabs.com SELENIUM_URL=http://caliper-staging.heroku.com/ ruby test/acceptance/walkthrough.rb'"
end
desc "selenium against local server"
task :local do
require 'fileutils'
require 'pathname'
require 'ruby-debug'
require 'ostruct'
require 'rest_client'
require 'json'
# multiple gems use the require tumblr, this one refers to http://github.com/mwunsch/tumblr
# note that ruby-debug and the weary lib, which makes reqs for this tumblr gem, don't play nicely together
require 'tumblr'