-
Notifications
You must be signed in to change notification settings - Fork 409
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mockery panics when configuration contains a package with a null value and recursive is true #726
Comments
@LandonTClipp I wanted to add that I can to help work on this if you think it is an issue worth addressing. I have found a huge amount of value from this project and would be happy to contribute to it if it would add value. |
Damn was hoping no one would notice that 😂 I'm glad to hear you're enjoying the project so much. There is a lot more interesting stuff coming down the pipe. Yes please do send in PRs, although let's see if we can narrow down why this happens. The config merging code is quite complex but I didn't have a good tool at my disposal that makes this easier. Let's see if we can find where this is happening. The other thing... showconfig is kind of broken due to a bug noted in another issue (I'm on mobile so can't easily find it now). We should figure out how to fix that because it sometimes hangs indefinitely. |
Fixes issue vektra#726. We needed an additional bit of logic to ensure that if the `config` section is nil that we default it to being an empty map.
FYI in the linked PR, I fixed the showconfig command and also the issue mentioned above with particular kinds of config causing mockery to crash. Please take a look @dlm when you get the chance, thanks for reporting! |
@LandonTClipp sorry for the slow reply. (Hectic Nov & Dec). I just did the upgrade and it works perfectly!! Thank you very much for getting this resolved!! |
Description
Mockery panics when configuration contains a package with a
null
value andrecursive: True
.Mockery Version
I have also confirmed this with
v2.32.1
Golang Version
I have also confirmed this with
v1.20.4
Installation Method
Steps to Reproduce
Create a project with the following structure:
Such that
foo/bar/bar.go
is:And
foo/foo.go
is:And
go.mod
is:And
main.go
is (The contents ofmain.go
does not matter, but it is helpfulfor making sure that the code is correct.):
And
.mockery.yaml
is:From the root we can successfully run with recursive false:
If, however, we run with from the root with
--recursive=true
we get:Expected Behavior
From playing around with alternative configs, for example, changing
.mockery.yaml
to:I get:
So I would guess that the config:
Should produce something like:
(...maybe?)
But either way, figuring that out seems like the starting point for working on
a fix and CONTRIBUTING.md suggests raising an issue before working on a PR.
Actual Behavior
Mockery crashes (as described above)
The text was updated successfully, but these errors were encountered: