fastlane: Scan cannot find .xcresult when testing a Swift Package since 2.201.2

New Regression Checklist

Regression Information

  • Breaking version: 2.201.2
  • Last working version: 2.201.1

Regression Description

We have a Swift package as a part of an Xcode workspace and we use scan to run tests for it. Since 2.201.2 scan throws the following error after all tests succeeded:

+------------------------------+----------------+
|                 Lane Context                  |
+------------------------------+----------------+
| DEFAULT_PLATFORM             | ios            |
| PLATFORM_NAME                | ios            |
| LANE_NAME                    | ios tests      |
| SCAN_GENERATED_XCRESULT_PATH |                |
| SCAN_DERIVED_DATA_PATH       | ../DerivedData |
| SCAN_GENERATED_PLIST_FILES   | []             |
| SCAN_GENERATED_PLIST_FILE    |                |
+------------------------------+----------------+
[08:16:49]: Cannot find .xcresult in derived data which is needed to determine test results. This is an issue within scan. File an issue on GitHub or try setting option `result_bundle: true`

We tried setting option result_bundle: true as suggested and got a different error:

+------------------------------+----------------------------------------------------------------------------------------------------+
|                                                    Lane Context                                                                   |
+------------------------------+----------------------------------------------------------------------------------------------------+
| DEFAULT_PLATFORM             | ios                                                                                                |
| PLATFORM_NAME                | ios                                                                                                |
| LANE_NAME                    | ios tests                                                                                          |
| SCAN_GENERATED_XCRESULT_PATH | /Users/ondrejkycelt/XcodeProjects/PROJECT_DIRECTORY/fastlane/test_output/SwiftPackageName.xcresult |
| SCAN_DERIVED_DATA_PATH       | ../DerivedData                                                                                     |
| SCAN_GENERATED_PLIST_FILES   | []                                                                                                 |
| SCAN_GENERATED_PLIST_FILE    |                                                                                                    |
+------------------------------+----------------------------------------------------------------------------------------------------+
[08:11:26]: File not found at path '/Users/ondrejkycelt/XcodeProjects/PROJECT_DIRECTORY/fastlane/test_output/SwiftPackageName.xcresult'

With the result_bundle: true option the SwiftPackageName.xcresult file seems to have ended up in PROJECT_DIRECTORY/SwiftPackageName/fastlane/test_output/SwiftPackageName.xcresult instead of PROJECT_DIRECTORY/fastlane/test_output/SwiftPackageName.xcresult'

We pass the following arguments to scan:

scan(
  derived_data_path: '../DerivedData',
  package_path: './SwiftPackageName',
  scheme: 'SwiftPackageName',
  device: 'iPhone 13 Pro',
  cloned_source_packages_path: '../SourcePackages',
  disable_package_automatic_updates: true
)

Captured Output

Command Used: tests --capture_output

Output/Log

INFO [2022-02-24 08:02:22.23]: Successfully loaded custom action '/Users/ondrejkycelt/XcodeProjects/PROJECT_DIRECTORY/fastlane/actions/update_portal_url.rb'.
INFO [2022-02-24 08:02:22.23]: Successfully loaded custom action '/Users/ondrejkycelt/XcodeProjects/PROJECT_DIRECTORY/fastlane/actions/update_translations.rb'.
INFO [2022-02-24 08:02:22.23]: Successfully loaded custom action '/Users/ondrejkycelt/XcodeProjects/PROJECT_DIRECTORY/fastlane/actions/update_config.rb'.
INFO [2022-02-24 08:02:22.23]: Successfully loaded custom action '/Users/ondrejkycelt/XcodeProjects/PROJECT_DIRECTORY/fastlane/actions/mattermost.rb'.
DEBUG [2022-02-24 08:02:22.23]: Checking if there are any plugins that should be loaded...
DEBUG [2022-02-24 08:02:22.23]: Loading 'fastlane-plugin-xcconfig' plugin
INFO [2022-02-24 08:02:22.23]: gem 'fastlane-plugin-xcconfig' is already installed


🚫 fastlane environment 🚫

Stack

Key Value
OS 12.2.1
Ruby 2.6.8
Bundler? true
Git git version 2.32.0 (Apple Git-132)
Installation Source /usr/local/bin/fastlane
Host macOS 12.2.1 (21D62)
Ruby Lib Dir /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib
OpenSSL Version LibreSSL 2.8.3
Is contained false
Is homebrew false
Is installed via Fabric.app false
Xcode Path /Applications/Xcode.app/Contents/Developer/
Xcode Version 13.2.1
Swift Version 5.5.2

System Locale

Error
No Locale with UTF8 found 🚫

fastlane files:

`./fastlane/Fastfile`
# frozen_string_literal: true

# This file contains the fastlane.tools configuration
# You can find the documentation at https://docs.fastlane.tools
#
# For a list of all available actions, check out
#
#     https://docs.fastlane.tools/actions
#
# For a list of all available plugins, check out
#
#     https://docs.fastlane.tools/plugins/available-plugins
#

# Uncomment the line if you want fastlane to automatically update itself
# update_fastlane

default_platform(:ios)

platform :ios do
  desc 'Run tests'
  lane :tests do |options|
    scan(
      derived_data_path: '../DerivedData',
      package_path: './SwiftPackageName',
      scheme: 'SwiftPackageName',
      device: 'iPhone 13 Pro',
      cloned_source_packages_path: '../SourcePackages',
      disable_package_automatic_updates: true
    )
  end
end
`./fastlane/Appfile`
apple_id("**")

fastlane gems

Gem Version Update-Status
fastlane 2.201.2 🚫 Update available

Loaded fastlane plugins:

Plugin Version Update-Status
fastlane-plugin-xcconfig 2.0.0 βœ… Up-To-Date
Loaded gems
Gem Version
did_you_mean 1.3.0
bundler 2.1.4
rake 13.0.6
rexml 3.2.5
CFPropertyList 3.0.5
public_suffix 4.0.6
addressable 2.8.0
artifactory 3.0.15
ast 2.4.2
atomos 0.1.3
aws-eventstream 1.2.0
aws-partitions 1.558.0
aws-sigv4 1.4.0
jmespath 1.6.0
aws-sdk-core 3.126.2
aws-sdk-kms 1.54.0
aws-sdk-s3 1.112.0
babosa 1.0.4
claide 1.1.0
colored 1.2
colored2 3.1.2
highline 2.0.3
commander 4.6.0
declarative 0.0.20
digest-crc 0.6.4
unf_ext 0.0.8
unf 0.1.4
domain_name 0.5.20190701
dotenv 2.7.6
emoji_regex 3.2.3
excon 0.91.0
faraday-em_http 1.0.0
faraday-em_synchrony 1.0.0
faraday-excon 1.1.0
faraday-httpclient 1.0.1
multipart-post 2.0.0
faraday-multipart 1.0.3
faraday-net_http 1.0.1
faraday-net_http_persistent 1.2.0
faraday-patron 1.0.0
faraday-rack 1.0.0
faraday-retry 1.0.3
ruby2_keywords 0.0.5
faraday 1.10.0
http-cookie 1.0.4
faraday-cookie_jar 0.0.7
faraday_middleware 1.2.0
fastimage 2.2.6
gh_inspector 1.1.3
jwt 2.3.0
memoist 0.16.2
multi_json 1.15.0
os 1.1.4
signet 0.16.0
googleauth 1.1.1
httpclient 2.8.3
mini_mime 1.1.2
trailblazer-option 0.1.2
uber 0.1.0
representable 3.1.1
retriable 3.1.2
webrick 1.7.0
google-apis-core 0.4.2
google-apis-androidpublisher_v3 0.16.0
google-apis-playcustomapp_v1 0.7.0
google-apis-iamcredentials_v1 0.10.0
google-apis-storage_v1 0.11.0
google-cloud-env 1.5.0
google-cloud-errors 1.2.0
google-cloud-core 1.6.0
google-cloud-storage 1.36.1
json 2.6.1
mini_magick 4.11.0
naturally 2.2.1
optparse 0.1.1
plist 3.6.0
rubyzip 2.3.2
security 0.1.3
simctl 1.6.8
terminal-notifier 2.0.0
terminal-table 1.6.0
tty-screen 0.8.1
tty-cursor 0.7.1
tty-spinner 0.9.3
word_wrap 1.0.0
nanaimo 0.3.0
xcodeproj 1.21.0
rouge 2.0.7
xcpretty 0.3.0
xcpretty-travis-formatter 1.0.1
fastlane-plugin-xcconfig 2.0.0
rchardet 1.8.0
git 1.9.1
mime-types-data 3.2021.0901
mime-types 3.3.1
multi_xml 0.6.0
httparty 0.20.0
parallel 1.21.0
parser 3.0.2.0
rainbow 3.0.0
regexp_parser 2.1.1
rubocop-ast 1.12.0
ruby-progressbar 1.11.0
unicode-display_width 2.1.0
rubocop 1.22.3
slack-notifier 2.4.0

generated on: 2022-02-24

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 7
  • Comments: 19 (2 by maintainers)

Commits related to this issue

Most upvoted comments

in my Fastfile, in scan… I’ve been able to get it to work doing this:

    result_bundle: true,
    output_directory: Dir.pwd + "/test_output"

The pull request #20135 gives this issue a workaround, but seems it is not under active review or in merge process. We are suffering this issue for more than a month and stuck in 2.199… 😦

We are experiencing this even with the workaround. on Xcode 14.2 and fastlane 2.212.1. Executing the scan with the following

@kublaios yes, when running locally I just delete the test_output folder before running the lane again. Having the results there when the lane is run isn’t a realistic situation in CI, which should be running from a clean working copy.

@skydivedan

thank you so much!

Experiencing same on 2.204.3