Skip to content

Instantly share code, notes, and snippets.

@stevenjackson
Forked from joelbyler/gist:4225565
Created December 6, 2012 16:06

Revisions

  1. @joelbyler joelbyler revised this gist Dec 6, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -30,7 +30,7 @@ task :regression_with_retry do
    rerun_successful = run_rake_task("rerun")
    end
    unless first_successful || rerun_successful
    raise CucumberFailure.new 'Cucumber tests failed'
    raise 'Cucumber tests failed'
    end
    end

  2. @joelbyler joelbyler revised this gist Dec 6, 2012. 1 changed file with 2 additions and 3 deletions.
    5 changes: 2 additions & 3 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -13,7 +13,7 @@ STDERR.puts ENV['PROFILE']


    desc 'Run regression'
    Cucumber::Rake::Task.new :regression do |t|
    Cucumber::Rake::Task.new :regression do |t|
    t.cucumber_opts = ["-p #{ENV['PROFILE']}", "--format rerun --out #{ENV['PROFILE']}_rerun.txt"]
    end

    @@ -34,5 +34,4 @@ task :regression_with_retry do
    end
    end

    #jruby -S rake regression_with_retry PROFILE=regression_a
    ----------------------------------------- Disclaimer: This message (and any attachments) is confidential and is intended only for the addressee(s). This message may contain information that is protected by one or more legally recognized privileges. If the reader of this message is not the intended recipient, I did not intend to waive, and I do not waive, any legal privilege or the confidentiality of the message. If you receive this message in error, please notify me immediately by return e-mail and delete this message from your computer and network without saving it in any manner. The unauthorized use, dissemination, distribution, or reproduction of this message, including attachments, is prohibited and may be unlawful.
    #jruby -S rake regression_with_retry PROFILE=regression_a
  3. @joelbyler joelbyler created this gist Dec 6, 2012.
    38 changes: 38 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,38 @@
    require 'cucumber/rake/task'

    def run_rake_task(name)
    begin
    Rake::Task[name].invoke
    rescue Exception => e
    return false
    end
    true
    end

    STDERR.puts ENV['PROFILE']


    desc 'Run regression'
    Cucumber::Rake::Task.new :regression do |t|
    t.cucumber_opts = ["-p #{ENV['PROFILE']}", "--format rerun --out #{ENV['PROFILE']}_rerun.txt"]
    end

    desc 'Rerun failed tests'
    Cucumber::Rake::Task.new :rerun do |t|
    t.cucumber_opts = ["-p #{ENV['PROFILE']}", "@#{ENV['PROFILE']}_rerun.txt"]
    end

    desc 'Run regression and rerun failed tests'
    task :regression_with_retry do
    first_successful = run_rake_task("regression")
    rerun_successful = true
    unless first_successful
    rerun_successful = run_rake_task("rerun")
    end
    unless first_successful || rerun_successful
    raise CucumberFailure.new 'Cucumber tests failed'
    end
    end

    #jruby -S rake regression_with_retry PROFILE=regression_a
    ----------------------------------------- Disclaimer: This message (and any attachments) is confidential and is intended only for the addressee(s). This message may contain information that is protected by one or more legally recognized privileges. If the reader of this message is not the intended recipient, I did not intend to waive, and I do not waive, any legal privilege or the confidentiality of the message. If you receive this message in error, please notify me immediately by return e-mail and delete this message from your computer and network without saving it in any manner. The unauthorized use, dissemination, distribution, or reproduction of this message, including attachments, is prohibited and may be unlawful.