forked from vmihailenco/taskq
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ironmq_test.go
91 lines (75 loc) · 2.05 KB
/
ironmq_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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
package taskq_test
import (
"testing"
iron_config "github.com/iron-io/iron_go3/config"
"github.com/vmihailenco/taskq/v3"
"github.com/vmihailenco/taskq/v3/ironmq"
)
func ironmqFactory() taskq.Factory {
settings := iron_config.Config("iron_mq")
return ironmq.NewFactory(&settings)
}
func TestIronmqConsumer(t *testing.T) {
testConsumer(t, ironmqFactory(), &taskq.QueueOptions{
Name: queueName("ironmq-consumer"),
})
}
func TestIronmqUnknownTask(t *testing.T) {
testUnknownTask(t, ironmqFactory(), &taskq.QueueOptions{
Name: queueName("ironmq-unknown-task"),
})
}
func TestIronmqFallback(t *testing.T) {
testFallback(t, ironmqFactory(), &taskq.QueueOptions{
Name: queueName("ironmq-fallback"),
})
}
func TestIronmqDelay(t *testing.T) {
testDelay(t, ironmqFactory(), &taskq.QueueOptions{
Name: queueName("ironmq-delay"),
})
}
func TestIronmqRetry(t *testing.T) {
testRetry(t, ironmqFactory(), &taskq.QueueOptions{
Name: queueName("ironmq-retry"),
})
}
func TestIronmqNamedMessage(t *testing.T) {
testNamedMessage(t, ironmqFactory(), &taskq.QueueOptions{
Name: queueName("ironmq-named-message"),
})
}
func TestIronmqCallOnce(t *testing.T) {
testCallOnce(t, ironmqFactory(), &taskq.QueueOptions{
Name: queueName("ironmq-call-once"),
})
}
func TestIronmqLen(t *testing.T) {
testLen(t, ironmqFactory(), &taskq.QueueOptions{
Name: queueName("ironmq-len"),
})
}
func TestIronmqRateLimit(t *testing.T) {
testRateLimit(t, ironmqFactory(), &taskq.QueueOptions{
Name: queueName("ironmq-rate-limit"),
})
}
func TestIronmqErrorDelay(t *testing.T) {
testErrorDelay(t, ironmqFactory(), &taskq.QueueOptions{
Name: queueName("ironmq-delayer"),
})
}
func TestIronmqWorkerLimit(t *testing.T) {
testWorkerLimit(t, ironmqFactory(), &taskq.QueueOptions{
Name: queueName("ironmq-worker-limit"),
})
}
func TestIronmqInvalidCredentials(t *testing.T) {
settings := &iron_config.Settings{
ProjectId: "123",
}
factory := ironmq.NewFactory(settings)
testInvalidCredentials(t, factory, &taskq.QueueOptions{
Name: queueName("ironmq-invalid-credentials"),
})
}