Quick: fdescribe, fit, fcontext stopped working.

Created on 8 May 2019  路  11Comments  路  Source: Quick/Quick

  • [x] I have read CONTRIBUTING and have done my best to follow them.

What did you do?

I want to use fdescribe to make sure just on test runs.

When I use github "Quick/Quick" is works for an iOS test target. On tvOS I have to downgrade to github "Quick/Quick" == 2.0.

But when I switch to github "Quick/Quick" "master" it seems to be broken on both platforms.

What did you expect to happen?

Only the tests in this file run.

What actually happened instead?

All the tests run until I hit the tests in this file and Xcode stops the test suite.

Environment

List the software versions you're using:

  • Quick: 2.1.0
  • Nimble: commit 0edb48d936f31f4ce657047884b77b6e3b0bef4b
  • Xcode Version: 10.2.1 (10E1001)
  • Swift Version: Xcode Default

Please also mention which package manager you used and its version. Delete the
other package managers in this list:

  • Carthage: 0.32.0 (Use carthage version in Terminal)
bug

Most helpful comment

Okay so I spent some time trying to figure this out.

Example setup with three specs, single test focused using fit:

  • QuickSpec1

    • it("TestCase1")

    • it("TestCase2")

    • it("TestCase3")

  • QuickSpec2

    • fit("TestCase4")

    • it("TestCase5")

    • it("TestCase6")

  • QuickSpec3

    • it("TestCase7")

    • it("TestCase8")

    • it("TestCase9")

How it worked before: (I'm not really sure which version changed it, but I guess it's 2.1.0):
Run tests --> only TestCase4 is executed.

How it works now:
Run tests --> TestCase1, TestCase2, TestCase3, TestCase4 are executed

But what is strange is, if instead I focus on TestCase1, it only runs that one and doesn't even proceed to other tests. I guess that is accidentally the case also in your unit tests. The focused test-cases are run first, so it stops right after those.

How it worked before is the intended behavior, right? At least that is how some other test frameworks work with test focusing.
I guess something has changed in how focused tests are discovered?

However I found out that setting QuickConfiguration's runAllWhenEverythingFiltered to false makes the test focusing behave as before. Of course this is not a real solution, but anyone having this problem might be able to set it to false during development to focus tests.

All 11 comments

Looks like the test in our test suite is passing in all supported platforms (macOS, iOS, tvOS, SwiftPM on macOS, SwiftPM on Linux). It would be great if you could provide a reproducible case/project.

873 may be related.

I am seeing the same issue, will see if I can come up with a sample project tomorrow.

I tried using Quick from the master branch (after the #873 fix was merged) and the probleem seems to persist. I'll see if I can upload a sample project this weekend.

I tried using Quick from the master branch (after the #873 fix was merged) and the probleem seems to persist.

@fousa I didn't mean #873 may be a fix for this, but meant #873 may be the cause of this.

Ah alright, my bad.

Any updates on this? I'm running into this issue right now and since the last comment is from May I was hoping you found a fix.

Okay so I spent some time trying to figure this out.

Example setup with three specs, single test focused using fit:

  • QuickSpec1

    • it("TestCase1")

    • it("TestCase2")

    • it("TestCase3")

  • QuickSpec2

    • fit("TestCase4")

    • it("TestCase5")

    • it("TestCase6")

  • QuickSpec3

    • it("TestCase7")

    • it("TestCase8")

    • it("TestCase9")

How it worked before: (I'm not really sure which version changed it, but I guess it's 2.1.0):
Run tests --> only TestCase4 is executed.

How it works now:
Run tests --> TestCase1, TestCase2, TestCase3, TestCase4 are executed

But what is strange is, if instead I focus on TestCase1, it only runs that one and doesn't even proceed to other tests. I guess that is accidentally the case also in your unit tests. The focused test-cases are run first, so it stops right after those.

How it worked before is the intended behavior, right? At least that is how some other test frameworks work with test focusing.
I guess something has changed in how focused tests are discovered?

However I found out that setting QuickConfiguration's runAllWhenEverythingFiltered to false makes the test focusing behave as before. Of course this is not a real solution, but anyone having this problem might be able to set it to false during development to focus tests.

This is the commit (#873) that caused the issue.
Renaming defaultTestSuite back to initialize solves it.

Didn't go deep into that, but seems that buildExamplesIfNeeded should be called before defaultTestSuite.

Adding initialize back to QuickSpec class also solves to issue:

+ (void)initialize {
  [self buildExamplesIfNeeded];
}

I submitted a possible fix for this issue in #980. Could you all try that branch?

v2.2.1 has been released. Please try it!

Was this page helpful?
0 / 5 - 0 ratings