ashfurrow / Nimble-Snapshots

Nimble matchers for FBSnapshotTestCase.
https://medium.com/cocoaacademymag/unit-testing-uiview-with-nimble-snapshot-651a7c5a5e93
MIT License
317 stars 101 forks source link

Updates dependencies, test target #237

Closed ashfurrow closed 2 years ago

ashfurrow commented 2 years ago

236 updates the bundle but ~our CI infrastructure isn't working for open source contributors. I've opened this PR with the same commit to test.~ It turns out that our version of danger-action needed updating. See: https://github.com/MeilCli/danger-action/issues/80

~If this works, I'll also update the Bootstrap project, because the updated Gemfile.lock points to an updated CocoaPods version, which produces updated files in pod install 😅~ I've updated this.

Basically I deleted all the files in ReferenceImages and re-ran the tests to regenerate them. A lot of the images have file names dependent on the OS/device being ran on, so that's the cleanest way to go. I think I even deleted some that weren't being reference anymore 🤷

github-actions[bot] commented 2 years ago
1 Warning
:warning: Big PR

SwiftLint found issues

Warnings

File Line Reason
DynamicSizeTests.swift 7 Function body should span 40 lines or less excluding comments and whitespace: currently spans 67 lines (function_body_length)
DynamicSizeTests.swift 10 Implicitly unwrapped optionals should be avoided when possible. (implicitly_unwrapped_optional)
DynamicSizeTests.swift 21 Implicitly unwrapped optionals should be avoided when possible. (implicitly_unwrapped_optional)
DynamicSizeTests.swift 92 Trailing closure syntax should be used whenever possible. (trailing_closure)
DynamicSizeTests.swift 104 Trailing closure syntax should be used whenever possible. (trailing_closure)

Generated by :no_entry_sign: Danger

ashfurrow commented 2 years ago

I basically just want to update this once and not touch it again until Xcode 14 comes out 🙈 We'll see how well this works, though...

joaolfp commented 2 years ago

CI failed 😔. Probably due to xcode update on CI

joaolfp commented 2 years ago

@ashfurrow Should we update the FBSnapshotTestCase version to a recent version?

ashfurrow commented 2 years ago

Hmm.

   Falling back to building from the source
18
*** Building scheme "FBSnapshotTestCase iOS" in FBSnapshotTestCase.xcworkspace
19
A shell task (/usr/bin/xcrun lipo -create /Users/runner/Library/Caches/org.carthage.CarthageKit/DerivedData/13.1_13A1030d/ios-snapshot-test-case/6.2.0/Build/Intermediates.noindex/ArchiveIntermediates/FBSnapshotTestCase\ iOS/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/FBSnapshotTestCase.framework/FBSnapshotTestCase /Users/runner/Library/Caches/org.carthage.CarthageKit/DerivedData/13.1_13A1030d/ios-snapshot-test-case/6.2.0/Build/Products/Release-iphonesimulator/FBSnapshotTestCase.framework/FBSnapshotTestCase -output /Users/runner/work/Nimble-Snapshots/Nimble-Snapshots/Carthage/Build/iOS/FBSnapshotTestCase.framework/FBSnapshotTestCase) failed with exit code 1:
20
fatal error: /Applications/Xcode_13.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: /Users/runner/Library/Caches/org.carthage.CarthageKit/DerivedData/13.1_13A1030d/ios-snapshot-test-case/6.2.0/Build/Intermediates.noindex/ArchiveIntermediates/FBSnapshotTestCase iOS/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/FBSnapshotTestCase.framework/FBSnapshotTestCase and /Users/runner/Library/Caches/org.carthage.CarthageKit/DerivedData/13.1_13A1030d/ios-snapshot-test-case/6.2.0/Build/Products/Release-iphonesimulator/FBSnapshotTestCase.framework/FBSnapshotTestCase have the same architectures (arm64) and can't be in the same fat output file
21

22
Building universal frameworks with common architectures is not possible. The device and simulator slices for "FBSnapshotTestCase" both build for: arm64
23
Rebuild with --use-xcframeworks to create an xcframework bundle instead.
24
Error: Process completed with exit code 1.

Seems related to the Xcode 12 workaround, maybe? I'll keep pecking at it. I am not very familiar with Carthage but maybe this is a way to learn.

joaolfp commented 2 years ago

@ashfurrow There is an issues talking about Workaround for xcode 13

ashfurrow commented 2 years ago

Cool, let's go with that. Alternatively, I tried using XCFrameworks and it worked, but it seems like support for xcframeworks is still not universal, so I don't think we should use them for our integration test.

joaolfp commented 2 years ago

CI approved 🎉

ashfurrow commented 2 years ago

Yaaaaay it's green. I've requested a review from @dogo just to get a double-check on my work. Once this PR gets merged in, @joaolfp's commit from #236 will also land in master so they'll get credit for their work 👍

joaolfp commented 2 years ago

Thanks @ashfurrow

dogo commented 2 years ago

LGFM. Thanks, @ashfurrow and @joaolfp