Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 16 additions & 15 deletions test/backup/journey.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
SOUP_CLASS_NAME,
} from '../../src/utils/testData';
import weaviate, { WeaviateClient } from '../../src/v2/index.js';
import { TEST_HOST, TEST_REST_PORT } from '../env.js';
import {
BackupCreateResponse,
BackupCreateStatusResponse,
Expand All @@ -22,7 +23,7 @@ describe('create and restore backup with waiting', () => {

const client = weaviate.client({
scheme: 'http',
host: 'localhost:8080',
host: `${TEST_HOST}:${TEST_REST_PORT}`,
});

it('sets up', () => createTestFoodSchemaAndData(client));
Expand Down Expand Up @@ -132,7 +133,7 @@ describe('create and restore backup without waiting', () => {

const client = weaviate.client({
scheme: 'http',
host: 'localhost:8080',
host: `${TEST_HOST}:${TEST_REST_PORT}`,
});

it('sets up', () => createTestFoodSchemaAndData(client));
Expand Down Expand Up @@ -262,7 +263,7 @@ describe('create and restore 1 of 2 classes', () => {

const client = weaviate.client({
scheme: 'http',
host: 'localhost:8080',
host: `${TEST_HOST}:${TEST_REST_PORT}`,
});

it('sets up', () => createTestFoodSchemaAndData(client));
Expand Down Expand Up @@ -375,7 +376,7 @@ describe('fail creating backup for not existing class', () => {

const client = weaviate.client({
scheme: 'http',
host: 'localhost:8080',
host: `${TEST_HOST}:${TEST_REST_PORT}`,
});

it('sets up', () => createTestFoodSchemaAndData(client));
Expand Down Expand Up @@ -405,7 +406,7 @@ describe('fail restoring backup for existing class', () => {

const client = weaviate.client({
scheme: 'http',
host: 'localhost:8080',
host: `${TEST_HOST}:${TEST_REST_PORT}`,
});

it('sets up', () => createTestFoodSchemaAndData(client));
Expand Down Expand Up @@ -447,7 +448,7 @@ describe('fail creating existing backup', () => {

const client = weaviate.client({
scheme: 'http',
host: 'localhost:8080',
host: `${TEST_HOST}:${TEST_REST_PORT}`,
});

it('sets up', () => createTestFoodSchemaAndData(client));
Expand Down Expand Up @@ -490,7 +491,7 @@ describe('fail checking create status for not existing backup', () => {

const client = weaviate.client({
scheme: 'http',
host: 'localhost:8080',
host: `${TEST_HOST}:${TEST_REST_PORT}`,
});

it('sets up', () => createTestFoodSchemaAndData(client));
Expand Down Expand Up @@ -519,7 +520,7 @@ describe('fail restoring not existing backup', () => {

const client = weaviate.client({
scheme: 'http',
host: 'localhost:8080',
host: `${TEST_HOST}:${TEST_REST_PORT}`,
});

it('sets up', () => createTestFoodSchemaAndData(client));
Expand Down Expand Up @@ -549,7 +550,7 @@ describe('fail checking restore status for not started restore', () => {

const client = weaviate.client({
scheme: 'http',
host: 'localhost:8080',
host: `${TEST_HOST}:${TEST_REST_PORT}`,
});

it('sets up', () => createTestFoodSchemaAndData(client));
Expand Down Expand Up @@ -591,7 +592,7 @@ describe('fail creating backup for both include and exclude classes', () => {

const client = weaviate.client({
scheme: 'http',
host: 'localhost:8080',
host: `${TEST_HOST}:${TEST_REST_PORT}`,
});

it('sets up', () => createTestFoodSchemaAndData(client));
Expand Down Expand Up @@ -624,7 +625,7 @@ describe('fail restoring backup for both include and exclude classes', () => {

const client = weaviate.client({
scheme: 'http',
host: 'localhost:8080',
host: `${TEST_HOST}:${TEST_REST_PORT}`,
});

it('sets up', () => createTestFoodSchemaAndData(client));
Expand Down Expand Up @@ -679,7 +680,7 @@ describe('creates backup with valid compression config values', () => {

const client = weaviate.client({
scheme: 'http',
host: 'localhost:8080',
host: `${TEST_HOST}:${TEST_REST_PORT}`,
});

it('sets up', () => createTestFoodSchemaAndData(client));
Expand Down Expand Up @@ -710,7 +711,7 @@ describe('fails creating backup with invalid compression config', () => {

const client = weaviate.client({
scheme: 'http',
host: 'localhost:8080',
host: `${TEST_HOST}:${TEST_REST_PORT}`,
});

it('sets up', () => createTestFoodSchemaAndData(client));
Expand Down Expand Up @@ -762,7 +763,7 @@ describe('restores backup with valid compression config values', () => {

const client = weaviate.client({
scheme: 'http',
host: 'localhost:8080',
host: `${TEST_HOST}:${TEST_REST_PORT}`,
});

it('sets up', () => createTestFoodSchemaAndData(client));
Expand Down Expand Up @@ -838,7 +839,7 @@ describe('fails restoring backup with invalid compression config', () => {

const client = weaviate.client({
scheme: 'http',
host: 'localhost:8080',
host: `${TEST_HOST}:${TEST_REST_PORT}`,
});

it('sets up', () => createTestFoodSchemaAndData(client));
Expand Down
7 changes: 4 additions & 3 deletions test/batch/journey.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* eslint-disable @typescript-eslint/no-non-null-assertion */
import { describe, expect, it } from 'vitest';
import weaviate, { WeaviateClient } from '../../src/v2/index.js';
import { TEST_HOST, TEST_REST_PORT } from '../env.js';
import {
BatchDeleteResponse,
BatchReference,
Expand Down Expand Up @@ -77,7 +78,7 @@ const someReferences = [
describe('batch importing', () => {
const client = weaviate.client({
scheme: 'http',
host: 'localhost:8080',
host: `${TEST_HOST}:${TEST_REST_PORT}`,
});

it('can add objects with different methods', () => {
Expand Down Expand Up @@ -349,7 +350,7 @@ describe('batch importing', () => {
describe('batch deleting', () => {
const client = weaviate.client({
scheme: 'http',
host: 'localhost:8080',
host: `${TEST_HOST}:${TEST_REST_PORT}`,
});

it('sets up schema', () => setup(client));
Expand Down Expand Up @@ -504,7 +505,7 @@ describe('batch deleting', () => {
describe('multi tenancy', () => {
const client = weaviate.client({
scheme: 'http',
host: 'localhost:8080',
host: `${TEST_HOST}:${TEST_REST_PORT}`,
});

const passageClassName = 'Passage';
Expand Down
3 changes: 2 additions & 1 deletion test/c11y/journey.test.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
/* eslint-disable @typescript-eslint/no-non-null-assertion */
import { describe, expect, it } from 'vitest';
import weaviate from '../../src/v2/index.js';
import { TEST_HOST, TEST_REST_PORT } from '../env.js';
import { C11yExtension, C11yWordsResponse } from '../openapi/types.js';

describe('c11y endpoints', () => {
const client = weaviate.client({
scheme: 'http',
host: 'localhost:8080',
host: `${TEST_HOST}:${TEST_REST_PORT}`,
});

it('displays info about a concept', () => {
Expand Down
3 changes: 2 additions & 1 deletion test/classifications/contextual.journey.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { describe, expect, it } from 'vitest';
import { Classification } from '../../src/openapi/types.js';
import weaviate from '../../src/v2/index.js';
import { TEST_HOST, TEST_REST_PORT } from '../env.js';

const targetDessertId = '9f399d3e-45a4-44f4-b0fd-fa291abfb211';
const targetSavoryId = 'b7a64fbd-7c22-44ac-afbb-8d1432b8061b';
Expand All @@ -14,7 +15,7 @@ describe('a classification journey', () => {
describe("knn - using the client's wait method", () => {
const client = weaviate.client({
scheme: 'http',
host: 'localhost:8080',
host: `${TEST_HOST}:${TEST_REST_PORT}`,
});

it('setups the schema and data', () => setup(client));
Expand Down
7 changes: 4 additions & 3 deletions test/classifications/knn.journey.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { describe, expect, it } from 'vitest';
import { Classification } from '../../src/openapi/types.js';
import weaviate, { WeaviateClient } from '../../src/v2/index.js';
import { TEST_HOST, TEST_REST_PORT } from '../env.js';

const targetDessertId = 'cd54852a-209d-423b-bf1c-884468215237';
const targetSavoryId = 'e5da0127-327e-4184-85b8-7b9d1af4a850';
Expand All @@ -11,7 +12,7 @@ describe('a classification journey', () => {
describe('knn - manually polling the status', () => {
const client = weaviate.client({
scheme: 'http',
host: 'localhost:8080',
host: `${TEST_HOST}:${TEST_REST_PORT}`,
});

it('setups the schema and data', () => setup(client));
Expand Down Expand Up @@ -104,7 +105,7 @@ describe('a classification journey', () => {
describe("knn - using the client's wait method", () => {
const client = weaviate.client({
scheme: 'http',
host: 'localhost:8080',
host: `${TEST_HOST}:${TEST_REST_PORT}`,
});

it('setups the schema and data', () => setup(client));
Expand Down Expand Up @@ -169,7 +170,7 @@ describe('a classification journey', () => {
describe('knn - running into a timeout', () => {
const client = weaviate.client({
scheme: 'http',
host: 'localhost:8080',
host: `${TEST_HOST}:${TEST_REST_PORT}`,
});

it('setups the schema and data', () => setup(client));
Expand Down
7 changes: 4 additions & 3 deletions test/collections/config/integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import weaviate, {
} from '../../../src/index.js';
import { WeaviateClass } from '../../../src/openapi/types.js';
import { requireAtLeast } from '../../../test/version.js';
import { TEST_HOST, TEST_REST_PORT } from '../../env';

describe('Testing of the collection.config namespace', () => {
let client: WeaviateClient;
Expand Down Expand Up @@ -813,7 +814,7 @@ describe('Testing of the collection.config namespace', () => {

it('should be able update the config of a collection with legacy vectors', async () => {
const clientV2 = weaviateV2.client({
host: 'http://localhost:8080',
host: `http://${TEST_HOST}:${TEST_REST_PORT}`,
});
const collectionName = 'TestCollectionConfigUpdateLegacyVectors';
await clientV2.schema
Expand Down Expand Up @@ -981,7 +982,7 @@ describe('Testing of the collection.config namespace', () => {
.then((config) =>
expect((config.vectorizers.default.indexConfig as VectorIndexConfigHNSW).quantizer).toBeUndefined()
);
await fetch(`http://localhost:8080/v1/schema/${collectionName}`)
await fetch(`http://${TEST_HOST}:${TEST_REST_PORT}/v1/schema/${collectionName}`)
.then((res) => res.json() as WeaviateClass)
.then((schema) =>
expect(schema.vectorConfig?.default.vectorIndexConfig?.skipDefaultQuantization).toBe(true)
Expand All @@ -1002,7 +1003,7 @@ describe('Testing of the collection.config namespace', () => {
.then((config) =>
expect((config.vectorizers.custom.indexConfig as VectorIndexConfigHNSW).quantizer).toBeUndefined()
);
await fetch(`http://localhost:8080/v1/schema/${collectionName}`)
await fetch(`http://${TEST_HOST}:${TEST_REST_PORT}/v1/schema/${collectionName}`)
.then((res) => res.json() as WeaviateClass)
.then((schema) =>
expect(schema.vectorConfig?.custom.vectorIndexConfig?.skipDefaultQuantization).toBe(true)
Expand Down
3 changes: 2 additions & 1 deletion test/collections/data/integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import weaviate, {
WeaviateObject,
weaviateV2,
} from '../../../src/index.js';
import { TEST_HOST, TEST_REST_PORT } from '../../env.js';
import { requireAtLeast } from '../../version.js';

type TestCollectionData = {
Expand Down Expand Up @@ -1055,7 +1056,7 @@ describe('Testing of the collection.data methods with a vector index', () => {

describe('Testing of BYOV insertion with legacy vectorizer', () => {
const collectionName = 'TestBYOVEdgeCase';
const oldClient = weaviateV2.client({ scheme: 'http', host: 'localhost:8080' });
const oldClient = weaviateV2.client({ scheme: 'http', host: `${TEST_HOST}:${TEST_REST_PORT}` });

beforeAll(() =>
oldClient.schema
Expand Down
11 changes: 7 additions & 4 deletions test/collections/generate/integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ import weaviate, {
WeaviateClient,
generativeParameters,
} from '../../../src/index.js';
import { TEST_VECTOR_GRPC_PORT, TEST_VECTOR_HOST, TEST_VECTOR_REST_PORT } from '../../env';

const maybe = process.env.OPENAI_APIKEY ? describe : describe.skip;

const makeOpenAIClient = () =>
weaviate.connectToLocal({
port: 8086,
grpcPort: 50057,
host: TEST_VECTOR_HOST,
port: TEST_VECTOR_REST_PORT,
grpcPort: TEST_VECTOR_GRPC_PORT,
headers: {
'X-Openai-Api-Key': process.env.OPENAI_APIKEY!,
},
Expand Down Expand Up @@ -579,8 +581,9 @@ maybeContextualAI('Testing of the collection.generate methods with Contextual AI

beforeAll(async () => {
client = await weaviate.connectToLocal({
port: 8086,
grpcPort: 50057,
host: TEST_VECTOR_HOST,
port: TEST_VECTOR_REST_PORT,
grpcPort: TEST_VECTOR_GRPC_PORT,
headers: {
'X-Contextual-Api-Key': process.env.CONTEXTUALAI_API_KEY!,
'X-Openai-Api-Key': process.env.OPENAI_APIKEY!,
Expand Down
24 changes: 18 additions & 6 deletions test/collections/integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@ import weaviate, {
VectorIndexConfigHNSW,
WeaviateClient,
} from '../../src/index';
import {
TEST_CLUSTER_HOST,
TEST_CLUSTER_REST_PORT,
TEST_GRPC_PORT,
TEST_HOST,
TEST_REST_PORT,
TEST_VECTOR_HOST,
TEST_VECTOR_REST_PORT,
} from '../env';

describe('Testing of the collections.create method', () => {
let cluster: WeaviateClient;
Expand All @@ -19,16 +28,19 @@ describe('Testing of the collections.create method', () => {

beforeAll(async () => {
cluster = await weaviate.connectToLocal({
port: 8087,
grpcPort: 50051,
host: TEST_CLUSTER_HOST,
port: TEST_CLUSTER_REST_PORT,
grpcPort: TEST_GRPC_PORT,
});
contextionary = await weaviate.connectToLocal({
port: 8080,
grpcPort: 50051,
host: TEST_HOST,
port: TEST_REST_PORT,
grpcPort: TEST_GRPC_PORT,
});
openai = await weaviate.connectToLocal({
port: 8086,
grpcPort: 50051,
host: TEST_VECTOR_HOST,
port: TEST_VECTOR_REST_PORT,
grpcPort: TEST_GRPC_PORT,
});
});

Expand Down
7 changes: 6 additions & 1 deletion test/collections/iterator/integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/* eslint-disable @typescript-eslint/no-non-null-asserted-optional-chain */
import { afterAll, beforeAll, describe, expect, it } from 'vitest';
import weaviate, { Collection, WeaviateClient } from '../../../src/index.js';
import { TEST_GRPC_PORT, TEST_HOST, TEST_REST_PORT } from '../../env.js';

describe('Testing of the collection.iterator method with a simple collection', () => {
let client: WeaviateClient;
Expand All @@ -22,7 +23,11 @@ describe('Testing of the collection.iterator method with a simple collection', (
});

beforeAll(async () => {
client = await weaviate.connectToLocal({ port: 8080, grpcPort: 50051 });
client = await weaviate.connectToLocal({
host: TEST_HOST,
port: TEST_REST_PORT,
grpcPort: TEST_GRPC_PORT,
});
collection = client.collections.use(collectionName);
id = await client.collections
.create({
Expand Down
Loading
Loading