Class: Datadog::CI::TestOptimisation::Skippable

Inherits:
Object
  • Object
show all
Defined in:
lib/datadog/ci/test_optimisation/skippable.rb

Defined Under Namespace

Classes: Response

Instance Method Summary collapse

Constructor Details

#initialize(dd_env:, api: nil, config_tags: {}) ⇒ Skippable

Returns a new instance of Skippable.



60
61
62
63
64
# File 'lib/datadog/ci/test_optimisation/skippable.rb', line 60

def initialize(dd_env:, api: nil, config_tags: {})
  @api = api
  @dd_env = dd_env
  @config_tags = config_tags
end

Instance Method Details

#fetch_skippable_tests(test_session) ⇒ Object



66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/datadog/ci/test_optimisation/skippable.rb', line 66

def fetch_skippable_tests(test_session)
  api = @api
  return Response.new(nil) unless api

  request_payload = payload(test_session)
  Datadog.logger.debug("Fetching skippable tests with request: #{request_payload}")

  http_response = api.api_request(
    path: Ext::Transport::DD_API_SKIPPABLE_TESTS_PATH,
    payload: request_payload
  )

  Response.new(http_response)
end