-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathstorage_test.go
69 lines (64 loc) · 1.37 KB
/
storage_test.go
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
package traces
import "testing"
func TestRequestWebSearch(t *testing.T) {
for _, p := range policies {
p := p
t.Run(p, func(t *testing.T) {
t.Parallel()
opt := options{
policy: p,
cacheSize: 256000,
reportInterval: 10000,
maxItems: 1000000,
}
testRequest(t, NewStorageProvider, opt,
"WebSearch*.spc.bz2", "request_websearch-"+p+".txt")
})
}
}
func TestRequestFinancial(t *testing.T) {
for _, p := range policies {
p := p
t.Run(p, func(t *testing.T) {
t.Parallel()
opt := options{
policy: p,
cacheSize: 512,
reportInterval: 30000,
maxItems: 3000000,
}
testRequest(t, NewStorageProvider, opt,
"Financial*.spc.bz2", "request_financial-"+p+".txt")
})
}
}
func TestSizeWebSearch(t *testing.T) {
for _, p := range policies {
p := p
opt := options{
policy: p,
cacheSize: 25000,
maxItems: 1000000,
}
t.Run(p, func(t *testing.T) {
t.Parallel()
testSize(t, NewStorageProvider, opt,
"WebSearch*.spc.bz2", "size_websearch-"+p+".txt")
})
}
}
func TestSizeFinancial(t *testing.T) {
for _, p := range policies {
p := p
opt := options{
policy: p,
cacheSize: 250,
maxItems: 1000000,
}
t.Run(p, func(t *testing.T) {
t.Parallel()
testSize(t, NewStorageProvider, opt,
"Financial*.spc.bz2", "size_financial-"+p+".txt")
})
}
}