Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix using xcresulttool on Xcode 16.0 beta 3+ #424

Merged
merged 6 commits into from
Aug 8, 2024

Conversation

priitlatt
Copy link
Contributor

@priitlatt priitlatt commented Aug 7, 2024

With Xcode 16.0 beta 3+ part of xcresulttool API that we use to parse Xcode test results has been deprecated:

% xcrun xcresulttool get object --help
OVERVIEW: Get Result Bundle Object. This subcommand is deprecated and will be removed in a future release, consider using `xcresulttool get test-report` instead.

USAGE: xcresulttool get object [--legacy] --path <path> [--id <id>] [--version <version>] [--format <format>]
...

This causes xcresulttool get object calls with recent Xcode versions to exit with error and consequently some actions in xcode-project fail.

Apple has provided a quick workaround by providing --legacy flag that can be used to still use the old API even on more recent xcresulttool version. Changes on this PR make use of that flag when calling xcresulttool get object in case xcresulttool version is at least 23021.

Updated actions:

  • xcode-project run-tests
  • xcode-project test-summary
  • xcode-project junit-test-results

QA notes

Test are running and results can be successfully parsed using the following Xcode versions:

  • ✅ Xcode 15.3 (15E204a)
  • ✅ Xcode 15.4 (15F31d)
  • ✅ Xcode 16.0 (16A5211f)

@priitlatt priitlatt linked an issue Aug 7, 2024 that may be closed by this pull request
@priitlatt priitlatt marked this pull request as ready for review August 7, 2024 13:17
@priitlatt priitlatt added the bug Something isn't working label Aug 7, 2024
Copy link
Contributor

@mohammedbabelly20 mohammedbabelly20 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

src/codemagic/models/xctests/xcresulttool.py Outdated Show resolved Hide resolved
Comment on lines +64 to +65
Starting from Xcode 16 beta 3 'xcresulttool get --format json' has been deprecated and
cannot be used without '--legacy' flag.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Starting from Xcode 16 beta 3 'xcresulttool get --format json' has been deprecated and
cannot be used without '--legacy' flag.
Starting from Xcode 16 beta 3 'xcresulttool get' has been deprecated and
cannot be used without '--legacy' flag.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually xcresulttool get itself is not deprecated. Up until version 23021 it used to just output the result bundle object, but now there are couple of subcommands that can be used, with objects being the default.

Co-authored-by: Mohammed Babelly <mohammed@nevercode.io>
@priitlatt priitlatt merged commit 24f3bd6 into master Aug 8, 2024
11 checks passed
@priitlatt priitlatt deleted the bugfix/xcode-16-xcresul-parsing branch August 8, 2024 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

xcresulttool error in Xcode 16 beta 3
2 participants