Description
I'm trying to migrate our mockery config from v2 to v3. Here's my v2 config:
dir: "test/mocks/{{.InterfaceDirRelative}}"
filename: "{{.InterfaceNameSnake}}_mock.go"
mockname: "{{.InterfaceName}}Mock"
include-auto-generated: false
packages:
mockery3pkggen:
config:
all: true
github.com/stevenferrer/solr-go:
config:
all: true
recursive: true
And here's what mockery3 generated via mockery migrate in .mockery_v3.yml:
dir: test/mocks/{{.InterfaceDirRelative}}
include-auto-generated: false
structname: '{{.InterfaceName}}Mock'
template: testify
template-data:
unroll-variadic: true
packages:
github.com/stevenferrer/solr-go:
config:
all: true
recursive: true
mockery3pkggen:
config:
all: true
After running mockery3 --config .mockery_v3.yml, I just get this error:
$ mockery3 --config .mockery_v3.yml
2026-04-01T17:30:44.482480000-04:00 INF Starting mockery config-file=.mockery_v3.yml version=v3.7.0
2026-04-01T17:30:44.482567000-04:00 INF Parsing configured packages... version=v3.7.0
2026-04-01T17:30:44.793681000-04:00 INF Done parsing configured packages. version=v3.7.0
2026-04-01T17:30:44.794416000-04:00 INF adding interface to collection collection=../go/pkg/mod/github.com/stevenferrer/[email protected]/mocks_test.go interface=Client package-path=github.com/stevenferrer/solr-go version=v3.7.0
2026-04-01T17:30:44.794512000-04:00 INF adding interface to collection collection=../go/pkg/mod/github.com/stevenferrer/[email protected]/mocks_test.go interface=Faceter package-path=github.com/stevenferrer/solr-go version=v3.7.0
2026-04-01T17:30:44.794593000-04:00 INF adding interface to collection collection=../go/pkg/mod/github.com/stevenferrer/[email protected]/mocks_test.go interface=QueryParser package-path=github.com/stevenferrer/solr-go version=v3.7.0
2026-04-01T17:30:44.794673000-04:00 INF adding interface to collection collection=../go/pkg/mod/github.com/stevenferrer/[email protected]/mocks_test.go interface=RequestSender package-path=github.com/stevenferrer/solr-go version=v3.7.0
2026-04-01T17:30:44.795657000-04:00 ERR failed to find output package path error="file not found" file=../go/pkg/mod/github.com/stevenferrer/[email protected]/mocks_test.go out-pkg-name=solr outPkgFSPath=/Users/myuser/Documents/Repositories/go/pkg/mod/github.com/stevenferrer/[email protected] src-pkg-name=solr srcPkgFSPath=/Users/myuser/go/pkg/mod/github.com/stevenferrer/[email protected] version=v3.7.0
2026-04-01T17:30:44.795671000-04:00 FTL app failed error="file not found" version=v3.7.0
The v2 file works fine with mockery2 and generates the interfaces without error, so I'm confused what's wrong?
Reproducer
- Clone https://github.com/takanuva15/mockery3pkggen-error-mve
- Generate interfaces using mockery v2:
mockery
- Generate interfaces using mockery v3 and observe error:
mockery3 --config .mockery_v3.yml
Expected behavior
No error
Mockery version
v3.7.0
Installation Mechanism
Go version
go version go1.26.0 darwin/arm64
Description
I'm trying to migrate our mockery config from v2 to v3. Here's my v2 config:
And here's what mockery3 generated via
mockery migratein.mockery_v3.yml:After running
mockery3 --config .mockery_v3.yml, I just get this error:The v2 file works fine with mockery2 and generates the interfaces without error, so I'm confused what's wrong?
Reproducer
mockerymockery3 --config .mockery_v3.ymlExpected behavior
No error
Mockery version
v3.7.0Installation Mechanism
go getGo version
go version go1.26.0 darwin/arm64