Skip to content

Commit

Permalink
debug logs for ITR configs and change readme for webmock and vcr
Browse files Browse the repository at this point in the history
  • Loading branch information
anmarchenko committed Mar 5, 2024
1 parent fb76b51 commit 4651472
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ Webmock accordingly.
```ruby
# when using agentless mode
# note to use the correct datadog site (e.g. datadoghq.eu, etc)
WebMock.disable_net_connect!(:allow => "citestcycle-intake.datadoghq.com")
WebMock.disable_net_connect!(:allow => /datadoghq.com/)

# when using agent
WebMock.disable_net_connect!(:allow_localhost => true)
Expand All @@ -199,7 +199,7 @@ VCR.configure do |config|

# when using agentless mode
# note to use the correct datadog site (e.g. datadoghq.eu, etc)
config.ignore_hosts "citestcycle-intake.datadoghq.com"
config.ignore_hosts "citestcycle-intake.datadoghq.com", "api.datadoghq.com"
end
```

Expand Down
6 changes: 6 additions & 0 deletions lib/datadog/ci/itr/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@ def initialize(
@enabled = enabled
@test_skipping_enabled = false
@code_coverage_enabled = false

Datadog.logger.debug("ITR Runner initialized with enabled: #{@enabled}")
end

def configure(remote_configuration, test_session)
Datadog.logger.debug("Configuring ITR Runner with remote configuration: #{remote_configuration}")

@enabled = convert_to_bool(
remote_configuration.fetch(Ext::Transport::DD_API_SETTINGS_RESPONSE_ITR_ENABLED_KEY, false)
)
Expand All @@ -36,6 +40,8 @@ def configure(remote_configuration, test_session)

# we skip tests, not suites
test_session.set_tag(Ext::Test::TAG_ITR_TEST_SKIPPING_TYPE, Ext::Test::ITR_TEST_SKIPPING_MODE)

Datadog.logger.debug("Configured ITR Runner with enabled: #{@enabled}, skipping_tests: #{@test_skipping_enabled}, code_coverage: #{@code_coverage_enabled}")
end

def enabled?
Expand Down
15 changes: 10 additions & 5 deletions lib/datadog/ci/transport/remote_settings_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,17 @@ def fetch_library_settings(test_session)
api = @api
return Response.new(nil) unless api

Response.new(
api.api_request(
path: Ext::Transport::DD_API_SETTINGS_PATH,
payload: payload(test_session)
)
request_payload = payload(test_session)
Datadog.logger.debug("Fetching library settings with request: #{request_payload}")

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

Datadog.logger.debug("Library settings response: #{http_response}")

Response.new(http_response)
end

private
Expand Down

0 comments on commit 4651472

Please sign in to comment.