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

Bluepill's list of tests is not the same as the list of tests that get executed #352

Open
ravimandala opened this issue Aug 22, 2019 · 8 comments
Assignees
Labels

Comments

@ravimandala
Copy link
Contributor

We recently found that the list of tests that Bluepill comes up with based on xctest files is not accurate. Bluepill uses nm utility to read symbols from binary from xyz.xctest and picks everything which has a test prefix like this...
https://github.com/linkedin/bluepill/blob/42a4b8c9b8d07f58d55872aa45360730a858a768/bp/src/BPXCTestFile.m#L17-L18)

Turns out there is a possibility of a lot of false-positives and true-negatives with this approach. Names of properties in test classes with a test prefix will be wrongly picked up as test cases, and more importantly, if a test class inherits a bunch of test cases from another test class they cannot be identified with this approach.

We are in the process of replacing this with a better and reliable approach that can accurately return a list of test methods that will eventually get executed.
(It's worth noting that all the tests that need to be executed will get picked up by the simulators regardless of this issue.)

\cc @ob

@ob ob added the bug label Aug 23, 2019
@ob
Copy link
Member

ob commented Aug 23, 2019

Thanks for picking this up! Looking forward to the PR :-)

@ravimandala
Copy link
Contributor Author

I'm working on this. I'll have a PR out in a week.

ravimandala added a commit to ravimandala/bluepill that referenced this issue Oct 2, 2019
A temporary workaround to fix duplicate test executions when bundles are split (MobileNativeFoundation#352)
ravimandala added a commit to ravimandala/bluepill that referenced this issue Oct 2, 2019
A temporary workaround to fix duplicate test executions when bundles are split (MobileNativeFoundation#352)
@ravimandala
Copy link
Contributor Author

The long-term fix for this is to bring up the simulator and do some code injection magic to get an accurate list of tests. But before that, I implemented a temporary workaround that would factor in test class inheritance and corresponding inherited test cases into account. The PR #368 introduces test time estimate based splitting and incorporates this workaround for both test count based splitting and test time estimate based splitting. Please take a look. \cc @ob

ravimandala added a commit to ravimandala/bluepill that referenced this issue Oct 4, 2019
A temporary workaround to fix duplicate test executions when bundles are split (MobileNativeFoundation#352)
ravimandala added a commit to ravimandala/bluepill that referenced this issue Oct 4, 2019
A temporary workaround to fix duplicate test executions when bundles are split (MobileNativeFoundation#352)
@ravimandala
Copy link
Contributor Author

Open #376 off v4.1.1+packing branch for this. I will create another PR off the master and then change #376 to back-port the changes to v4.1.1+packing if that is still needed.

@ravimandala ravimandala self-assigned this Nov 6, 2019
@ravimandala ravimandala pinned this issue Nov 6, 2019
ravimandala added a commit to ravimandala/bluepill that referenced this issue Dec 3, 2019
…ry workaround

A temporary workaround to fix duplicate test executions when bundles are split (MobileNativeFoundation#352)
@Ashraf-Ali-aa
Copy link

Hi is there any update regarding this issue, I am also having this issue, a better way to get test cases is using something like this https://github.com/dropbox/hypershard-ios

@ravimandala
Copy link
Contributor Author

Thanks for the pointer @Ashraf-Ali-aa. I looked into it and it looks like it works only on Swift test suites and if all test class files are named in a certain pattern. Not sure if we can use it given the limited use cases it serves.
I have a solution which is working except for a minor issue in UI tests. I am trying to find some time to complete it.

@Ashraf-Ali-aa
Copy link

cool, you can use Idb which I believe it does support objective C and swift https://github.com/facebook/idb

@chenxiao0228
Copy link
Collaborator

@ravimandala is this still an issue?

@ob ob unpinned this issue May 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants