Merged in feature/testclean (pull request #126)

Bit of test clean up

* fixes
This commit is contained in:
Michael McGuinness
2025-04-29 17:13:09 +00:00
parent d3d89bf1d3
commit af361b4a67
11 changed files with 107 additions and 99 deletions
+40
View File
@@ -1065,3 +1065,43 @@ func createDocumentWithCollectorAndResults(t testing.TB, ctx context.Context, qu
return documentID, cleanId, textId
}
func BenchmarkIsClientSynced(b *testing.B) {
ctx := context.Background()
cfg := &serviceconfig.BaseConfig{}
net := test.DepNetwork.Get(b, ctx)
_ = test.CreateDB(b, ctx, cfg, net, &test.CreateDatabaseConfig{})
queries := cfg.GetDBQueries()
contextQueryID, jsonQueryID := createDependentQueries(b, ctx, queries)
clientId := createClientWithCollector(b, ctx, queries)
_, _, _ = createDocumentWithCollectorAndResults(b, ctx, queries, clientId, contextQueryID, jsonQueryID)
b.ResetTimer()
for b.Loop() {
_, _ = queries.IsClientSynced(ctx, &clientId)
}
}
func BenchmarkGetDocumentExternal(b *testing.B) {
ctx := context.Background()
cfg := &serviceconfig.BaseConfig{}
net := test.DepNetwork.Get(b, ctx)
_ = test.CreateDB(b, ctx, cfg, net, &test.CreateDatabaseConfig{})
queries := cfg.GetDBQueries()
contextQueryID, jsonQueryID := createDependentQueries(b, ctx, queries)
clientId := createClientWithCollector(b, ctx, queries)
documentID, _, _ := createDocumentWithCollectorAndResults(b, ctx, queries, clientId, contextQueryID, jsonQueryID)
b.ResetTimer()
for b.Loop() {
_, _ = queries.GetDocumentExternal(ctx, documentID)
}
}