class Inferno::Repositories::TestSessions

Repository that deals with persistence for the `TestSession` entity.

Public Instance Methods

json_serializer_options() click to toggle source
# File lib/inferno/repositories/test_sessions.rb, line 9
def json_serializer_options
  {
    include: {
      results: results_repo.json_serializer_options,
      test_runs: {}
    }
  }
end
results_for_test_session(test_session_id) click to toggle source
# File lib/inferno/repositories/test_sessions.rb, line 18
def results_for_test_session(test_session_id)
  test_session_hash =
    self.class::Model
      .find(id: test_session_id)
      .to_json_data(json_serializer_options)
      .deep_symbolize_keys!

  test_session_hash[:results]
    .map! { |result| results_repo.build_entity(result) }
end