lyndsey-ferguson/fastlane-plugin-test_center

only_testing option is not working when using it for Test Bundle

Closed this issue · 4 comments

New Issue Checklist

  • Updated fastlane-plugin-test_center to the latest version
  • I read the README.md
  • I reviewed the example Fastfile
  • I have removed any sensitive data such as passwords, authentication tokens, or anything else I do not want to world to see

Issue Description

only_testing parameter is not working in multi_scan when using it only for test bundler, whereas the same is working when I use it as Test Bundle/Test Suite/Test Case

An example of how the test_center action is being called.

Not working lane
lane :uitest_test_center do |optinons|
multi_scan(
workspace: "MyApp.xcworkspace",
device: "iPhone X",
try_count: 1,
output_directory: "./reports",
only_testing: ["MyAppUITests"],
scheme: "MyApp",
xcargs: optinons[:ENV],
)
end

Working Lane
lane :uitest_test_center do |optinons|
multi_scan(
workspace: "MyApp.xcworkspace",
device: "iPhone X",
try_count: 1,
output_directory: "./reports",
only_testing: ["MyAppUITests/LoginTests/testVerifyLogin"],
scheme: "MyApp",
xcargs: optinons[:ENV],
)
end

When I navigate to the particular test method then the only testing parameter is working whereas if I specify the whole test bundle it gives following error

No tests found in '/Users/**/Library/Developer/Xcode/DerivedData/RSAArcherMobile-eprzzthzuodkmtflvaxmtdtkmifu/Build/Products/Debug-iphonesimulator/MyAppUITests-Runner.app/PlugIns/MyAppUITests.xctest'!

**Please ignore the manes MyApps I have renamed it

But I have tested in scan method if I specify the whole test bundle also it's working fine

Can you include the logs using the --verbose flag?

One note, this error that you included is a big "flag" that something is wrong:

/Users/**/Library/Developer/Xcode/DerivedData/RSAArcherMobile-eprzzthzuodkmtflvaxmtdtkmifu/Build/Products/Debug-iphonesimulator/MyAppUITests-Runner.app/PlugIns/MyAppUITests.xctest

It cannot find the tests in the xctest test bundle so it cannot expand the testable into a list of all the tests. Have you enabled testability for your configuration and target?

See this example

Hi, @lyndsey-ferguson thank you so much for the quick suggestion it worked, Yes I haven't enabled the testability after enabling it worked to me.

But still, have one doubt out of curiosity when I used the same only_testing parameter in the scan it worked but not in multi_scan why? and even in multi_scan if I specify a single test "MyAppUITests/LoginTests/testVerifyLogin" like this it got worked.

But still, have one doubt out of curiosity when I used the same only_testing parameter in the scan it worked but not in multi_scan why? and even in multi_scan if I specify a single test "MyAppUITests/LoginTests/testVerifyLogin" like this it got worked.

scan passes the command directly to xcodebuild. multi_scan on the other hand, needs to grab "all" the tests for the given "testable" in order to break it up into batches and separate them into separate output sub-directories for different test targets.

TL;DR scan is simpler and doesn't need to perform so much pre-processing.

Closed issue as testability wasn't enabled.