Sha256: 3f2c714a4bb22ac7dc81ffc2b198b8e45edbc36fa26b620adbfc3e7a4b9d2f71

Contents?: true

Size: 1.01 KB

Versions: 17

Compression:

Stored size: 1.01 KB

Contents

# frozen_string_literal: true
require_relative "rspec_formatter"
require_relative "extract_definitions"

module RubyCI
  module DryrunRunnerPrepend
    def run(err, out)
      @rspec_started_at = Time.now
      super
    end

    def exit_code(examples_passed=false)
      run_time = Time.now - (@rspec_started_at || 1.seconds.ago)
      events = @world.non_example_failure ? [['RSPEC_DRYRUN', { failed_after: run_time, test_env_number: ENV["TEST_ENV_NUMBER"], data: 'error' }]] : [['RSPEC_DRYRUN', { succeed_after: run_time, test_env_number: ENV["TEST_ENV_NUMBER"] }]]
      STDOUT.puts events.inspect
      json_events = {
        build_id: RubyCI.configuration.orig_build_id,
        compressed_data: Base64.strict_encode64(Zlib::Deflate.deflate(JSON.fast_generate(events), 9)),
      }
      RubyCI.send_events(json_events)

      return @configuration.error_exit_code || @configuration.failure_exit_code if @world.non_example_failure
      return @configuration.failure_exit_code unless examples_passed

      0
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
ruby_ci-0.2.26 lib/ruby_ci/dryrun_runner_prepend.rb
ruby_ci-0.2.25 lib/ruby_ci/dryrun_runner_prepend.rb
ruby_ci-0.2.24 lib/ruby_ci/dryrun_runner_prepend.rb
ruby_ci-0.2.23 lib/ruby_ci/dryrun_runner_prepend.rb
ruby_ci-0.2.22 lib/ruby_ci/dryrun_runner_prepend.rb
ruby_ci-0.2.21 lib/ruby_ci/dryrun_runner_prepend.rb
ruby_ci-0.2.20 lib/ruby_ci/dryrun_runner_prepend.rb
ruby_ci-0.2.19 lib/ruby_ci/dryrun_runner_prepend.rb
ruby_ci-0.2.18 lib/ruby_ci/dryrun_runner_prepend.rb
ruby_ci-0.2.17 lib/ruby_ci/dryrun_runner_prepend.rb
ruby_ci-0.2.16 lib/ruby_ci/dryrun_runner_prepend.rb
ruby_ci-0.2.15 lib/ruby_ci/dryrun_runner_prepend.rb
ruby_ci-0.2.14 lib/ruby_ci/dryrun_runner_prepend.rb
ruby_ci-0.2.13 lib/ruby_ci/dryrun_runner_prepend.rb
ruby_ci-0.2.12 lib/ruby_ci/dryrun_runner_prepend.rb
ruby_ci-0.2.11 lib/ruby_ci/dryrun_runner_prepend.rb
ruby_ci-0.2.10 lib/ruby_ci/dryrun_runner_prepend.rb