kiwi-bdd / Kiwi

Simple BDD for iOS
BSD 3-Clause "New" or "Revised" License
4.14k stars 512 forks source link

Exception when I run a test twice #678

Closed dtaitz closed 8 years ago

dtaitz commented 8 years ago

Hello,

I recently switched over to Kiwi. I wrote a few specs can successfully run my tests right after I open up my workspace in Xcode. Yet, if I try to run the test again without exiting and reopening my workspace, I get the following error. Please advise

* Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[NSInvocation _invocationWithMethodSignature:frame:]: method signature argument cannot be nil' * First throw call stack: ( 0 CoreFoundation 0x0000000106020d85 __exceptionPreprocess + 165 1 libobjc.A.dylib 0x00000001056b9deb objc_exception_throw + 48 2 CoreFoundation 0x0000000105ee071d +[NSInvocation _invocationWithMethodSignature:frame:] + 333 3 XCTest 0x00000001055c3ea9 -[XCTestCase initWithSelector:] + 167 4 XCTest 0x00000001055c3f08 +[XCTestCase testCaseWithSelector:] + 43 5 XCTest 0x00000001055c24cb +[XCTestSuite testSuiteForTestCaseWithName:] + 344 6 XCTest 0x00000001055c3181 -[XCTestSuite _initWithTestConfiguration:] + 508 7 XCTest 0x00000001055c3674 +[XCTestSuite testSuiteForTestConfiguration:] + 50 8 XCTest 0x00000001055af979 -[XCTestDriver _runSuite] + 233 9 XCTest 0x00000001055b07d1 -[XCTestDriver _checkForTestManager] + 259 10 XCTest 0x00000001055faa9a _XCTestMain + 628 11 CoreFoundation 0x0000000105f462ec CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK + 12 12 CoreFoundation 0x0000000105f3bf75 CFRunLoopDoBlocks + 341 13 CoreFoundation 0x0000000105f3b6d2 CFRunLoopRun + 850 14 CoreFoundation 0x0000000105f3b0f8 CFRunLoopRunSpecific + 488 15 GraphicsServices 0x0000000108e0aad2 GSEventRunModal + 161 16 UIKit 0x0000000103d52f09 UIApplicationMain + 171 17 Planvan 0x000000010087ccd4 main + 180 18 libdyld.dylib 0x00000001068e992d start + 1 ) libc++abi.dylib: terminating with uncaught exception of type NSException (lldb)

htxs commented 8 years ago

Same to me, but my colleague who use the same code on his computer have no problem.

modocache commented 8 years ago

Hey! Sorry for this. Based on your stack trace, which includes +[XCTestCase testCaseWithSelector:], I assume you're running an individual test? Kiwi has never been very good at supporting individual tests... we only really support running all tests (⌘+U).

The best way to help test frameworks like Kiwi to support this would be to file an Apple Radar. Please copy and paste the text from https://openradar.appspot.com/26028557 and submit that to Apple.

In the meantime, I'll close this issue (@sharplet and I are trying to do some spring cleaning). Please re-open this issue or create another one if you're encountering this problem when running all tests.

adamwdennis commented 7 years ago

This is the single biggest reason we're considering abandoning Kiwi. Being able to quickly iterate and debug a single test is difficult at best using this framework, let alone having to restart XCode every so often.

orta commented 7 years ago

I use Xcode schemes, and focus tests to get that kind of behaviour (with Specta/Quick but they all have the same problems )