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 XCTest #464

Merged
merged 7 commits into from
Aug 20, 2024
Merged

Conversation

bahrimootaz
Copy link
Contributor

  • Provide the ability to run an XCTEST by passing the flag --xctest to ios runtest
  • Test the ability to run a XCUITEST on a Real Device
  • Test the ability to run a XCTEST on a Real Device

by the default, if the flag --xctest is not provided we will run XCUITEST. so to be able to run an XCTEST we need the flag to be present.

@si-net
Copy link

si-net commented Aug 15, 2024

I think the big question for me is if we can detect that a file is a XCTest or a XCUiTest and automatically set this flag, or if we should leave this decision to clients.

We tried to detect this by looking at the file extension, but this does not seem to work.

@danielpaulus
Copy link
Owner

@bahrimootaz this looks really nice, merging the other PRs has created a small conflict. Can you please resolve it?

@dmissmann
Copy link
Collaborator

I think the big question for me is if we can detect that a file is a XCTest or a XCUiTest and automatically set this flag, or if we should leave this decision to clients.

We tried to detect this by looking at the file extension, but this does not seem to work.

it can be detected when you have access to the .ipa file. The Info.plist of the .xctest bundle contains a entry "XCTContainsUITests" => 1 for XCUITests. But in the testmanagerd package we work with apps that are already installed and we can't access this file anymore (or at least I don't know of a way to do that)

@bahrimootaz
Copy link
Contributor Author

@bahrimootaz this looks really nice, merging the other PRs has created a small conflict. Can you please resolve it?

I rebased master and resolved the conflict. Can you please take a look again.

@bahrimootaz
Copy link
Contributor Author

I think the big question for me is if we can detect that a file is a XCTest or a XCUiTest and automatically set this flag, or if we should leave this decision to clients.
We tried to detect this by looking at the file extension, but this does not seem to work.

it can be detected when you have access to the .ipa file. The Info.plist of the .xctest bundle contains a entry "XCTContainsUITests" => 1 for XCUITests. But in the testmanagerd package we work with apps that are already installed and we can't access this file anymore (or at least I don't know of a way to do that)

After Checking a lot of Docs I think it's safe to say: Accessing the Info.plist file of an already installed app is restricted due to the security and sandboxing policies of the operating system.

Copy link
Owner

@danielpaulus danielpaulus left a comment

Choose a reason for hiding this comment

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

LGTM

@danielpaulus danielpaulus merged commit 89cbe52 into danielpaulus:main Aug 20, 2024
2 checks passed
@@ -74,7 +74,6 @@ Usage:
ios info [display | lockdown] [options]
ios image list [options]
ios image mount [--path=<imagepath>] [options]
ios image unmount [options]
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems this has been removed by mistake 😢

This pull request was closed.
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.

5 participants