github.com/weaviate/weaviate@v1.24.6/test/modules/many-modules/many_modules_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  	"testing"
    17  
    18  	"github.com/stretchr/testify/require"
    19  	"github.com/weaviate/weaviate/test/docker"
    20  )
    21  
    22  func Test_ManyModules_SingleNode(t *testing.T) {
    23  	ctx := context.Background()
    24  	compose, err := createSingleNodeEnvironment(ctx)
    25  	require.NoError(t, err)
    26  	defer func() {
    27  		require.NoError(t, compose.Terminate(ctx))
    28  	}()
    29  	endpoint := compose.GetWeaviate().URI()
    30  	t.Run("many modules", manyModulesTests(endpoint))
    31  	t.Run("create schema with specific text2vec-openai settings", createSchemaOpenAISanityChecks(endpoint))
    32  }
    33  
    34  func Test_ManyModules_Cluster(t *testing.T) {
    35  	ctx := context.Background()
    36  	compose, err := createClusterEnvironment(ctx)
    37  	require.NoError(t, err)
    38  	defer func() {
    39  		require.NoError(t, compose.Terminate(ctx))
    40  	}()
    41  	endpoint := compose.GetWeaviate().URI()
    42  	t.Run("many modules", manyModulesTests(endpoint))
    43  	t.Run("create schema with specific text2vec-openai settings", createSchemaOpenAISanityChecks(endpoint))
    44  }
    45  
    46  func createSingleNodeEnvironment(ctx context.Context) (compose *docker.DockerCompose, err error) {
    47  	compose, err = composeModules().
    48  		WithWeaviate().
    49  		Start(ctx)
    50  	return
    51  }
    52  
    53  func createClusterEnvironment(ctx context.Context) (compose *docker.DockerCompose, err error) {
    54  	compose, err = composeModules().
    55  		WithWeaviateCluster().
    56  		Start(ctx)
    57  	return
    58  }
    59  
    60  func composeModules() (composeModules *docker.Compose) {
    61  	composeModules = docker.New().
    62  		WithText2VecContextionary().
    63  		WithText2VecTransformers().
    64  		WithText2VecOpenAI().
    65  		WithText2VecCohere().
    66  		WithText2VecVoyageAI().
    67  		WithText2VecPaLM().
    68  		WithText2VecHuggingFace().
    69  		WithText2VecAWS().
    70  		WithGenerativeOpenAI().
    71  		WithGenerativeCohere().
    72  		WithGenerativePaLM().
    73  		WithGenerativeAWS().
    74  		WithGenerativeAnyscale().
    75  		WithQnAOpenAI().
    76  		WithRerankerCohere()
    77  	return
    78  }