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

Add Support for Parsing .xctestrun file and use it to start xctest #525

Merged
merged 26 commits into from
Jan 6, 2025

Conversation

bahrimootaz
Copy link
Contributor

@bahrimootaz bahrimootaz commented Dec 6, 2024

Description:
This pull request introduces enhancements to the go-ios tool by adding the ability to parse .xctestrun files, enabling seamless execution of XCTest. The key updates include:

Key updates include:

1. Parsing .xctestrun File:

  • A new parseFile method has been implemented to extract test configuration details from the .xctestrun file.
  • The parsed data includes all details needed to execute an xctest like TestHostBundleIdentifier, TestBundlePath, OnlyTestIdentifiers, SkipTestIdentifiers, IsUITestBundle, CommandLineArguments, EnvironmentVariables, and TestingEnvironmentVariables of the xctestrun file.
  • Added a validation step to ensure the FormatVersion of the .xctestrun file is supported. Currently, only FormatVersion 1 is accepted, with clear error messages for unsupported versions.

2. Enhanced CLI Command:

  • Introduced a new ios runxctest command in the CLI with updated explanations for better usability.
  • Allows users to specify xctestrun file path and output preferences.

3. Improved Test Coverage:

  • Added test cases to validate parsing of .xctestrun file.
  • Ensured robust assertions for critical fields like TestHostBundleIdentifier and TestBundlePath.

These updates simplify and enhance the process of running XCTest by directly utilizing .xctestrun files, reducing manual setup and ensuring better adaptability to diverse testing scenarios.

ios/testmanagerd/xcuitestrunner.go Outdated Show resolved Hide resolved
ios/testmanagerd/xcuitestrunner.go Outdated Show resolved Hide resolved
ios/testmanagerd/xctestrunutils.go Outdated Show resolved Hide resolved
ios/testmanagerd/xctestrunutils.go Show resolved Hide resolved
ios/testmanagerd/xctestrunutils.go Outdated Show resolved Hide resolved
ios/testmanagerd/xctestrunutils.go Show resolved Hide resolved
ios/testmanagerd/xctestrunutils.go Outdated Show resolved Hide resolved
ios/testmanagerd/xctestrunutils.go Outdated Show resolved Hide resolved
main.go Outdated Show resolved Hide resolved
main.go Outdated Show resolved Hide resolved
main.go Outdated Show resolved Hide resolved
@bahrimootaz
Copy link
Contributor Author

@danielpaulus We’d appreciate your review on this PR as it’s our first milestone toward supporting .xctestrun files for starting tests, similar to how Xcode does.

@bahrimootaz bahrimootaz changed the title Add Support for Parsing .xctestrun file and use it to Start XCTests Add Support for Parsing .xctestrun file and use it to start xctest Dec 19, 2024
@dmissmann dmissmann merged commit 0f1771b into danielpaulus:main Jan 6, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants