mockolo icon indicating copy to clipboard operation
mockolo copied to clipboard

[CI / Bitrise] Unable to generate mocks in CI [add better logging in mockolo for failure debugging!]

Open shreyanshp opened this issue 2 years ago • 3 comments

Hi!

I was trying out mockolo in my project and installed the latest version 1.6.2 from brew (brew install mockolo)

Using the following command in commandline results in below error

command below mockolo --sourcedirs /Users/vagrant/git/project/Core --destination /Users/vagrant/git/project/GeneratedMock.swift

Error below MockoloFramework/SourceParser.swift:101: Fatal error: The operation couldn’t be completed. (SwiftSyntax.ParserError error 1.)

Specs bitrise xcode 13.1 stack, however I am not sure if xcode version is needed for this issue? cause in my pipeline, I just checkout and run the above script!

let me know how to debug this further!

shreyanshp avatar Dec 04 '21 04:12 shreyanshp

I do understand that the above SwiftSyntax.ParserError error 1. does not convey any actionable data, however I would suggest to add an error wrapper in mockolo to provide more information on what went wrong, how we can fix it rather than just saying MockoloFramework/SourceParser.swift:101: Fatal error: The operation couldn’t be completed. (SwiftSyntax.ParserError error 1.)

In the meantime, I downgraded to 1.5.0 since that was the last release binary provided in the github by mockolo and it works fine!

Still I do want to move to 1.6.x or 1.7.x too, so will keep this ticket open till we added better logging for failure

shreyanshp avatar Dec 06 '21 05:12 shreyanshp

Please check out https://github.com/uber/mockolo/releases/tag/1.6.3

EspressoCup avatar Dec 06 '21 08:12 EspressoCup

Thank you so much for your reply @EspressoCup , much appreciated!

I moved to 1.6.3 and still see the same issue 🙇

MockoloFramework/SourceParser.swift:101: Fatal error: The operation couldn’t be completed. (SwiftSyntax.ParserError error 1.)

using the binary from the release file for ease of replication, rather than brew

shreyanshp avatar Dec 06 '21 09:12 shreyanshp

@shreyanshp Does this problem still occur?

uhooi avatar Nov 23 '22 06:11 uhooi