Sha256: cbeb1e32ad7847743ba7266dc22e1420af1ec4124d8c26bf0da99e4ef0938f7f

Contents?: true

Size: 1005 Bytes

Versions: 55

Compression:

Stored size: 1005 Bytes

Contents

require_relative '../../serializers/test_run'

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

          def handle(req, res)
            test_run = repo.find(req.params[:id])
            halt 404 if test_run.nil?

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

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

Version data entries

55 entries across 55 versions & 1 rubygems

Version Path
inferno_core-0.6.2 lib/inferno/apps/web/controllers/test_runs/show.rb
inferno_core-0.6.1 lib/inferno/apps/web/controllers/test_runs/show.rb
inferno_core-0.6.0 lib/inferno/apps/web/controllers/test_runs/show.rb
inferno_core-0.5.4 lib/inferno/apps/web/controllers/test_runs/show.rb
inferno_core-0.5.3 lib/inferno/apps/web/controllers/test_runs/show.rb
inferno_core-0.5.2 lib/inferno/apps/web/controllers/test_runs/show.rb
inferno_core-0.5.1 lib/inferno/apps/web/controllers/test_runs/show.rb
inferno_core-0.5.0 lib/inferno/apps/web/controllers/test_runs/show.rb
inferno_core-0.4.44 lib/inferno/apps/web/controllers/test_runs/show.rb
inferno_core-0.4.43 lib/inferno/apps/web/controllers/test_runs/show.rb
inferno_core-0.4.42 lib/inferno/apps/web/controllers/test_runs/show.rb
inferno_core-0.4.41 lib/inferno/apps/web/controllers/test_runs/show.rb
inferno_core-0.4.40 lib/inferno/apps/web/controllers/test_runs/show.rb
inferno_core-0.4.39 lib/inferno/apps/web/controllers/test_runs/show.rb
inferno_core-0.4.38 lib/inferno/apps/web/controllers/test_runs/show.rb
inferno_core-0.4.35 lib/inferno/apps/web/controllers/test_runs/show.rb
inferno_core-0.4.34 lib/inferno/apps/web/controllers/test_runs/show.rb
inferno_core-0.4.33 lib/inferno/apps/web/controllers/test_runs/show.rb
inferno_core-0.4.32 lib/inferno/apps/web/controllers/test_runs/show.rb
inferno_core-0.4.31 lib/inferno/apps/web/controllers/test_runs/show.rb