Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 59 additions & 26 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,44 +1,63 @@
PATH
remote: .
specs:
danger-xcode_summary (1.4.0)
danger-xcode_summary (1.5.0)
danger-plugin-api (~> 1.0)
xcresult (~> 0.2.2)

GEM
remote: https://rubygems.org/
specs:
activesupport (8.0.2.1)
base64
benchmark (>= 0.3)
bigdecimal
concurrent-ruby (~> 1.0, >= 1.3.1)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
logger (>= 1.4.2)
minitest (>= 5.1)
securerandom (>= 0.3)
tzinfo (~> 2.0, >= 2.0.5)
uri (>= 0.13.1)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
ast (2.4.3)
base64 (0.3.0)
benchmark (0.4.1)
bigdecimal (3.2.2)
claide (1.1.0)
claide-plugins (0.9.2)
cork
nap
open4 (~> 1.3)
coderay (1.1.3)
colored2 (3.1.2)
cork (0.3.0)
colored2 (~> 3.1)
danger (9.5.1)
colored (1.2)
colored2 (4.0.3)
concurrent-ruby (1.3.5)
connection_pool (2.5.3)
cork (0.2.0)
colored (~> 1.2)
danger (9.5.3)
base64 (~> 0.2)
claide (~> 1.0)
claide-plugins (>= 0.9.2)
colored2 (~> 3.1)
colored2 (>= 3.1, < 5)
cork (~> 0.1)
faraday (>= 0.9.0, < 3.0)
faraday-http-cache (~> 2.0)
git (~> 1.13)
kramdown (~> 2.3)
git (>= 1.13, < 3.0)
kramdown (>= 2.5.1, < 3.0)
kramdown-parser-gfm (~> 1.0)
octokit (>= 4.0)
pstore (~> 0.1)
terminal-table (>= 1, < 4)
terminal-table (>= 1, < 5)
danger-plugin-api (1.0.0)
danger (> 2.0)
diff-lcs (1.6.2)
faraday (2.13.1)
drb (2.2.3)
faraday (2.13.4)
faraday-net_http (>= 2.0, < 3.5)
json
logger
Expand All @@ -47,9 +66,12 @@ GEM
faraday-net_http (3.4.1)
net-http (>= 0.5.0)
ffi (1.17.2)
formatador (1.1.0)
git (1.19.1)
formatador (1.2.0)
reline
git (2.3.3)
activesupport (>= 5.0)
addressable (~> 2.8)
process_executer (~> 1.1)
rchardet (~> 1.8)
guard (2.19.1)
formatador (>= 0.2.4)
Expand All @@ -67,7 +89,10 @@ GEM
guard (~> 2.1)
guard-compat (~> 1.1)
rspec (>= 2.99.0, < 4.0)
json (2.12.2)
i18n (1.14.7)
concurrent-ruby (~> 1.0)
io-console (0.8.1)
json (2.13.2)
kramdown (2.5.1)
rexml (>= 3.3.9)
kramdown-parser-gfm (1.1.0)
Expand All @@ -78,8 +103,9 @@ GEM
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
logger (1.7.0)
lumberjack (1.2.10)
lumberjack (1.4.0)
method_source (1.1.0)
minitest (5.25.5)
nap (1.1.0)
nenv (0.3.0)
net-http (0.6.0)
Expand All @@ -91,12 +117,13 @@ GEM
faraday (>= 1, < 3)
sawyer (~> 0.9)
open4 (1.3.4)
ostruct (0.6.1)
ostruct (0.6.3)
parallel (1.27.0)
parser (3.3.8.0)
parser (3.3.9.0)
ast (~> 2.4.1)
racc
prism (1.4.0)
process_executer (1.3.0)
pry (0.15.2)
coderay (~> 1.1)
method_source (~> 1.0)
Expand All @@ -109,43 +136,49 @@ GEM
rb-inotify (0.11.1)
ffi (~> 1.0)
rchardet (1.9.0)
regexp_parser (2.10.0)
regexp_parser (2.11.2)
reline (0.6.2)
io-console (~> 0.5)
rexml (3.4.1)
rspec (3.13.1)
rspec-core (~> 3.13.0)
rspec-expectations (~> 3.13.0)
rspec-mocks (~> 3.13.0)
rspec-core (3.13.4)
rspec-core (3.13.5)
rspec-support (~> 3.13.0)
rspec-expectations (3.13.5)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-mocks (3.13.5)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-support (3.13.4)
rubocop (1.76.1)
rspec-support (3.13.5)
rubocop (1.80.0)
json (~> 2.3)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.1.0)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 2.9.3, < 3.0)
rubocop-ast (>= 1.45.0, < 2.0)
rubocop-ast (>= 1.46.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.45.1)
rubocop-ast (1.46.0)
parser (>= 3.3.7.2)
prism (~> 1.4)
ruby-progressbar (1.13.0)
sawyer (0.9.2)
addressable (>= 2.3.5)
faraday (>= 0.17.3, < 3)
securerandom (0.4.1)
shellany (0.0.1)
terminal-table (1.6.0)
thor (1.3.2)
unicode-display_width (3.1.4)
terminal-table (4.0.0)
unicode-display_width (>= 1.1.1, < 4)
thor (1.4.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (3.1.5)
unicode-emoji (~> 4.0, >= 4.0.4)
unicode-emoji (4.0.4)
uri (1.0.3)
Expand All @@ -169,4 +202,4 @@ DEPENDENCIES
yard

BUNDLED WITH
2.3.0
2.4.22
2 changes: 1 addition & 1 deletion lib/xcode_summary/gem_version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module XcodeSummary
VERSION = '1.4.0'
VERSION = '1.5.0'
end
61 changes: 35 additions & 26 deletions lib/xcode_summary/plugin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,38 @@ def warning_error_count(file_path)

private

def filter_retried_tests(subtests)
return subtests unless ignore_retried_tests

subtests_without_retry_attempt = subtests.group_by(&:identifier).values.map do |group|
if group.length > 1 && group.any? { |subtest| subtest.test_status == 'Success' }
group.reject { |subtest| subtest.test_status == 'Failure' }
else
group
end
end
subtests_without_retry_attempt.flatten
end

def create_test_run_data(action_test_object, test_summary)
subtests = action_test_object.all_subtests
subtests_duration = subtests.map(&:duration).sum

subtests = filter_retried_tests(subtests)

failed_tests_count = subtests.reject { |test| test.test_status == 'Success' }.count
expected_failed_tests_count = subtests.select { |test| test.test_status == 'Expected Failure' }.count

{
target_name: test_summary.target_name,
test_count: subtests.count,
failed_tests_count: failed_tests_count,
expected_failed_tests_count: expected_failed_tests_count,
tests_duration: subtests_duration,
action_duration: action_test_object.duration
}
end

def format_summary(xcode_summary)
messages(xcode_summary).each { |s| message(s, sticky: sticky_summary) }
all_warnings = []
Expand Down Expand Up @@ -243,31 +275,7 @@ def messages(xcode_summary)
summary.testable_summaries.map do |test_summary|
test_summary.tests.filter_map do |action_test_object|
if action_test_object.instance_of? XCResult::ActionTestSummaryGroup
subtests = action_test_object.all_subtests
subtests_duration = subtests.map(&:duration).sum

if ignore_retried_tests
subtests_without_retry_attempt = subtests.group_by(&:identifier).values.map do |group|
if group.length > 1 && group.any? { |subtest| subtest.test_status == 'Success' }
group.reject { |subtest| subtest.test_status == 'Failure' }
else
group
end
end
subtests = subtests_without_retry_attempt.flatten
end

failed_tests_count = subtests.reject { |test| test.test_status == 'Success' }.count
expected_failed_tests_count = subtests.select { |test| test.test_status == 'Expected Failure' }.count

{
target_name: test_summary.target_name,
test_count: subtests.count,
failed_tests_count: failed_tests_count,
expected_failed_tests_count: expected_failed_tests_count,
tests_duration: subtests_duration,
action_duration: action_test_object.duration
}
create_test_run_data(action_test_object, test_summary)
end
end
end
Expand Down Expand Up @@ -339,7 +347,8 @@ def errors(action)
action.action_result.issues.test_failure_summaries,
action.build_result.issues.test_failure_summaries
].flatten.compact.map do |summary|
if ignore_retried_tests && successfully_retried_test_identifiers.include?(sanitized_test_case_name(summary.test_case_name))
if ignore_retried_tests &&
successfully_retried_test_identifiers.include?(sanitized_test_case_name(summary.test_case_name))
next
end

Expand Down
Loading