Skip to content

Instantly share code, notes, and snippets.

View ciembor's full-sized avatar

Maciej Ciemborowicz ciembor

View GitHub Profile
@ciembor
ciembor / gist:4751901
Created February 11, 2013 01:40
Callback hell.
function refresh() {
chrome.windows.getAll(function(windows) {
for (var i = 0; i < windows.length; i++) {
chrome.tabs.getAllInWindow(windows[i].id, function(tabs) {
chrome.storage.sync.get('active', function(object) {
if (object.active !== undefined) {
for (var j = 0; j < tabs.length; j++) {
if (-1 !== object.active.indexOf(tabs[j].url)) {
chrome.tabs.reload(tabs[j].id);
}
// config.js
var watcher = new TimeWatcher();
var refresh = new RefreshAction();
watcher.onPeriod(5, refresh);
// auster.js
var FsWatcher = require('./watchers/FsWatcher.js');
module MyModule
@converter = Converter.new(:json)
class << self
def format=(format)
@converter.format = format
end
end
end
# we don't have knapsack in our :production gems group, so the deploy would fail without this condition
if Rails.env.development? || Rails.env.test?
require 'knapsack'
# we have multiple nodes, so we need different files for each node
def failing_scenarios_filename
"failing_scenarios_#{ENV['CIRCLE_NODE_INDEX']}.txt"
end
namespace :knapsack do
test:
override:
- bundle exec rake knapsack:rspec:
parallel: true
- bundle exec rake knapsack:cucumber_record_failing:
parallel: true
- bundle exec rake knapsack:cucumber_rerun:
parallel: true
Scenario: xxx # features/xxx.feature:19
PhantomJS has crashed. Please read the crash reporting guide at https://github.com/ariya/phantomjs/wiki/Crash-Reporting and file a bug report at https://github.com/ariya/phantomjs/issues/new with the crash dump file attached: /tmp/1a24bbe0-87e2-2753-3444a3a4-65f405d9.dmp
[1.78] Given Logged in User # features/step_definitions/support_steps.rb:9
PhantomJS client died while processing {"name":"visit","args":["http://127.0.0.1:39185/users/sign_in"]} (Capybara::Poltergeist::DeadClient)
./features/step_definitions/support_steps.rb:13:in `/^Logged in User$/'
features/xxx.feature:20:in `Given Logged in User'
failing_scenarios_*.txt
namespace :failing_cucumber_specs do
# we have multiple nodes, so we need different file for each node
FAILING_SCENARIOS_FILENAME = "failing_scenarios_#{ENV['CIRCLE_NODE_INDEX']}.txt"
task :record do
# run cucumber and record failing scenarios to the file
begin
Rake::Task['knapsack:cucumber'].invoke("-f rerun --out #{FAILING_SCENARIOS_FILENAME}")
rescue SystemExit => e
# exit 0, we don't want failed build because of this task
test:
override:
- bundle exec rake failing_cucumber_specs:record:
parallel: true
- bundle exec rake failing_cucumber_specs:rerun:
parallel: true
namespace :failing_cucumber_specs do
FAILING_SCENARIOS_FILENAME = 'failing_scenarios.txt'
task :record do
# run cucumber and record failing scenarios to the file
begin
Rake::Task['knapsack:cucumber'].invoke("-f rerun --out #{FAILING_SCENARIOS_FILENAME}")
rescue SystemExit => e
# exit 0, we don't want failed build because of this task
puts "#{e.class}: #{e.message}"