Skip to content

Commit

Permalink
more debug logging, do not skip tests when running in forked processes
Browse files Browse the repository at this point in the history
  • Loading branch information
anmarchenko committed Apr 29, 2024
1 parent 4534437 commit 57ec390
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions lib/datadog/ci/itr/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,11 @@ def mark_if_skippable(test)

skippable_test_id = Utils::TestRun.skippable_test_id(test.name, test.test_suite_name, test.parameters)
if @skippable_tests.include?(skippable_test_id)
if forked?
Datadog.logger.warn { "ITR is not supported for forking test runners yet" }
return
end

test.set_tag(Ext::Test::TAG_ITR_SKIPPED_BY_ITR, "true")

Datadog.logger.debug { "Marked test as skippable: #{skippable_test_id}" }
Expand All @@ -138,13 +143,13 @@ def mark_if_skippable(test)
end

def count_skipped_test(test)
return if !test.skipped? || !test.skipped_by_itr?

if forked?
Datadog.logger.warn { "ITR is not supported for forking test runners yet" }
return
end

return if !test.skipped? || !test.skipped_by_itr?

@mutex.synchronize do
@skipped_tests_count += 1
end
Expand All @@ -153,6 +158,9 @@ def count_skipped_test(test)
def write_test_session_tags(test_session)
return if !enabled?

Datadog.logger.debug { "Finished ITR session with test skipping enabled: #{@test_skipping_enabled}" }
Datadog.logger.debug { "#{@skipped_tests_count} tests were skipped" }

test_session.set_tag(Ext::Test::TAG_ITR_TESTS_SKIPPED, @skipped_tests_count.positive?.to_s)
test_session.set_tag(Ext::Test::TAG_ITR_TEST_SKIPPING_COUNT, @skipped_tests_count)
end
Expand Down Expand Up @@ -201,6 +209,7 @@ def fetch_skippable_tests(test_session:, git_tree_upload_worker:)
@skippable_tests = skippable_response.tests

Datadog.logger.debug { "Fetched skippable tests: \n #{@skippable_tests}" }
Datadog.logger.debug { "Found #{@skippable_tests.count} skippable tests." }
Datadog.logger.debug { "ITR correlation ID: #{@correlation_id}" }
end
end
Expand Down

0 comments on commit 57ec390

Please sign in to comment.