Missing test diamonds in Xcode?!

We've been building a project using TCA and then IsoWords structure of modularisation.

Last week the project suddenly stopped rendering any of the test diamonds (on the left of each test function) in the test files inside any of the packages that we have.

This has happened to everyone on the team. We've all been using Xcode 14.2 and I can't find any way to fix it.

I presume that there is something that we have done to cause this in the app. But I'm not sure what it might be?

Sorry this is light on information but I wondered if there is anyone that might be able to point me in the right direction to further debug this?

I've tried the usual stuff of deleting derived data, clean build folder, restart Xcode/laptop. I haven't tried re-cloning the project but a colleague has.

I'm not sure what to check now?

Thanks

3 Likes

Hi! Can you please illustrate better the error that you’re getting when trying to run the tests?

Did you check if your test targets are included in active scheme? You can try add new scheme with only test target and check if it helps.

Hey, it's not an error. It just doesn't show any of the test feedback in the file. Like the diamonds in the left hand gutter with the test status.

Or any test failure messages.

Etc...

However, I've deleted our .swiftpm folder and recreated all the schemes from scratch and they're all back now.

It's really odd. Just so inconsistent.

1 Like

Gotcha!

Sadly this is an Xcode bug that started in 14.0. It's gotten a little better in 14.1 and 14.2, but it's still there. It also affects non-TCA applications. For example, here's the test suite for the Standups app in our swiftui-navigation library:

We usually have to clean+rebuild or restart Xcode to get the diamonds back.

We filed a Feedback in July 2022. Here's the # in case you want to duplicate it: FB10910099

6 Likes

Great thanks for the info.

I've noticed that other people online seem to be reporting it too.

Xcode does seem to be particularly inconsistent around managing schemes in project. :grimacing:

Incidentally, I completed nuked our schemes and recreated them and it seems to have solved it for now. So will remember that and keep it in mind for if/when it happens again.

Thanks

1 Like

Yes, this is an Xcode bug and it’s incredibly annoying. Even more so is test errors not showing inline. It’s a massive productivity drain. Amazed it hasn’t been fixed by then, Xcode releases seem to be few and far between these days.

4 Likes

This happens to me if I add the test targets of my packages in Test Plain for the app target. :frowning_face:

1 Like

Just wondering if there is any other workarounds to this that anyone have found apart from what Brandon mentioned.

1 Like

Looks like this bug is back in Xcode 15, at least for tests in a local SPM package test target. Still not fixed in 15.1.

2 Likes

can confirm ...

I faced missing test diamonds for a file that had previously worked. I tried the deleting and recreating schemes, and rebooting etc etc - no luck.

In my case the fix was the file had been taken out of our test target. It looks like the cause was due to fixing a merge conflict inside the pbx.proj file. Ticking the checkbox to add it back fixed the problem.

I have a mac only app and no chance to see the diamonds or any test in the test tab...

Is there a ticket or anything we can bump?

We filed a Feedback in July 2022. Here's the # in case you want to duplicate it: FB10910099

I am not sure how to find this issue in particular, but would love to help increase Apple's urgency to fix it.

This issue dates all the way back to 2016, it looks like Xcode fails to discover tests, mis… | Apple Developer Forums

1 Like

With swift-testing coming with Xcode 16 next week (shipping in September), it's unlikely this issue will ever be fixed. Instead, we get to deal with a whole new set of bugs in swift-testing's Xcode integration!

7 Likes

Does this work better with swift-testing? Seems like diamonds are still missing in Xcode 16.

I honestly can't believe this issue has not been addressed yet :upside_down_face:

Screenshot 2024-10-23 at 9.10.43 AM

2 Likes

Nope. Apparently the bug transcends testing frameworks!

3 Likes

Just submitted feedback (FB15570644) in Xcode (Help -> Provide feedback) in case others want to join the cause to try to get enough attention for Apple to address this.

1 Like