t.Parallel pls
parent
c9d3b4998b
commit
d9244e4e1c
|
|
@ -14,18 +14,21 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestAINoop(t *testing.T) {
|
func TestAINoop(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
ai := NewAINoop()
|
ai := NewAINoop()
|
||||||
|
|
||||||
testAI(t, ai)
|
testAI(t, ai)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestAIOllama(t *testing.T) {
|
func TestAIOllama(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
ai := NewAIOllama("http://localhost:11434", "gemma:2b")
|
ai := NewAIOllama("http://localhost:11434", "gemma:2b")
|
||||||
|
|
||||||
testAI(t, ai)
|
testAI(t, ai)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestAILocal(t *testing.T) {
|
func TestAILocal(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
d := os.TempDir()
|
d := os.TempDir()
|
||||||
checkpoints := "checkpoints"
|
checkpoints := "checkpoints"
|
||||||
tokenizer := "tokenizer"
|
tokenizer := "tokenizer"
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestNewConfig(t *testing.T) {
|
func TestNewConfig(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
if got, err := newConfigFromEnv(context.Background(), func(k string) string {
|
if got, err := newConfigFromEnv(context.Background(), func(k string) string {
|
||||||
t.Logf("getenv(%s)", k)
|
t.Logf("getenv(%s)", k)
|
||||||
switch k {
|
switch k {
|
||||||
|
|
|
||||||
|
|
@ -7,10 +7,12 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestNewTestDriver(t *testing.T) {
|
func TestNewTestDriver(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
NewTestDriver(t)
|
NewTestDriver(t)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestDriver(t *testing.T) {
|
func TestDriver(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
ctx, can := context.WithTimeout(context.Background(), time.Second*15)
|
ctx, can := context.WithTimeout(context.Background(), time.Second*15)
|
||||||
defer can()
|
defer can()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestRun(t *testing.T) {
|
func TestRun(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
ctx, can := context.WithTimeout(context.Background(), time.Second*10)
|
ctx, can := context.WithTimeout(context.Background(), time.Second*10)
|
||||||
defer can()
|
defer can()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestParseSlackTestdata(t *testing.T) {
|
func TestParseSlackTestdata(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
cases := map[string]struct {
|
cases := map[string]struct {
|
||||||
inCh string
|
inCh string
|
||||||
slackMessage slackMessage
|
slackMessage slackMessage
|
||||||
|
|
|
||||||
|
|
@ -10,11 +10,11 @@ type MessageToPersistence struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewMessageToPersistencePipeline(ctx context.Context, cfg Config) (Pipeline, error) {
|
func NewMessageToPersistencePipeline(ctx context.Context, cfg Config) (Pipeline, error) {
|
||||||
reader, err := NewQueue(ctx, "fromMessage", cfg.driver)
|
reader, err := NewQueue(ctx, "new_message", cfg.driver)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return Pipeline{}, err
|
return Pipeline{}, err
|
||||||
}
|
}
|
||||||
writer, err := NewQueue(ctx, "fromPersistence", cfg.driver)
|
writer, err := NewQueue(ctx, "new_persistence", cfg.driver)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return Pipeline{}, err
|
return Pipeline{}, err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestMessageToPersistenceProcessor(t *testing.T) {
|
func TestMessageToPersistenceProcessor(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
ctx, can := context.WithTimeout(context.Background(), time.Second*10)
|
ctx, can := context.WithTimeout(context.Background(), time.Second*10)
|
||||||
defer can()
|
defer can()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestPipeline(t *testing.T) {
|
func TestPipeline(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
ctx, can := context.WithTimeout(context.Background(), time.Second*10)
|
ctx, can := context.WithTimeout(context.Background(), time.Second*10)
|
||||||
defer can()
|
defer can()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestQueue(t *testing.T) {
|
func TestQueue(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
ctx, can := context.WithTimeout(context.Background(), time.Second*10)
|
ctx, can := context.WithTimeout(context.Background(), time.Second*10)
|
||||||
defer can()
|
defer can()
|
||||||
|
|
||||||
|
|
|
||||||
4
slack.go
4
slack.go
|
|
@ -10,11 +10,11 @@ type SlackToMessage struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewSlackToMessagePipeline(ctx context.Context, cfg Config) (Pipeline, error) {
|
func NewSlackToMessagePipeline(ctx context.Context, cfg Config) (Pipeline, error) {
|
||||||
reader, err := NewQueue(ctx, "fromSlack", cfg.driver)
|
reader, err := NewQueue(ctx, "slack_event", cfg.driver)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return Pipeline{}, err
|
return Pipeline{}, err
|
||||||
}
|
}
|
||||||
writer, err := NewQueue(ctx, "fromMessage", cfg.driver)
|
writer, err := NewQueue(ctx, "new_message", cfg.driver)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return Pipeline{}, err
|
return Pipeline{}, err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestSlackToMessagePipeline(t *testing.T) {
|
func TestSlackToMessagePipeline(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
ctx, can := context.WithTimeout(context.Background(), time.Second*5)
|
ctx, can := context.WithTimeout(context.Background(), time.Second*5)
|
||||||
defer can()
|
defer can()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue