helper

package
v1.22.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 27, 2023 License: BSD-3-Clause Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ServerPort   string
	ServerHost   string
	ServerScheme string
	DebugHTTP    bool
)

Configuration flags provided by the user that runs an acceptance test.

Credentials for the root key

Functions

func AddReference

func AddReference(t *testing.T, object *models.Object, ref *models.SingleRef, prop string)

func AddReferenceTenant added in v1.20.0

func AddReferenceTenant(t *testing.T, object *models.Object, ref *models.SingleRef, prop string, tenant string)

func AddReferences

func AddReferences(t *testing.T, refs []*models.BatchReference) ([]*models.BatchReferenceResponse, error)

func AssertCreateObject

func AssertCreateObject(t *testing.T, className string, schema map[string]interface{}) strfmt.UUID

func AssertCreateObjectClass

func AssertCreateObjectClass(t *testing.T, class *models.Class)

func AssertDeleteObjectClass

func AssertDeleteObjectClass(t *testing.T, class string)

func AssertEventuallyEqual

func AssertEventuallyEqual(t *testing.T, expected interface{}, actualThunk func() interface{}, msg ...interface{})

AssertEventuallyEqual retries the 'actual' thunk every 10ms for a total of 300ms. If a single one succeeds, it returns, if all fails it eventually fails

func AssertEventuallyEqualWithFrequencyAndTimeout

func AssertEventuallyEqualWithFrequencyAndTimeout(t *testing.T, expected interface{}, actualThunk func() interface{},
	interval time.Duration, timeout time.Duration, msg ...interface{},
)

func AssertGetObject

func AssertGetObject(t *testing.T, class string, uuid strfmt.UUID, include ...string) *models.Object

func AssertGetObjectEventually

func AssertGetObjectEventually(t *testing.T, class string, uuid strfmt.UUID) *models.Object

func AssertGetObjectFailsEventually

func AssertGetObjectFailsEventually(t *testing.T, class string, uuid strfmt.UUID) error

func AssertRequestFail

func AssertRequestFail(t *testing.T, response interface{}, err error, checkFn func())

Asserts that the request _did_ return an error. Optionally perform some checks only if the request failed

func AssertRequestOk

func AssertRequestOk(t *testing.T, response interface{}, err error, checkFn func())

Asserts that the request did not return an error. Optionally perform some checks only if the request did not fail

func BatchClient

func BatchClient(t *testing.T) batch.ClientService

Create a client that logs with t.Logf, if a *testing.T is provided. If there is no test case at hand, pass in nil to disable logging.

func CertaintyToDist

func CertaintyToDist(t *testing.T, in float32) float32

func CheckObjectsBatchResponse added in v1.20.0

func CheckObjectsBatchResponse(t *testing.T, resp []*models.ObjectsGetResponse, err error)

func CheckReferencesBatchResponse added in v1.20.0

func CheckReferencesBatchResponse(t *testing.T, resp []*models.BatchReferenceResponse, err error)

func Client

func Client(t *testing.T) *apiclient.Weaviate

Create a client that logs with t.Logf, if a *testing.T is provided. If there is no test case at hand, pass in nil to disable logging.

func CreateAuth

func CreateAuth(apiKey strfmt.UUID, apiToken string) runtime.ClientAuthInfoWriterFunc

Create a Weaviate client for the given API key & token.

func CreateBackup

func CreateBackup(t *testing.T, className, backend, backupID string) (*backups.BackupsCreateOK, error)

func CreateBackupStatus

func CreateBackupStatus(t *testing.T, backend, backupID string) (*backups.BackupsCreateStatusOK, error)

func CreateClass

func CreateClass(t *testing.T, class *models.Class)

func CreateGrpcConnectionClient added in v1.22.0

func CreateGrpcConnectionClient(host string) (*grpc.ClientConn, error)

func CreateGrpcWeaviateClient added in v1.22.0

func CreateGrpcWeaviateClient(conn *grpc.ClientConn) pb.WeaviateClient

func CreateObject

func CreateObject(t *testing.T, object *models.Object)

func CreateObjectCL added in v1.18.0

func CreateObjectCL(t *testing.T, object *models.Object, cl replica.ConsistencyLevel)

func CreateObjectsBatch

func CreateObjectsBatch(t *testing.T, objects []*models.Object)

func CreateTenants added in v1.20.0

func CreateTenants(t *testing.T, class string, tenants []*models.Tenant)

func CreateTenantsReturnError added in v1.20.0

func CreateTenantsReturnError(t *testing.T, class string, tenants []*models.Tenant) error

func DeleteClass

func DeleteClass(t *testing.T, class string)

func DeleteClassObject

func DeleteClassObject(t *testing.T, class string) (*schema.SchemaObjectsDeleteOK, error)

func DeleteObject

func DeleteObject(t *testing.T, object *models.Object)

func DeleteObjectsBatch

func DeleteObjectsBatch(t *testing.T, body *models.BatchDelete)

func DeleteReference

func DeleteReference(t *testing.T, object *models.Object, ref *models.SingleRef, prop string)

func DeleteReferenceTenant added in v1.20.0

func DeleteReferenceTenant(t *testing.T, object *models.Object, ref *models.SingleRef, prop string, tenant string)

func DeleteTenantObject added in v1.20.0

func DeleteTenantObject(t *testing.T, class string, id strfmt.UUID, tenant string)

func DeleteTenantObjectsBatch added in v1.20.0

func DeleteTenantObjectsBatch(t *testing.T, body *models.BatchDelete,
	tenant string,
) (*models.BatchDeleteResponse, error)

func DeleteTenants added in v1.20.0

func DeleteTenants(t *testing.T, class string, tenants []string) error

func GetClass

func GetClass(t *testing.T, class string) *models.Class

func GetMeta added in v1.20.0

func GetMeta(t *testing.T) *models.Meta

func GetObject

func GetObject(t *testing.T, class string, uuid strfmt.UUID, include ...string) (*models.Object, error)

func GetObjectCL added in v1.18.0

func GetObjectCL(t *testing.T, class string, uuid strfmt.UUID,
	cl replica.ConsistencyLevel, include ...string,
) (*models.Object, error)

func GetObjectFromNode

func GetObjectFromNode(t *testing.T, class string, uuid strfmt.UUID, nodename string) (*models.Object, error)

func GetRandomString

func GetRandomString(length int) string

GetRandomString returns a string comprised of random samplings of charset, of length specified by caller

func GetTenantObjectFromNode added in v1.20.0

func GetTenantObjectFromNode(t *testing.T, class string, uuid strfmt.UUID, nodename, tenant string) (*models.Object, error)

func GetTenants added in v1.20.0

func GetTenants(t *testing.T, class string) (*schema.TenantsGetOK, error)

func GetWeaviateURL

func GetWeaviateURL() string

func IntToUUID added in v1.19.8

func IntToUUID(in uint64) strfmt.UUID

InToUUID takes an unsigned int64 and places it in BigEndian fashion into the upper 8 bytes of a 16 byte UUID. This makes it easy to produce easy-to-read UUIDs in test scenarios. For example:

IntToUUID(1)
// returns "00000000-0000-0000-0000-000000000001"

func ListObjects added in v1.20.0

func ListObjects(t *testing.T, class string) (*models.ObjectsListResponse, error)

func NewBeacon added in v1.20.0

func NewBeacon(className string, id strfmt.UUID) strfmt.URI

func ObjectExistsCL added in v1.18.0

func ObjectExistsCL(t *testing.T, class string, id strfmt.UUID, cl replica.ConsistencyLevel) (bool, error)

func OperationsClient

func OperationsClient(t *testing.T) operations_apiclient.ClientService

Create a client that logs with t.Logf, if a *testing.T is provided. If there is no test case at hand, pass in nil to disable logging.

func PatchObject

func PatchObject(t *testing.T, object *models.Object)

func RestoreBackup

func RestoreBackup(t *testing.T, className, backend, backupID string, nodeMapping map[string]string) (*backups.BackupsRestoreOK, error)

func RestoreBackupStatus

func RestoreBackupStatus(t *testing.T, backend, backupID string) (*backups.BackupsRestoreStatusOK, error)

func SetupClient

func SetupClient(uri string)

func TenantListObjects added in v1.20.0

func TenantListObjects(t *testing.T, class string, tenant string) (*models.ObjectsListResponse, error)

func TenantObject added in v1.20.0

func TenantObject(t *testing.T, class string, id strfmt.UUID, tenant string) (*models.Object, error)

func TenantObjectExists added in v1.20.0

func TenantObjectExists(t *testing.T, class string, id strfmt.UUID, tenant string) (bool, error)

func TenantObjectWithInclude added in v1.21.0

func TenantObjectWithInclude(t *testing.T, class string, id strfmt.UUID, tenant string, includes string) (*models.Object, error)

func UpdateClass

func UpdateClass(t *testing.T, class *models.Class)

func UpdateObject

func UpdateObject(t *testing.T, object *models.Object)

func UpdateObjectCL added in v1.18.0

func UpdateObjectCL(t *testing.T, object *models.Object, cl replica.ConsistencyLevel)

func UpdateReferenceTenant added in v1.20.0

func UpdateReferenceTenant(t *testing.T, object *models.Object, ref models.MultipleRef, prop string, tenant string)

Types

This section is empty.

Directories

Path Synopsis
sample-schema

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL