t.Parallel pls

main
Bel LaPointe 2024-04-15 16:35:51 -06:00
parent c9d3b4998b
commit d9244e4e1c
11 changed files with 16 additions and 4 deletions

View File

@ -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"

View File

@ -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 {

View File

@ -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()

View File

@ -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()

View File

@ -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

View File

@ -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
} }

View File

@ -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()

View File

@ -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()

View File

@ -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()

View File

@ -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
} }

View File

@ -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()