Skip to content

Instantly share code, notes, and snippets.

@emanuil
emanuil / cucumber_test_case_counter.rb
Created January 25, 2017 09:05
A tool to count the number of test cases per feature file in order to evenly distribute them then running in parallel
require 'gherkin/parser'
require 'gherkin/pickles/compiler'
@test_case_files = []
@tags_to_ignore = ['@no_parallel', '@wip', '@bug', '@live', '@real', '@mobile', '@site']
all_feature_files = Dir.glob("./**/*.feature")
all_feature_files.each do |feature_file|
#!/usr/bin/env ruby
require 'fileutils'
require 'json'
contents = JSON.parse(IO.read(ARGV[0]))
## There are error types that cause lots of false positives. HHVM is still not perfect for them and
## there is not much sense to mark the commit as failed because of the. As HHVM grows better, we need
## to reevaluate the detection of those errors again.