Skip to content

Commit

Permalink
[scan] Keep initial xcresult (#18555)
Browse files Browse the repository at this point in the history
* retry test shouldnt remove initial xcresult

* fix tests
  • Loading branch information
Corey Werner committed Apr 20, 2021
1 parent 0caaadf commit 620cf59
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions scan/lib/scan/runner.rb
Expand Up @@ -55,6 +55,8 @@ def test_app
end

def execute(retries: 0)
Scan.cache[:retry_attempt] = Scan.config[:number_of_retries] - retries

command = @test_command_generator.generate

prefix_hash = [
Expand Down
4 changes: 3 additions & 1 deletion scan/lib/scan/test_command_generator.rb
Expand Up @@ -164,8 +164,10 @@ def build_path

# The path to the result bundle
def result_bundle_path
retry_count = Scan.cache[:retry_attempt] || 0
attempt = retry_count > 0 ? "-#{retry_count}" : ""
ext = FastlaneCore::Helper.xcode_version.to_i >= 11 ? '.xcresult' : '.test_result'
path = File.join(Scan.config[:output_directory], Scan.config[:scheme]) + ext
path = File.join(Scan.config[:output_directory], Scan.config[:scheme]) + attempt + ext
if File.directory?(path)
FileUtils.remove_dir(path)
end
Expand Down

0 comments on commit 620cf59

Please sign in to comment.