-
-
Notifications
You must be signed in to change notification settings - Fork 152
Expand file tree
/
Copy path.mockery.yaml
More file actions
138 lines (134 loc) · 4.32 KB
/
Copy path.mockery.yaml
File metadata and controls
138 lines (134 loc) · 4.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# mockery v3 配置 —— 由 `make mocks` 调用(go run github.com/vektra/mockery/v3@<pin>)。
#
# 约定:
# - template: testify —— 生成 testify 风格 mock(NewMockXxx(t) + .EXPECT() API)。
# - 所有 service 包的包名都是 `service`,全局 dir 模板会撞名,因此每个包用 config.dir/pkgname
# 显式指定,统一集中输出到 internal/test/mocks/<domain>mock/,包名 <domain>mock。
# - boilerplate-file:把 SPDX 头注入每个生成文件,使 `make spdx-check` 通过。
# - 生成文件带 "// Code generated by mockery ... DO NOT EDIT.",golangci-lint 自动跳过。
# - Makefile pin 死 mockery 版本,保证任何机器/CI 生成结果一致,`make mocks-check` 才稳定。
dir: internal/test/mocks/{{.PackageName}}
# v3 testify 模板默认输出 mocks_test.go(仅供同包内使用、不可被其他包 import)。
# 我们要集中复用,故覆写为普通 .go 文件名,使各域 mock 可被外部测试包导入。
filename: mocks.go
structname: Mock{{.InterfaceName}}
pkgname: '{{.PackageName}}mock'
template: testify
template-data:
boilerplate-file: scripts/spdx-boilerplate.txt
unroll-variadic: true
packages:
# ---- 协作者(被多个域以别名 CommonService / FileService 复用)----
github.com/lin-snow/ech0/internal/service/common:
config:
dir: internal/test/mocks/commonmock
pkgname: commonmock
interfaces:
Service: {}
CommonRepository: {}
github.com/lin-snow/ech0/internal/service/file:
config:
dir: internal/test/mocks/filemock
pkgname: filemock
interfaces:
Service: {}
CommonRepository: {}
FileRepository: {}
# ---- 通用基础设施 ----
github.com/lin-snow/ech0/internal/transaction:
config:
dir: internal/test/mocks/txmock
pkgname: txmock
interfaces:
Transactor: {}
github.com/lin-snow/ech0/internal/kvstore:
config:
dir: internal/test/mocks/kvmock
pkgname: kvmock
interfaces:
Store: {}
# ---- 各业务域(消费者侧 Repository / 协作接口)----
github.com/lin-snow/ech0/internal/service/comment:
config:
dir: internal/test/mocks/commentmock
pkgname: commentmock
interfaces:
Service: {}
Repository: {}
Mailer: {}
github.com/lin-snow/ech0/internal/service/user:
config:
dir: internal/test/mocks/usermock
pkgname: usermock
interfaces:
Service: {}
Repository: {}
UserRepo: {}
InstallStateRepo: {}
github.com/lin-snow/ech0/internal/service/echo:
config:
dir: internal/test/mocks/echomock
pkgname: echomock
interfaces:
Service: {}
Repository: {}
github.com/lin-snow/ech0/internal/service/setting:
config:
dir: internal/test/mocks/settingmock
pkgname: settingmock
interfaces:
Service: {}
SettingRepository: {}
TokenRevoker: {}
WebhookRepository: {}
github.com/lin-snow/ech0/internal/service/connect:
config:
dir: internal/test/mocks/connectmock
pkgname: connectmock
interfaces:
Service: {}
Repository: {}
EchoRepository: {}
github.com/lin-snow/ech0/internal/service/embedding:
config:
dir: internal/test/mocks/embeddingmock
pkgname: embeddingmock
interfaces:
Repository: {}
Indexer: {}
EchoReader: {}
Embedder: {}
# ---- handler 层依赖的 Service(以及 auth 服务层测试需要的 Repository/AuthRepo)----
github.com/lin-snow/ech0/internal/service/auth:
config:
dir: internal/test/mocks/authmock
pkgname: authmock
interfaces:
Service: {}
Repository: {}
AuthRepo: {}
github.com/lin-snow/ech0/internal/service/init:
config:
dir: internal/test/mocks/initmock
pkgname: initmock
interfaces:
Service: {}
github.com/lin-snow/ech0/internal/service/dashboard:
config:
dir: internal/test/mocks/dashboardmock
pkgname: dashboardmock
interfaces:
Service: {}
github.com/lin-snow/ech0/internal/service/migrator:
config:
dir: internal/test/mocks/migratormock
pkgname: migratormock
interfaces:
Service: {}
github.com/lin-snow/ech0/internal/service/copilot:
config:
dir: internal/test/mocks/copilotmock
pkgname: copilotmock
interfaces:
SummaryService: {}
ChatService: {}