Skip to content
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

Test is always passing if running the individual file only. #645

Closed
sundeepgupta opened this issue Sep 17, 2015 · 15 comments
Closed

Test is always passing if running the individual file only. #645

sundeepgupta opened this issue Sep 17, 2015 · 15 comments

Comments

@sundeepgupta
Copy link

If I run the entire test suite, every spec runs fine. If I run an individual file, all the specs always pass and the console shows "(null)" for each spec.

For example, this spec:

#import "Kiwi.h"

SPEC_BEGIN(INFN_Spec)

describe(@"bla", ^{
    it(@"random", ^{
        [[@1 should] equal:@2];
    });
});

SPEC_END

Shows this in the console:

Test Suite 'Selected tests' started at 2015-09-17 10:20:13.483
Test Suite 'INFN_Spec' started at 2015-09-17 10:20:13.483
Test Case '-[INFN_Spec (null)]' started.
Test Case '-[INFN_Spec (null)]' passed (0.002 seconds).
Test Suite 'INFN_Spec' passed at 2015-09-17 10:20:13.486.
     Executed 1 test, with 0 failures (0 unexpected) in 0.002 (0.003) seconds
Test Suite 'Selected tests' passed at 2015-09-17 10:20:13.486.
     Executed 1 test, with 0 failures (0 unexpected) in 0.002 (0.004) seconds

I'm running Kiwi 2.4.0 on Xcode 7.1 Beta.

@kanstantsin
Copy link

+1
Can't run individual file tests on Xcode 7.

@petarbelokonski
Copy link

The same problem for me. However, even if I run all tests I can observe the same behaviour. Strangely though, tests work as expected the first time they are run, and things gets messed up on a subsequent run. iOS 9, XCode 7

@priteshshah1983
Copy link

+1

1 similar comment
@haifengkao
Copy link

+1

@lyahdav
Copy link

lyahdav commented Sep 30, 2015

I think this is the same issue I just commented on here: #625 (comment).

Update: Interestingly enough this works fine in the latest AppCode (3.3 EAP 142.5239.5).

@Lyricalpanda
Copy link

This is happening for all tests for me for X amount of time after I run the tests. It happens regardless of if it's the individual class or the full test cases. If I switch schemas, it works for the first time, then I get nulls on all of my tests.

I have to switch from play to the 'Test' (wrench) button to make it work. Trying to right click -> run tests or run an individual test will not work until I force quit xCode.

@yas375
Copy link
Contributor

yas375 commented Oct 30, 2015

We are having same issue. Running tests in a single file and it always reports that 1 test has passed, but it doesn't actually executes the tests.

@cryptojuice
Copy link

+1
In my case, running a test individually when first launching Xcode returns the correct results, but subsequent runs always result in "success". Running all test via Command+u works as expected.

@mmesutt
Copy link

mmesutt commented Nov 5, 2015

+1

1 similar comment
@alekoleg
Copy link

alekoleg commented Nov 6, 2015

+1

@HeyHolly
Copy link

HeyHolly commented Mar 8, 2016

+1 The same problem for me。 I must rename the spec name to go on work when this issue happened
image

@sharplet
Copy link
Contributor

Hi! Thanks for the issue. At this point our stance is to always run the entire test suite. There are long-standing issues with test navigator integration that are not specific to Kiwi and are also experienced by other testing frameworks that dynamically build test invocations.

@modocache and I are doing spring cleaning on issues at the moment, so I'm going to close this for now.

@iamprabal
Copy link

Is this resolved in a newer version? I started with Kiwi just a month back, having already had a huge iOS codebase written in ObjC, thus I have a mammoth task of writing a lot of test cases on existing codebase. It would have been really very very helpful if I could just run one spec file at a time and not the whole suite of tests.

@Lyricalpanda
Copy link

I would highly recommend not using Kiwi if you're doing your test cases from scratch. The last commit was 8 months ago and this issue hasn't been resolved, according to this open ticket from 2017: #689

@iamprabal
Copy link

@Lyricalpanda do you recommend one of Quick or Specta instead? From what I could read online, Quick is useful for swift based codebase and Kiwi seemed to be the more popular choice for ObjC, though I am not sure how it'll compare to Specta? Do you have a recommendation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.