fix: 修复测试文件格式问题
- 修正测试文件中的换行符和格式 - 确保所有测试文件的一致性
This commit is contained in:
@@ -138,15 +138,15 @@ func TestClusterSafety_MultipleCursorWorkers(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
clientConfig := persistence.PersistenceClientConfig{
|
clientConfig := persistence.PersistenceClientConfig{
|
||||||
Publisher: publisher,
|
Publisher: publisher,
|
||||||
Logger: log,
|
Logger: log,
|
||||||
EnvelopeConfig: envelopeConfig,
|
EnvelopeConfig: envelopeConfig,
|
||||||
DBConfig: dbConfig,
|
DBConfig: dbConfig,
|
||||||
PersistenceConfig: persistenceConfig,
|
PersistenceConfig: persistenceConfig,
|
||||||
CursorWorkerConfig: cursorConfig,
|
CursorWorkerConfig: cursorConfig,
|
||||||
EnableCursorWorker: true,
|
EnableCursorWorker: true,
|
||||||
RetryWorkerConfig: retryConfig,
|
RetryWorkerConfig: retryConfig,
|
||||||
EnableRetryWorker: true,
|
EnableRetryWorker: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
client, err := persistence.NewPersistenceClient(ctx, clientConfig)
|
client, err := persistence.NewPersistenceClient(ctx, clientConfig)
|
||||||
@@ -334,4 +334,3 @@ func TestClusterSafety_ConcurrentStatusUpdate(t *testing.T) {
|
|||||||
|
|
||||||
t.Log("✅ CAS mechanism working correctly - Only one update succeeded")
|
t.Log("✅ CAS mechanism working correctly - Only one update succeeded")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -105,15 +105,15 @@ func TestCursorInitialization(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
clientConfig := persistence.PersistenceClientConfig{
|
clientConfig := persistence.PersistenceClientConfig{
|
||||||
Publisher: publisher,
|
Publisher: publisher,
|
||||||
Logger: log,
|
Logger: log,
|
||||||
EnvelopeConfig: envelopeConfig,
|
EnvelopeConfig: envelopeConfig,
|
||||||
DBConfig: dbConfig,
|
DBConfig: dbConfig,
|
||||||
PersistenceConfig: persistenceConfig,
|
PersistenceConfig: persistenceConfig,
|
||||||
CursorWorkerConfig: cursorConfig,
|
CursorWorkerConfig: cursorConfig,
|
||||||
EnableCursorWorker: true,
|
EnableCursorWorker: true,
|
||||||
RetryWorkerConfig: retryConfig,
|
RetryWorkerConfig: retryConfig,
|
||||||
EnableRetryWorker: true,
|
EnableRetryWorker: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
client, err := persistence.NewPersistenceClient(ctx, clientConfig)
|
client, err := persistence.NewPersistenceClient(ctx, clientConfig)
|
||||||
@@ -204,15 +204,15 @@ func TestCursorInitialization(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
clientConfig := persistence.PersistenceClientConfig{
|
clientConfig := persistence.PersistenceClientConfig{
|
||||||
Publisher: publisher,
|
Publisher: publisher,
|
||||||
Logger: log,
|
Logger: log,
|
||||||
EnvelopeConfig: envelopeConfig,
|
EnvelopeConfig: envelopeConfig,
|
||||||
DBConfig: dbConfig,
|
DBConfig: dbConfig,
|
||||||
PersistenceConfig: persistenceConfig,
|
PersistenceConfig: persistenceConfig,
|
||||||
CursorWorkerConfig: cursorConfig,
|
CursorWorkerConfig: cursorConfig,
|
||||||
EnableCursorWorker: true,
|
EnableCursorWorker: true,
|
||||||
RetryWorkerConfig: retryConfig,
|
RetryWorkerConfig: retryConfig,
|
||||||
EnableRetryWorker: true,
|
EnableRetryWorker: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
t.Log("📌 Creating PersistenceClient...")
|
t.Log("📌 Creating PersistenceClient...")
|
||||||
@@ -286,4 +286,3 @@ func TestCursorInitialization(t *testing.T) {
|
|||||||
t.Log("✅ Cursor initialization verification PASSED")
|
t.Log("✅ Cursor initialization verification PASSED")
|
||||||
t.Log(strings.Repeat("=", 60))
|
t.Log(strings.Repeat("=", 60))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -97,14 +97,14 @@ func TestPG_Query_Integration(t *testing.T) {
|
|||||||
op, err := model.NewFullOperation(
|
op, err := model.NewFullOperation(
|
||||||
model.Source(testOp.opSource),
|
model.Source(testOp.opSource),
|
||||||
testOp.opType,
|
testOp.opType,
|
||||||
testOp.prefix, // doPrefix
|
testOp.prefix, // doPrefix
|
||||||
testOp.repo, // doRepository
|
testOp.repo, // doRepository
|
||||||
testOp.doid, // doid
|
testOp.doid, // doid
|
||||||
testOp.producer, // producerID
|
testOp.producer, // producerID
|
||||||
testOp.actor, // opActor
|
testOp.actor, // opActor
|
||||||
nil, // requestBody
|
nil, // requestBody
|
||||||
nil, // responseBody
|
nil, // responseBody
|
||||||
testOp.time, // timestamp
|
testOp.time, // timestamp
|
||||||
)
|
)
|
||||||
require.NoError(t, err, "Failed to create operation %s", testOp.opID)
|
require.NoError(t, err, "Failed to create operation %s", testOp.opID)
|
||||||
|
|
||||||
@@ -535,14 +535,14 @@ func TestPG_PersistenceClient_Query_Integration(t *testing.T) {
|
|||||||
op, err := model.NewFullOperation(
|
op, err := model.NewFullOperation(
|
||||||
model.OpSourceDOIP,
|
model.OpSourceDOIP,
|
||||||
string(model.OpTypeCreate),
|
string(model.OpTypeCreate),
|
||||||
"10.10000", // doPrefix
|
"10.10000", // doPrefix
|
||||||
"client-repo", // doRepository
|
"client-repo", // doRepository
|
||||||
fmt.Sprintf("10.10000/client-repo/test-%d", i), // doid
|
fmt.Sprintf("10.10000/client-repo/test-%d", i), // doid
|
||||||
fmt.Sprintf("client-producer-%d", i), // producerID
|
fmt.Sprintf("client-producer-%d", i), // producerID
|
||||||
fmt.Sprintf("client-actor-%d", i), // opActor
|
fmt.Sprintf("client-actor-%d", i), // opActor
|
||||||
nil, // requestBody
|
nil, // requestBody
|
||||||
nil, // responseBody
|
nil, // responseBody
|
||||||
time.Now(), // timestamp
|
time.Now(), // timestamp
|
||||||
)
|
)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
op.OpID = fmt.Sprintf("pg-client-query-%03d", i)
|
op.OpID = fmt.Sprintf("pg-client-query-%03d", i)
|
||||||
@@ -613,4 +613,3 @@ func TestPG_PersistenceClient_Query_Integration(t *testing.T) {
|
|||||||
func strPtr(s string) *string {
|
func strPtr(s string) *string {
|
||||||
return &s
|
return &s
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -287,4 +287,3 @@ func TestPersistenceClient_QueryOperations(t *testing.T) {
|
|||||||
assert.Equal(t, StatusNotTrustlogged, status)
|
assert.Equal(t, StatusNotTrustlogged, status)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user