Search code examples
swiftxcodexctest

Xcode testing errors are not showing up inline in the editor only under report navigator


Sorry for posting this, I know it has been asked before, but the questions and answers are many years out of date.

Here is my simple testing code:

    func testPlaceExitSign2CellsTall() throws {
        ...

        let tileSize = CGSize(width: 37.5, height: 37.5)
        let exitSignPlacement = LoadGrid().genExitNode(grid: grid, tileSize: tileSize, bufferBottom: 0)
        
        XCTAssertEqual(exitSignPlacement.position.x, 400.0)
        XCTAssertEqual(exitSignPlacement.position.y, 93.75)
        XCTAssertEqual(exitSignPlacement.name, "Exit")
    }

For some reason tests suddenly no longer show the results inline, only way over in this other area the Report Navigator. I have never seen this before, 9 years of using xcode, the results of tests have always shown up where the tests are, aka inline. enter image description here

Here is how it shows up in code

enter image description here

I've tried all the top suggestions:

Settings > General > "Show inline" - No Change

Settings > General > "Show Live Issues" (checked or unchecked, I tried both)

Also I removed an unused account under Accounts

Also restarted computer.

I'm out of ideas, please help, it's really hard to be in testing mode when you cannot even see the failures.


Solution

  • So I finally just created a new schema and it started working again. It was one of a long list of suggestions from Chat*PT

    UPDATE: After adding and removing this a few times, I have finally discovered what was causing the error to not show in the editor or the issues navigator.

    In order to bump my build version I had this line cd "${PROJECT_DIR}" ; agvtool next-version in my post-action build. Apparently this is conflicting with showing the errors somehow.

    So bottomline, if you aren't seeing your errors in the editor or the issues navigator, and you have this bumping command, you should decide which one you want more I guess.

    UPDATE AGAIN: I set the same code to be run on "RUN" instead of "Build", this avoids the conflict with tests having them not show up inline.

    enter image description here