Skip to content

Commit

Permalink
Latests minor improves
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianvarela committed Aug 11, 2021
1 parent 794bf88 commit 64c33fb
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
22 changes: 14 additions & 8 deletions DangerFile
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,25 @@ end

#FILE HELPERS
gitfiles = (git.modified_files + git.added_files).uniq
output_dir = "./output"

build_reports = []
test_reports = []
Find.find("./output") do |path|
build_reports << path if path =~ /.*\.build-report.json$/
test_reports << path if path =~ /.*report.junit$/
if File.directory?(output_dir)
Find.find(output_dir) do |path|
build_reports << path if path =~ /.*\.build-report.json$/
test_reports << path if path =~ /.*report.junit$/
end
else
fail "The #{output_dir} dir is empty, usually this means that no flavor has been compiled"
end

# CHECK REPORTS:
if build_reports.length != test_reports.length
fail "Not all targets successfully completed the tests. (#{build_reports.length} builds vs #{test_reports.length} tests reports)"
end
fail "Not all targets could be compiled. Check if any flavor dont build. (We have #{build_reports.length} builds)" unless build_reports.length == 8

#BASIC CHECKS:
warn 'Big PR, try to keep changes smaller if you can 😜' if git.lines_of_code > 500
fail 'This PR does not have any assignees yet.' unless github.pr_json["assignee"]
Expand All @@ -44,12 +55,7 @@ end
#JUNIT PARSE:
test_reports.each do |path|
path = Pathname(path)
junit.parse path.to_s
junit.report

all_test = junit.tests.map(&:attributes)
slowest_test = all_test.sort_by { |attributes| attributes[:time].to_f }.last
message "⌛️ **[#{read_platform_from_testreport_file(path: path)}]** Slowest test: #{slowest_test[:name]} took #{'%.3f' % slowest_test[:time]} seconds"
end

#SWIFTLINT
Expand Down
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ gem "danger"
gem "danger-xcodebuild"
gem "danger-swiftlint"
gem "danger-xcov"
gem "danger-junit"
gem "danger-xcode_summary"

plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile')
Expand Down
5 changes: 0 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,6 @@ GEM
no_proxy_fix
octokit (~> 4.7)
terminal-table (>= 1, < 4)
danger-junit (1.0.2)
danger (> 2.0)
ox (~> 2.0)
danger-plugin-api (1.0.0)
danger (> 2.0)
danger-swiftlint (0.26.0)
Expand Down Expand Up @@ -267,7 +264,6 @@ GEM
childprocess (>= 0.6.3, < 5)
iniparse (~> 1.4)
rexml (~> 3.2)
ox (2.14.5)
plist (3.6.0)
public_suffix (4.0.6)
rake (13.0.6)
Expand Down Expand Up @@ -347,7 +343,6 @@ PLATFORMS
DEPENDENCIES
cocoapods
danger
danger-junit
danger-swiftlint
danger-xcode_summary
danger-xcodebuild
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ With Mini, you can create a thread-safe application with a predictable unidirect
[![Platform](https://img.shields.io/cocoapods/p/MasMini-Swift.svg?style=flat)](https://cocoapods.org/pods/MasMini-Swift)
[![GitHub](https://img.shields.io/github/license/masmovil/masmini-swift.svg)](https://github.com/masmovil/masmini-swift/blob/master/LICENSE)

[![Build Status](https://travis-ci.com/masmovil/masmini-swift.svg?branch=master)](https://travis-ci.com/masmovil/masmini-swift)
[![Build Status](https://github.com/masmovil/masmini-swift/actions/workflows/build-and-tests.yml/badge.svg)](https://github.com/masmovil/masmini-swift/actions/workflows/build-and-tests.yml)
[![codecov](https://codecov.io/gh/masmovil/masmini-swift/branch/master/graph/badge.svg)](https://codecov.io/gh/masmovil/masmini-swift)

## Requirements
Expand Down

0 comments on commit 64c33fb

Please sign in to comment.