uber / ios-snapshot-test-case

Snapshot view unit tests for iOS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

failed - Snapshot comparison failed: Optional(Error Domain=Foundation._GenericObjCError Code=0 "(null)")

brunosrocha opened this issue · comments

Does someone have the same issue?

No matter what I do I keep getting this failed - Snapshot comparison failed: Optional(Error Domain=Foundation._GenericObjCError Code=0 "(null)") when trying to run my snapshot tests.

I am using XCode 11.3.1

We're also having this issue -- interestingly it's only affecting some of us, despite having near-identical setups.

@brunodossantosrocha1510 have you managed to find any workarounds since you posted this?

@MichaelKearnsSoftwire I have tried literally everything and also didn't have success.. Have you had any success?

I'm having exactly the same problem with version 11.3.1 of XCode

Have you had any success?

@brunodossantosrocha1510 yes, we have in fact! It seemed to be a permissions issue.

Things you could try which might solve the problem:

  1. Try running as a different user (either as admin or non-admin)
  2. Delete the snapshot files, re-generate them then re-execute the tests.

In our investigation, we saw that executing against the freshly checked-out repository caused the above error, but deleting and re-generating the snapshot images enabled them to pass -- the re-generated images had the same binary content (so git did not show any differences) but inspecting the files with ls -al@ showed that the extended attributes of the file had changed, adding a new com.apple.macl attribute (more info on this here)

Afraid I don't have any more info right now -- hopefully the above helps you out, if not I'll see if I can find out more next week.

I think I was seeing these errors and was able to solve them by giving SimulatorTrampoline.xpc full disk access. I'm not sure that's ideal, though.

commented

Same here, XCode 11.6. Tried to give full access to SimulatorTrampoline without success

@brunodossantosrocha1510

I had the same problem. And that was resolved.

I was NOT calling the super.setUp().
hope this helps.

I have this problem and it was happening because the Desktop folder locked the files and the snapshot can not read them, so now I just use the root folder (~/) and everything worked.