Merged in feature/testclean (pull request #126)
Bit of test clean up * fixes
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user