Antondomashnev / FBSnapshotsViewer

A mac os application that shows the failing snapshot tests from FBSnapshotTestCase
MIT License
224 stars 15 forks source link

Support custom Derived Data folder #21

Closed lyahdav closed 7 years ago

lyahdav commented 7 years ago

It would be great if this project supported AppCode. AppCode's DerivedData folder is under ~/Library/Caches/AppCode2017.1/DerivedData, though it should be a setting because that AppCode2017.1 changes with AppCode versions.

Antondomashnev commented 7 years ago

Hi @lyahdav, thanks for proposing it. I will add as a part of a next minor release 🚀

Antondomashnev commented 7 years ago

@lyahdav hi ✋ I've created a preference view (at the moment a simple one) but with the option to set a custom Derived Data path. Will be in 0.3.0 release 🎉

lyahdav commented 7 years ago

@Antondomashnev Thanks for implementing this! I just tried 0.3.0 and unfortunately it didn't work. I set the DerivedData path to ~/Library/Caches/AppCode2017.1/DerivedData, restarted the app, and ran a failing snapshot test in AppCode. Then I clicked the FBSnapshostViewer icon in the top menu but nothing happened. I verified that under DerivedData/<App>/Logs/Build there's a new .xcactivitylog file. Is that the file that this tool monitors? If so, I was surprised because that is a binary file (though I also noticed the same kind of binary .xcactivitylog file under Xcode's DerivedData folder).

Antondomashnev commented 7 years ago

Hi @lyahdav, it's actually watching for the file in the derived data folder with the path that passes the following regex: 'Logs/Test/[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}/.+log$"'. I guess the app code doesn't have that structure, but is there a chance that it has the '.log' file? In case of Xcode it is basically the console output. If that can not be applied to app code, may I ask you to zip any test's project derived data folder after running snapshot tests, that would be helpful for me to understand what the tool needs to parse 😄

Antondomashnev commented 7 years ago

@lyahdav FYI I've renamed the issue to support custom Derived Data folder and I've created a new one to support App Code.