Individual tests don't work in XCode when structured as in the example. #134
-
This isn't technically related to SharingGRDB but rather the project, so I've made it a discussion. In XCode 26 beta 4, if I run the entire test plan for this repo, the tests all run and pass. However, if I run just a single test, it reports that 0 tests were run. I suspect/assume this has something to do with the way the tests are extensions on a base test suite and how XCode finds the tests. This is unfortunate, because I really like the pattern for sharing the base configuration that is established here. Has anyone else run into this that can verify my suspicion, or that perhaps has a solution? I've copied this testing pattern in one of my projects and while I can obviously get by running all of my tests, there are scenarios where I'd like to be able to run fewer than that. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Hi @cameronmcefee, are you sure no tests are being run? What happens if you put an When I run a single test I see the following logs:
It's a little misleading because it seems that 0 tests were run ("Executed 0 tests, with 0 failures"), but that just seems to be the xctest bundle. Immediately after that the Swift Testing suite starts, and that does report what was run: "Test run with 1 test in 1 suite passed". I think you are just seeing logs for the two flavors of tests (XCTest vs Testing) in a single output, and so it can be confusing. |
Beta Was this translation helpful? Give feedback.
-
Hmm, ok, I see what you're talking about, so I'll mark this as resolved since my problem doesn't apply here. Unfortunately in my own project, which does tests in a similar fashion, the individual tests don't seem to run still, proven by print statements in the tests that only appear when running the whole test plan. I'd hoped I'd find a universal problem, but it looks like it's still on me to troubleshoot 😬. |
Beta Was this translation helpful? Give feedback.
-
Updating in case anyone ends up here for the same issue. Someone suggested I try running the test from the command line and it works the way it should there, so this seems to be an XCode issue. I set up a minimal repro here and submitted a feedback: FB19834678 |
Beta Was this translation helpful? Give feedback.
Hi @cameronmcefee, are you sure no tests are being run? What happens if you put an
#expect(false)
in a test and then run that?When I run a single test I see the following logs: