Sha256: 4cc3c64b9c779936b2799c57695cf4b1694f8f72accdc6e3e562304295151df5

Contents?: true

Size: 1.01 KB

Versions: 14

Compression:

Stored size: 1.01 KB

Contents

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

module FastCI
  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: FastCI.configuration.orig_build_id,
        compressed_data: Base64.strict_encode64(Zlib::Deflate.deflate(JSON.fast_generate(events), 9)),
      }
      FastCI.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

14 entries across 14 versions & 1 rubygems

Version Path
fast_ci-1.1.1 lib/fast_ci/dryrun_runner_prepend.rb
fast_ci-1.1.0 lib/fast_ci/dryrun_runner_prepend.rb
fast_ci-1.0.11 lib/fast_ci/dryrun_runner_prepend.rb
fast_ci-1.0.10 lib/fast_ci/dryrun_runner_prepend.rb
fast_ci-1.0.9 lib/fast_ci/dryrun_runner_prepend.rb
fast_ci-1.0.8 lib/fast_ci/dryrun_runner_prepend.rb
fast_ci-1.0.7 lib/fast_ci/dryrun_runner_prepend.rb
fast_ci-1.0.6 lib/fast_ci/dryrun_runner_prepend.rb
fast_ci-1.0.5 lib/fast_ci/dryrun_runner_prepend.rb
fast_ci-1.0.4 lib/fast_ci/dryrun_runner_prepend.rb
fast_ci-1.0.3 lib/fast_ci/dryrun_runner_prepend.rb
fast_ci-1.0.2 lib/fast_ci/dryrun_runner_prepend.rb
fast_ci-1.0.1 lib/fast_ci/dryrun_runner_prepend.rb
fast_ci-1.0.0 lib/fast_ci/dryrun_runner_prepend.rb