Sha256: 73b9a1adfe5251f9ad357ca7db136a023d960d3e7329c8b0730ae6bb001b4556

Contents?: true

Size: 755 Bytes

Versions: 11

Compression:

Stored size: 755 Bytes

Contents

module KnapsackPro
  class Report
    def self.save
      repository_adapter = KnapsackPro::RepositoryAdapterInitiator.call
      action = KnapsackPro::Client::API::V1::BuildSubsets.create(
        commit_hash: repository_adapter.commit_hash,
        branch: repository_adapter.branch,
        node_total: KnapsackPro::Config::Env.ci_node_total,
        node_index: KnapsackPro::Config::Env.ci_node_index,
        test_files: KnapsackPro.tracker.to_a,
      )
      connection = KnapsackPro::Client::Connection.new(action)
      response = connection.call
      if connection.success?
        raise ArgumentError.new(response) if connection.errors?
        KnapsackPro.logger.info('Saved time execution report on API server.')
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
knapsack_pro-0.7.0 lib/knapsack_pro/report.rb
knapsack_pro-0.6.1 lib/knapsack_pro/report.rb
knapsack_pro-0.6.0 lib/knapsack_pro/report.rb
knapsack_pro-0.5.0 lib/knapsack_pro/report.rb
knapsack_pro-0.4.0 lib/knapsack_pro/report.rb
knapsack_pro-0.3.0 lib/knapsack_pro/report.rb
knapsack_pro-0.2.1 lib/knapsack_pro/report.rb
knapsack_pro-0.2.0 lib/knapsack_pro/report.rb
knapsack_pro-0.1.2 lib/knapsack_pro/report.rb
knapsack_pro-0.1.1 lib/knapsack_pro/report.rb
knapsack_pro-0.1.0 lib/knapsack_pro/report.rb