-
Notifications
You must be signed in to change notification settings - Fork 737
xctool can't run tests using Kiwi or Specta #202
Comments
Also affected by this. Would love to run xctool with kiwi :) |
👍 |
1 similar comment
👍 |
I'd love to use this too. |
👍 Please! |
👍 Really interested in this |
👍 |
1 similar comment
👍 |
👍 v0.1.11 runs our Kiwi unit tests, v0.1.13 does not. |
👍 |
Looks like it's already fixed, right? |
Yes - new release coming later today, I hope. |
@fpotter so this will be fixed in 0.1.14 ? |
It will be. Hopefully I can release really soon. Sorry for the wait. |
@fpotter thanks for the heads up. sounds good! |
@fpotter Just wanted to mention that this is currently still unresolved for me—I'm unable to run Kiwi tests on HEAD. My setup: Xcode 4.6.3 (4H1503), xctool 0.1.13/HEAD, Kiwi 2.1.0, CocoaPods 0.27.1. On HEAD, I get the error
On 0.1.13, if the test target has non-Kiwi tests they will be executed, but no Kiwi tests are executed. If the target has ONLY Kiwi tests, then after the app is installed in the simulator xctool just hangs and doesn't do anything. Since changes to CocoaPods introduced in 0.25.0 to support Xcode 5, I can't build without setting Hope this helps, let me know if there's any more info I can give you. |
@sharplet Ahh, the null issue! I haven't been able to repro that - can you help me out? In Xcode.app, would you mind giving me a paste of the full raw text of your test run from the build/test log? Or, can you help me figure out what combination of describe / it blocks generate this (null) case ? |
I can probably do that. How can I get the raw text from Xcode.app?
So I removed all the existing spec files from the test target, and added a single one that looks like this: #import <Kiwi/Kiwi.h>
SPEC_BEGIN(TestSpec)
describe(@"failure", ^{
it(@"fails", ^{
fail(@"failed");
});
});
SPEC_END The xctool output for
Removing the |
@fpotter I have the null issue too! Here's a test run from Xcode, just containing the simplest test file in my project:
My spec is this: #import "Kiwi.h"
#import "DIStatus.h"
SPEC_BEGIN(DIStatusSpec)
describe(@"DIStatus", ^{
context(@"parsing JSON", ^{
it(@"creates a status from valid JSON", ^{
NSDictionary *json = @{ @"status" : @2, @"description" : @"Amber alert." };
DIStatus *status = [DIStatus statusWithJSON:json];
[[theValue(status.status) should] equal:theValue(DIStatusLevelAmber)];
[[status.statusDescription should] equal:@"Amber alert."];
});
it(@"uses default values if JSON is invalid", ^{
NSDictionary *json = @{};
DIStatus *status = [DIStatus statusWithJSON:json];
[[theValue(status.status) should] equal:theValue(0)];
[[status.statusDescription should] equal:@""];
});
});
});
SPEC_END Finally, xctool is crashing with:
|
@fpotter Successfully reproduced here: https://github.com/sharplet/xctool-kiwi-bug. Aaand it looks like you just fixed it (!), in this commit. |
Sweet! I was hoping so... but then I was having trouble repro'ing before that commit, too. Thanks so much for putting together that example! |
@fpotter do you know when the next release will ship? Looking forward to using this fix. :) |
@pdsarin you might now it, but just in case, you could use the head version of xctool by installing it using |
@yas375 thanks for the tip! Going to wait on the official release as I want our build env to be easily replicable. |
+1 Any sign of a release for this guys? |
Yeah, would be great to have this one fixed on travis-ci |
Just posted 0.1.14 - https://github.com/facebook/xctool/releases/tag/v0.1.14 Closing this task for now, but re-open if you keep having Kiwi troubles. |
Nice work @fpotter, it's working great for us now. |
As of ~ v0.1.9, xctool won't run test bundles that use Kiwi or Specta. Around that time, xctool began doing introspection on each test bundle - we'd load the bundle and dump a list of all test cases inside of it. This was done inside of otest-query.
Right now, when otest-query is run against and Kiwi or Specta bundle, it's returning an empty list of test cases.
The problem is that Specta and Kiwi's test methods/cases get generated at runtime, and otest-query isn't triggering that process. We need to make it tickle the right things so that all the test methods are generated and THEN dump the list of test methods.
For Kiwi at least, this happens inside of
+[KWSpec testInvocations]
-- https://github.com/allending/Kiwi/blob/master/Classes/Core/KWSpec.m#L75Hopefully we can find a generic way to trigger this testInvocations stuff so that we don't have to add Kiwi-specific or Specta-specific code to otest-query.
The text was updated successfully, but these errors were encountered: