feat(logging): 增强测试框架的日志记录功能
- 在 GenerateSwagger 方法中添加调试日志记录,记录部分运行检查和现有端点的保留情况 - 更新 Action 方法以支持测试模式下的日志缓冲,确保日志记录的准确性 - 删除不再使用的计划文档,简化项目结构
This commit is contained in:
@@ -12,6 +12,9 @@ var savepointCounter uint64
|
||||
// 如果 action 返回 true 则提交事务;返回 false 则回滚
|
||||
// 测试模式下(testTx != nil),使用 SAVEPOINT 代替真事务,确保嵌套事务不会绕过外层测试事务
|
||||
func (that *HoTimeDB) Action(action func(db HoTimeDB) (isSuccess bool)) (isSuccess bool) {
|
||||
that.testLogBufMu.Lock()
|
||||
logBuf := that.testLogBuf
|
||||
that.testLogBufMu.Unlock()
|
||||
db := HoTimeDB{
|
||||
DB: that.DB,
|
||||
ContextBase: that.ContextBase,
|
||||
@@ -33,6 +36,7 @@ func (that *HoTimeDB) Action(action func(db HoTimeDB) (isSuccess bool)) (isSucce
|
||||
limitMu: sync.Mutex{},
|
||||
testTx: that.testTx,
|
||||
testMu: that.testMu,
|
||||
testLogBuf: logBuf,
|
||||
}
|
||||
|
||||
if that.testTx != nil {
|
||||
|
||||
Reference in New Issue
Block a user