-
-
Notifications
You must be signed in to change notification settings - Fork 31
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
Error in test command: Both stdout and stderr are not empty for \"xcodebuild\" comman #52
Comments
@funzin Could you manually execute this command show me the output? xcodebuild \
-showBuildSettings \
-scheme Feature \
-workspace /path/to/project/App.xcworkspace \
-configuration Debug \
-json I think you are correct that the problem is due to multiple destinations, but there may also be some additional information in the stdout |
Thank you for you reply.
|
I understand. It seems that when specifying a module(e.g. For now, you might need to explore alternative methods to handle test execution for SPM modules https://github.com/sweetpad-dev/sweetpad/blob/main/src/common/cli/scripts.ts#L136-L185 |
Oh, thanks. Information about SPM is super helpful here. Could you make some simple test project with the same structure as your project? Or could you explain how to reproduce this structure? |
Could you check the project? When I checked the error again, a different one was output.
|
On the same topic of SPM packages I have an example that fails with xcodebuild: error: Failed to build workspace TestProject with scheme TestProject.: Tests in the target “TestProject” can’t be run because “TestProject” isn’t a member of the specified test plan or scheme. when running specific tests e.g. xcodebuild test-without-building \
-workspace /Users/rafael.pedretti/sources/TestProject/TestProject.xcodeproj/project.xcworkspace \
-destination 'platform=iOS Simulator,id=959B32D4-953C-49EB-B093-8A88C0654D92' \
-scheme TestProject \
-only-testing\:TestProject/LibOneTests/testExample But if change the |
Faced the similar problem here. In my case, I use a package.swift to generate my Xcode project,it throws the same error when i build the related scheme |
Thanks frontage information. I’ll try to check this issue this weekend |
@funzin, could you help me understand how to run tests directly in Xcode? I don’t have much experience working with projects like this
When I select Feature in the scheme and then run tests in the Xcode project, I get the following error: |
This is a key point! As I understand it, to run tests in an SPM package, we need to specify the target name from the |
I'll have some code by eod today for people to test also. I'm scanning the
project to add all the tests to test explorer a do some other fixes
…On Sun 3 Nov 2024, 12:48 Yevhenii Hyzyla, ***@***.***> wrote:
But if change the only-testing to -only-testing:/// as
-only-testing:/LibOneTests/LibOneTests/testExample it works as expected
This is a key point! As I understand it, to run tests in an SPM package,
we need to specify the target name from the .testTarget in the
Package.swift file, rather than using a target from the xcodebuild -list
command. In the latest version, I've added support for detecting SPM
packages and their test targets. Could someone check this on their
projects? I'm not entirely sure if this is the right fix for this issue
***@***.*** (view on web)
<https://github.com/user-attachments/assets/586c240b-bb5e-449e-b904-a6f331abefd4>
—
Reply to this email directly, view it on GitHub
<#52 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFE6EILXKKTMSPQSV7PID3Z6YLTPAVCNFSM6AAAAABQG7LKAOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINJTGQYTMNBWGM>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
In my case, the problem still exists. You can easily reproduce using this repo. The generated folder just using |
I have a PR to try to get most of the test data from the project itself: #67
|
Description:
While using the sweetpad extension in VSCode, an error occurs during the execution of the test command. The issue is caused by multiple matching destinations being detected, leading to ambiguous selection and failure in fetching the build settings.
The error occurs automatically when the sweetpad extension tries to run a test build. Here's the error message
Feature
is a target defined in the Swift Package Manager.The text was updated successfully, but these errors were encountered: