github.com/weaviate/weaviate@v1.24.6/test/modules/multi2vec-bind/setup_test.go (about) 1 // _ _ 2 // __ _____ __ ___ ___ __ _| |_ ___ 3 // \ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \ 4 // \ V V / __/ (_| |\ V /| | (_| | || __/ 5 // \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___| 6 // 7 // Copyright © 2016 - 2024 Weaviate B.V. All rights reserved. 8 // 9 // CONTACT: hello@weaviate.io 10 // 11 12 package test 13 14 import ( 15 "context" 16 "os" 17 "testing" 18 19 "github.com/pkg/errors" 20 "github.com/weaviate/weaviate/test/docker" 21 ) 22 23 const weaviateEndpoint = "WEAVIATE_ENDPOINT" 24 25 func TestMain(m *testing.M) { 26 ctx := context.Background() 27 compose, err := docker.New(). 28 WithWeaviate(). 29 WithMulti2VecBind(). 30 Start(ctx) 31 if err != nil { 32 panic(errors.Wrapf(err, "cannot start")) 33 } 34 35 os.Setenv(weaviateEndpoint, compose.GetWeaviate().URI()) 36 code := m.Run() 37 38 if err := compose.Terminate(ctx); err != nil { 39 panic(errors.Wrapf(err, "cannot terminate")) 40 } 41 42 os.Exit(code) 43 }