Sha256: b77f44700872c8a020555a7038761362657a23aafd8d178016e6502cd9aa9c6d

Contents?: true

Size: 931 Bytes

Versions: 5

Compression:

Stored size: 931 Bytes

Contents

module Inferno
  module Web
    module Controllers
      module TestRuns
        class Show < Controller
          include Import[test_sessions_repo: 'repositories.test_sessions']

          def call(params)
            test_run = repo.find(params[:id])
            halt 404 if test_run.nil?

            if params[:include_results] == 'true'
              results_repo = Inferno::Repositories::Results.new
              test_run.results =
                if params[:after].present?
                  results_repo.test_run_results_after(test_run_id: test_run.id, after: Time.parse(params[:after]))
                else
                  repo.results_for_test_run(test_run.id)
                end
            end

            test_session = test_sessions_repo.find(test_run.test_session_id)
            self.body = serialize(test_run, suite_options: test_session.suite_options)
          end
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
inferno_core-0.3.12 lib/inferno/apps/web/controllers/test_runs/show.rb
inferno_core-0.3.11 lib/inferno/apps/web/controllers/test_runs/show.rb
inferno_core-0.3.10 lib/inferno/apps/web/controllers/test_runs/show.rb
inferno_core-0.3.9 lib/inferno/apps/web/controllers/test_runs/show.rb
inferno_core-0.3.8 lib/inferno/apps/web/controllers/test_runs/show.rb