Xcode 6.3 reports Test Succeeded for failing test - ios

Has anyone else noticed that Xcode 6.3 (6D570) is showing the "Test Succeeded" popup (and displaying the test success sound, if configured) for a failing test when you run the test by itself?
When you run all tests in the file, everything works as expected.
For example, the following assertion fails, but Xcode shows "Test Succeeded".
XCTAssertTrue([queryStringLat isEqualToNumber:expectedLat], #"Expected: %# but got: %#\n", expectedLat, queryStringLat);
The debugger output shows that it failed, Xcode just seems to be getting confused.
Here is the debugger output:
Foo_Tests.m: test failure: -[Foo_Tests test_sendRequestForApp_with_coordinates_validate_that_coordinates_exist] failed: (([queryStringLat isEqualToNumber:expectedLat]) is true) failed - Expected: 37.33233 but got: 0
Has anyone else experienced the same type of thing?
This isn't a huge "bug", but is really annoying when working on tests.
Thanks!

SOLVED!
I received a response from Apple. They said that they could not reproduce the problem, and asked me to remove all plugins and provide them with a complete sample of code that reproduced the issue.
Hmm, PLUGINS, brilliant!
I started to remove plugins, a few at a time, and after a few attempts, the "bug" went away!
I then tracked it down to the MCLog plugin, which I had installed using the Alcatraz package manager in Xcode.
I've also filed an issue with the MCLog author.
If I find out, or figure out, exactly what was causing this issue, I'll post that information here. I find it interesting that MCLog was able to confuse Xcode so it reported "Test Succeeded" upon failures.

Related

Errors in UI tests have no location in Xcode (<unknown>:0)

I recently added a UI Testing target to our existing project (which already has an iOS app target and a couple of other testing targets). Everything is working as expected and UI tests run without problems, but if a test fails the errors are never displayed in the file they occur and the Test Report shows them at <unknown>:0 while the Issue Navigator shows them at <unknown>:
It does mark the correct test as failed, but doesn't shown an error inside the editor. I looked through the build settings but couldn't find anything out of the ordinary.
Naturally, this makes debugging the tests much more annoying and harder. The usual clean/derived data/xcode restart magic hasn't done anything.
Update: After investigating further, it turns out that this is NOT a problem for assertion failures, which show up correctly.

Kitura iOS server

I'm trying to figure out how a server can work on an iOS device. And I found this fantastic tool.
I'm trying to follow this example. Following these instructions, everything seems to work, but when I open EndToEnd.Xcworkspace, Change scheme to "ClientSide" and build, I get the following error: <unknown>:0: error: missing required module 'CHTTPParser', also report here .
I also saw that a similar error was reported here as well, and seems to have been fixed here, at least in xcode 8.3.1 and 8.3.2 (I use 8.3.3).
In a comment it is written: "remove ServerSide and rerun make", I have tried but the error persists.
Any suggestions ? Which may be the cause of
Missing required module 'CHTTPParser'
#emacos Let me debug it during the weekend.
July, 23, 2017 Fixed in this PR - https://github.com/IBM-Swift/Kitura-Builder-iOS/pull/1

Xcode Bot hangs on "Processing Results"

I've got a real head scratcher here. I just upgraded to Xcode 7.3.1 and all my Bots have hit the floor during the integration process. For some reason or another the Bots get stuck on step 7 of 9 "Processing results". I let it sit for about 24 hours to see if it would work itself out but had no luck.
Anyone ran into this problem and have any idea what a fix might be? Short of reinstalling Xcode and Server on the build server, I'm not sure what else to try as I've tried a lot of random fixes that I've seen out on the interwebs.
Thanks in advance for any help?
UPDATE - The last thing to run in the raw build log is:
Test Suite 'All tests' failed at 2016-05-19 13:32:16.765.
Executed 131 tests, with 1 failure (0 unexpected) in 4.500 (4.592) seconds
Update: Fixed
Here's what I did:
Stopped the server.
deleted all bots from Xcode.
Went into /Library/Developer/XcodeServer and removed (you will need Admin access):
Logs
Integrations
Removed my derivedData directory
Restarted everything and rebuilt the bots using different names for them.
I had the same problem once. I think it happened after updating Xcode. Only solution was to reinstall OS X. After that I have not had any problems. I tried everything I could find from the web but there weren't any solutions out. I tried to delete everything that belongs to Xcode but I think I didn't find all of them. So my suggestion is to reinstall OS X. Copy all your important stuff to external hard drive or to cloud.
I know this is not the suggestion or answer you are looking for but it helps you out.

IDEBundleInjection.c: Error 3587 on Xcode 6.4

I am trying to start testing my app, and so I enabled a new test target and a Swift file for the testing. Yet when I try to execute the testing I receive error:
IDEBundleInjection.c: Error 3587 loading bundle '/Users/fbartolom/Library/Developer/Xcode/DerivedData/inArrivoHD-ebjdiuuwdpdvchgmpsyqkpvvvyhw/Build/Products/Debug-iphonesimulator/inArrivoHD Tests.xctest
By reading some threads I also recovered the XCTest.framework from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Frameworks/ given it was not available in the selection, after locating it with find on the shell as Spotlight reported no results. Yet in so doing I got some missing symbols in the linking phase, so by reading How do I migrate from SenTestingKit/OCUnit to XCTest? I removed it.
I tried clearing the DerivedData folder several times to no avail. I also put code signing to "Don't Code signing" with changing anything.
What should I do?
I think I fixed the issue by followng the advice at:
http://dunghnt.blogspot.it/2014/12/problems-of-migrating-from-sen-test-to.html
The issue was due to incorrectly importing the MacOS test kit. Once I correctly chose the iOS one everything went in order. Perhaps a better error message would be appreciated.

XCTest in xcode 5--tests fail without any issue generated

I am doing an Max OS X terminal project. After I am done with the implementation I wanted to try try unit test. So I created a test target and set the target to be the one that I want to test. I wrote some simple test cases but it tells the link error ""_OBJC_CLASS_$_SomeClassUnderTest", referenced from:
objc-class-ref in SomeTest.o"
I looked at link
so first of all, why the error happened? I mean apple's official document does not mention anything about bundle loader or whatsoever, why I have to do that? there is something wrong with my original config or something? the linking should go the executable file? or it should go to static library file? but where to find that for testing and how to reference that?
and now the issue about linking issue is gone. but I got test fail even if I do "XCTAssertTrue(1==1,"")"! and I do not see any issue generated saying tests not pass or pass, just after build succeed there is a message saying test failed? why is this so?
This is a bug in Xcode and is corrected in version 5.1 . When using the simulator, tests can sometimes show the message Test target [test name] encountered an error (Test process exited with code -1)
See Xcode release notes for official details:
enter link description here

Resources