Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PCBC-994 Support for base64 encoded vector types #169

Merged
Changes from 1 commit
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
Prev Previous commit
fix test
Matt-Woz committed Jun 3, 2024

Verified

This commit was signed with the committer’s verified signature.
Matt-Woz Mateusz
commit 609d3bf668c125b460d9740bc601d619b112c8af
4 changes: 2 additions & 2 deletions tests/SearchTest.php
Original file line number Diff line number Diff line change
@@ -204,7 +204,7 @@
}


public function testSearchWithConsistency()

Check failure on line 207 in tests/SearchTest.php

GitHub Actions / server_linux_x86_64 (8.3, nts, 7.0.5)

/home/runner/work/couchbase-php-client/couchbase-php-client/tests/SearchTest.php.testSearchWithConsistency

SearchTest::testSearchWithConsistency Exception: Excepted rows to not to be empty

Check failure on line 207 in tests/SearchTest.php

GitHub Actions / server_linux_x86_64 (8.3, zts, 7.6.0)

/home/runner/work/couchbase-php-client/couchbase-php-client/tests/SearchTest.php.testSearchWithConsistency

SearchTest::testSearchWithConsistency Couchbase\Exception\AmbiguousTimeoutException: ambiguous_timeout (13): "unable to execute HTTP operation "search_query""

Check failure on line 207 in tests/SearchTest.php

GitHub Actions / server_linux_x86_64 (8.3, zts, 7.0.5)

/home/runner/work/couchbase-php-client/couchbase-php-client/tests/SearchTest.php.testSearchWithConsistency

SearchTest::testSearchWithConsistency Exception: Excepted rows to not to be empty
{
$this->skipIfCaves();

@@ -392,7 +392,7 @@
}
}

public function testCompoundSearchQueries()

Check failure on line 395 in tests/SearchTest.php

GitHub Actions / server_linux_x86_64 (8.3, zts, 7.6.0)

/home/runner/work/couchbase-php-client/couchbase-php-client/tests/SearchTest.php.testCompoundSearchQueries

SearchTest::testCompoundSearchQueries Failed asserting that 6 is equal to 10 or is greater than 10.
{
$this->skipIfCaves();

@@ -431,7 +431,7 @@
);
}

public function testSearchWithFragments()

Check failure on line 434 in tests/SearchTest.php

GitHub Actions / server_linux_x86_64 (8.3, zts, 7.6.0)

/home/runner/work/couchbase-php-client/couchbase-php-client/tests/SearchTest.php.testSearchWithFragments

SearchTest::testSearchWithFragments Failed asserting that 'Samuel Adams Hallertau Imperial Pilsner' matches PCRE pattern "/<mark>/".
{
$this->skipIfCaves();

@@ -453,7 +453,7 @@
}
}

public function testSearchWithFacets()

Check failure on line 456 in tests/SearchTest.php

GitHub Actions / server_linux_x86_64 (8.3, nts, 7.0.5)

/home/runner/work/couchbase-php-client/couchbase-php-client/tests/SearchTest.php.testSearchWithFacets

SearchTest::testSearchWithFacets Failed asserting that 9 is equal to 10 or is greater than 10.

Check failure on line 456 in tests/SearchTest.php

GitHub Actions / server_linux_x86_64 (8.3, zts, 7.6.0)

/home/runner/work/couchbase-php-client/couchbase-php-client/tests/SearchTest.php.testSearchWithFacets

SearchTest::testSearchWithFacets Failed asserting that 8 is equal to 10 or is greater than 10.
{
$this->skipIfCaves();

@@ -605,13 +605,13 @@

public function testVectorSearchEncodingWithBase64()
{
$base64EncodedVector = base64_encode('[0.32, -0.536, 0.842]');
$base64EncodedVector = "aOeYBEXJ4kI=";
$vectorQueryOne = VectorQuery::build("foo", $base64EncodedVector)->boost(0.5)->numCandidates(4);
$vectorQueryTwo = VectorQuery::build("bar", [-0.00810353, 0.6433, 0.52364]);
$searchRequest = SearchRequest::export(SearchRequest::build(VectorSearch::build([$vectorQueryOne, $vectorQueryTwo])));
$encodedVectorQuery = json_encode($searchRequest['vectorSearch']);
$this->assertEquals(JSON_ERROR_NONE, json_last_error());
$this->assertEquals("[{\"field\":\"foo\",\"boost\":0.5,\"vector_base64\":\"{$base64EncodedVector}\",\"k\":4},{\"field\":\"bar\",\"vector\":[-0.00810353,0.6433,0.52364],\"k\":3}]", $encodedVectorQuery);
$this->assertEquals(sprintf('[{"field":"foo","boost":0.5,"vector_base64":"%s","k":4},{"field":"bar","vector":[-0.00810353,0.6433,0.52364],"k":3}]', $base64EncodedVector), $encodedVectorQuery);
}

public function testScopeSearch()

Unchanged files with check annotations Beta

$this->manager->createScope($scopeName);
}
public function testCreateScopeAndGetAllScopes(): void

Check failure on line 42 in tests/CollectionManagerTest.php

GitHub Actions / server_linux_x86_64 (8.3, nts, 7.2.4)

/home/runner/work/couchbase-php-client/couchbase-php-client/tests/CollectionManagerTest.php.testCreateScopeAndGetAllScopes

CollectionManagerTest::testCreateScopeAndGetAllScopes Failed asserting that false is true.
{
$scopeName = $this->uniqueId("scope");
$this->manager->createScope($scopeName);
$this->assertTrue($found);
}
public function testDropScopes(): void

Check failure on line 57 in tests/CollectionManagerTest.php

GitHub Actions / server_linux_x86_64 (8.3, nts, 7.1.6)

/home/runner/work/couchbase-php-client/couchbase-php-client/tests/CollectionManagerTest.php.testDropScopes

CollectionManagerTest::testDropScopes Failed asserting that true is false.
{
$scopeName = $this->uniqueId("scope");
$this->manager->createScope($scopeName);
$this->manager->createCollection($collectionSpec);
}
public function testDropCollectionNotExistsDeprecatedApi(): void

Check failure on line 126 in tests/CollectionManagerTest.php

GitHub Actions / server_linux_x86_64 (8.3, nts, 7.0.5)

/home/runner/work/couchbase-php-client/couchbase-php-client/tests/CollectionManagerTest.php.testDropCollectionNotExistsDeprecatedApi

CollectionManagerTest::testDropCollectionNotExistsDeprecatedApi Failed asserting that exception of type "Couchbase\Exception\ScopeNotFoundException" matches expected exception "Couchbase\Exception\CollectionNotFoundException". Message was: "scope_not_found (16): "unable to execute HTTP operation "collection_drop"", errors={"_":"Scope with name \"scope_c08b9f2851e10104c83cc013b7045bbe\" is not found"}" at
{
$this->skipIfCaves();
$this->manager->dropCollection($collectionSpec);
}
public function testDropCollectionDeprecatedApi(): void

Check failure on line 138 in tests/CollectionManagerTest.php

GitHub Actions / server_linux_x86_64 (8.3, nts, 7.6.0)

/home/runner/work/couchbase-php-client/couchbase-php-client/tests/CollectionManagerTest.php.testDropCollectionDeprecatedApi

CollectionManagerTest::testDropCollectionDeprecatedApi Failed asserting that false is true.

Check failure on line 138 in tests/CollectionManagerTest.php

GitHub Actions / server_linux_x86_64 (8.3, nts, 7.0.5)

/home/runner/work/couchbase-php-client/couchbase-php-client/tests/CollectionManagerTest.php.testDropCollectionDeprecatedApi

CollectionManagerTest::testDropCollectionDeprecatedApi Failed asserting that false is true.

Check failure on line 138 in tests/CollectionManagerTest.php

GitHub Actions / server_linux_x86_64 (8.3, zts, 7.1.6)

/home/runner/work/couchbase-php-client/couchbase-php-client/tests/CollectionManagerTest.php.testDropCollectionDeprecatedApi

CollectionManagerTest::testDropCollectionDeprecatedApi Failed asserting that false is true.
{
$collectionName = $this->uniqueId("collection");
$scopeName = $this->uniqueId("scope");
);
}
public function testSubdocumentLookupAnyReplicaCanFetchExpiry()

Check failure on line 119 in tests/KeyValueLookupInTest.php

GitHub Actions / server_linux_x86_64 (8.3, nts, 7.6.0)

/home/runner/work/couchbase-php-client/couchbase-php-client/tests/KeyValueLookupInTest.php.testSubdocumentLookupAnyReplicaCanFetchExpiry

KeyValueLookupInTest::testSubdocumentLookupAnyReplicaCanFetchExpiry null does not match expected type "object".

Check failure on line 119 in tests/KeyValueLookupInTest.php

GitHub Actions / server_linux_x86_64 (8.3, zts, 7.6.0)

/home/runner/work/couchbase-php-client/couchbase-php-client/tests/KeyValueLookupInTest.php.testSubdocumentLookupAnyReplicaCanFetchExpiry

KeyValueLookupInTest::testSubdocumentLookupAnyReplicaCanFetchExpiry null does not match expected type "object".
{
$this->skipIfUnsupported($this->version()->supportsSubdocReadReplica());
$this->skipIfReplicasAreNotConfigured();
}
}
public function testGroups()

Check failure on line 107 in tests/UserManagerTest.php

GitHub Actions / server_linux_x86_64 (8.3, nts, 7.6.0)

/home/runner/work/couchbase-php-client/couchbase-php-client/tests/UserManagerTest.php.testGroups

UserManagerTest::testGroups Couchbase\Exception\GroupNotFoundException: group_not_found (604): "unable to execute HTTP operation "group_get""
{
$this->skipIfCaves();
$groupName = $this->uniqueId('test');
}
}
public function testCreateCouchbaseBucket()

Check failure on line 38 in tests/BucketManagerTest.php

GitHub Actions / server_linux_x86_64 (8.3, nts, 7.1.6)

/home/runner/work/couchbase-php-client/couchbase-php-client/tests/BucketManagerTest.php.testCreateCouchbaseBucket

BucketManagerTest::testCreateCouchbaseBucket Couchbase\Exception\BucketNotFoundException: bucket_not_found (10): "unable to execute HTTP operation "bucket_get""
{
$settings = new BucketSettings($this->bucketName);
$settings->setBucketType(BucketType::COUCHBASE);
$this->assertEquals(BucketType::COUCHBASE, $result->bucketType());
}
public function testCreateMemcachedBucket()

Check failure on line 49 in tests/BucketManagerTest.php

GitHub Actions / server_linux_x86_64 (8.3, nts, 7.1.6)

/home/runner/work/couchbase-php-client/couchbase-php-client/tests/BucketManagerTest.php.testCreateMemcachedBucket

BucketManagerTest::testCreateMemcachedBucket Couchbase\Exception\BucketNotFoundException: bucket_not_found (10): "unable to execute HTTP operation "bucket_get""

Check failure on line 49 in tests/BucketManagerTest.php

GitHub Actions / server_linux_x86_64 (8.3, zts, 7.1.6)

/home/runner/work/couchbase-php-client/couchbase-php-client/tests/BucketManagerTest.php.testCreateMemcachedBucket

BucketManagerTest::testCreateMemcachedBucket Couchbase\Exception\BucketNotFoundException: bucket_not_found (10): "unable to execute HTTP operation "bucket_get""
{
$this->skipIfProtostellar();
$settings = new BucketSettings($this->bucketName);
$this->assertEquals(BucketType::EPHEMERAL, $result->bucketType());
}
public function testDropBucket()

Check failure on line 72 in tests/BucketManagerTest.php

GitHub Actions / server_linux_x86_64 (8.3, nts, 7.2.4)

/home/runner/work/couchbase-php-client/couchbase-php-client/tests/BucketManagerTest.php.testDropBucket

BucketManagerTest::testDropBucket Couchbase\Exception\BucketNotFoundException: bucket_not_found (10): "unable to execute HTTP operation "bucket_drop""

Check failure on line 72 in tests/BucketManagerTest.php

GitHub Actions / server_linux_x86_64 (8.3, nts, 7.1.6)

/home/runner/work/couchbase-php-client/couchbase-php-client/tests/BucketManagerTest.php.testDropBucket

BucketManagerTest::testDropBucket Couchbase\Exception\BucketNotFoundException: bucket_not_found (10): "unable to execute HTTP operation "bucket_drop""

Check failure on line 72 in tests/BucketManagerTest.php

GitHub Actions / server_linux_x86_64 (8.3, zts, 7.1.6)

/home/runner/work/couchbase-php-client/couchbase-php-client/tests/BucketManagerTest.php.testDropBucket

BucketManagerTest::testDropBucket Couchbase\Exception\BucketNotFoundException: bucket_not_found (10): "unable to execute HTTP operation "bucket_drop""
{
$bucketName = $this->uniqueId('bucket');
$settings = new BucketSettings($bucketName);
$this->manager->flush($this->bucketName);
}
public function testCreateBucketFlushNotEnabled()

Check failure on line 131 in tests/BucketManagerTest.php

GitHub Actions / server_linux_x86_64 (8.3, nts, 7.2.4)

/home/runner/work/couchbase-php-client/couchbase-php-client/tests/BucketManagerTest.php.testCreateBucketFlushNotEnabled

BucketManagerTest::testCreateBucketFlushNotEnabled Couchbase\Exception\BucketNotFoundException: bucket_not_found (10): "unable to execute HTTP operation "bucket_get""

Check failure on line 131 in tests/BucketManagerTest.php

GitHub Actions / server_linux_x86_64 (8.3, zts, 7.1.6)

/home/runner/work/couchbase-php-client/couchbase-php-client/tests/BucketManagerTest.php.testCreateBucketFlushNotEnabled

BucketManagerTest::testCreateBucketFlushNotEnabled Couchbase\Exception\BucketNotFoundException: bucket_not_found (10): "unable to execute HTTP operation "bucket_get""
{
$this->skipIfProtostellar();
$this->assertTrue($result->replicaIndexes());
}
public function testCouchbaseBucketEvictionPolicy()

Check failure on line 168 in tests/BucketManagerTest.php

GitHub Actions / server_linux_x86_64 (8.3, nts, 7.0.5)

/home/runner/work/couchbase-php-client/couchbase-php-client/tests/BucketManagerTest.php.testCouchbaseBucketEvictionPolicy

BucketManagerTest::testCouchbaseBucketEvictionPolicy Failed asserting that two strings are equal.

Check failure on line 168 in tests/BucketManagerTest.php

GitHub Actions / server_linux_x86_64 (8.3, zts, 7.1.6)

/home/runner/work/couchbase-php-client/couchbase-php-client/tests/BucketManagerTest.php.testCouchbaseBucketEvictionPolicy

BucketManagerTest::testCouchbaseBucketEvictionPolicy Couchbase\Exception\BucketNotFoundException: bucket_not_found (10): "unable to execute HTTP operation "bucket_get""
{
$this->skipIfCaves();
$this->assertEquals(EvictionPolicy::VALUE_ONLY, $result->evictionPolicy());
}
public function testEphemeralBucketEvictionPolicyNoEviction()

Check failure on line 185 in tests/BucketManagerTest.php

GitHub Actions / server_linux_x86_64 (8.3, zts, 7.6.0)

/home/runner/work/couchbase-php-client/couchbase-php-client/tests/BucketManagerTest.php.testEphemeralBucketEvictionPolicyNoEviction

BucketManagerTest::testEphemeralBucketEvictionPolicyNoEviction Couchbase\Exception\BucketNotFoundException: bucket_not_found (10): "unable to execute HTTP operation "bucket_get""

Check failure on line 185 in tests/BucketManagerTest.php

GitHub Actions / server_linux_x86_64 (8.3, zts, 7.2.4)

/home/runner/work/couchbase-php-client/couchbase-php-client/tests/BucketManagerTest.php.testEphemeralBucketEvictionPolicyNoEviction

BucketManagerTest::testEphemeralBucketEvictionPolicyNoEviction Couchbase\Exception\BucketNotFoundException: bucket_not_found (10): "unable to execute HTTP operation "bucket_get""
{
$this->skipIfCaves();
$this->assertEquals(EvictionPolicy::NOT_RECENTLY_USED, $result->evictionPolicy());
}
public function testCreateBucketStorageBackendCouchstore()

Check failure on line 209 in tests/BucketManagerTest.php

GitHub Actions / server_linux_x86_64 (8.3, zts, 7.6.0)

/home/runner/work/couchbase-php-client/couchbase-php-client/tests/BucketManagerTest.php.testCreateBucketStorageBackendCouchstore

BucketManagerTest::testCreateBucketStorageBackendCouchstore Couchbase\Exception\BucketNotFoundException: bucket_not_found (10): "unable to execute HTTP operation "bucket_get""

Check failure on line 209 in tests/BucketManagerTest.php

GitHub Actions / server_linux_x86_64 (8.3, zts, 7.1.6)

/home/runner/work/couchbase-php-client/couchbase-php-client/tests/BucketManagerTest.php.testCreateBucketStorageBackendCouchstore

BucketManagerTest::testCreateBucketStorageBackendCouchstore Couchbase\Exception\BucketNotFoundException: bucket_not_found (10): "unable to execute HTTP operation "bucket_get""
{
$this->skipIfCaves();
$this->skipIfUnsupported($this->version()->supportsMagmaStorageBackend());
$this->assertEquals(StorageBackend::COUCHSTORE, $result->storageBackend());
}
public function testCreateBucketStorageBackendMagma()

Check failure on line 222 in tests/BucketManagerTest.php

GitHub Actions / server_linux_x86_64 (8.3, zts, 7.1.6)

/home/runner/work/couchbase-php-client/couchbase-php-client/tests/BucketManagerTest.php.testCreateBucketStorageBackendMagma

BucketManagerTest::testCreateBucketStorageBackendMagma Couchbase\Exception\InvalidArgumentException: invalid_argument (3): "unable to execute HTTP operation "bucket_create"", errors={"ramQuota":"RAM quota specified is too large to be provisioned into this cluster."}
{
$this->skipIfCaves();
$this->skipIfUnsupported($this->version()->supportsMagmaStorageBackend());
$this->assertEquals(10, $result->maxExpiry());
}
public function testBucketCompressionMode()

Check failure on line 266 in tests/BucketManagerTest.php

GitHub Actions / server_linux_x86_64 (8.3, nts, 7.2.4)

/home/runner/work/couchbase-php-client/couchbase-php-client/tests/BucketManagerTest.php.testBucketCompressionMode

BucketManagerTest::testBucketCompressionMode Failed asserting that two strings are equal.

Check failure on line 266 in tests/BucketManagerTest.php

GitHub Actions / server_linux_x86_64 (8.3, zts, 7.2.4)

/home/runner/work/couchbase-php-client/couchbase-php-client/tests/BucketManagerTest.php.testBucketCompressionMode

BucketManagerTest::testBucketCompressionMode Couchbase\Exception\BucketNotFoundException: bucket_not_found (10): "unable to execute HTTP operation "bucket_get""

Check failure on line 266 in tests/BucketManagerTest.php

GitHub Actions / server_linux_x86_64 (8.3, zts, 7.1.6)

/home/runner/work/couchbase-php-client/couchbase-php-client/tests/BucketManagerTest.php.testBucketCompressionMode

BucketManagerTest::testBucketCompressionMode Couchbase\Exception\BucketNotFoundException: bucket_not_found (10): "unable to execute HTTP operation "bucket_get""
{
$this->skipIfCaves();
$this->assertEquals(CompressionMode::ACTIVE, $result->compressionMode());
}
public function testBucketDurabilityLevel()

Check failure on line 290 in tests/BucketManagerTest.php

GitHub Actions / server_linux_x86_64 (8.3, nts, 7.1.6)

/home/runner/work/couchbase-php-client/couchbase-php-client/tests/BucketManagerTest.php.testBucketDurabilityLevel

BucketManagerTest::testBucketDurabilityLevel Failed asserting that two strings are equal.
{
$this->skipIfCaves();
$this->skipIfUnsupported($this->version()->supportsMinimumDurabilityLevel());
$this->assertEquals(ConflictResolutionType::SEQUENCE_NUMBER, $result->conflictResolutionType());
}
public function testCreateBucketConflictResolutionTimestamp()

Check failure on line 333 in tests/BucketManagerTest.php

GitHub Actions / server_linux_x86_64 (8.3, nts, 7.2.4)

/home/runner/work/couchbase-php-client/couchbase-php-client/tests/BucketManagerTest.php.testCreateBucketConflictResolutionTimestamp

BucketManagerTest::testCreateBucketConflictResolutionTimestamp Couchbase\Exception\BucketNotFoundException: bucket_not_found (10): "unable to execute HTTP operation "bucket_get""
{
$this->skipIfCaves();
$this->assertEquals(13000, $result->historyRetentionDuration());
}
public function testUpdateHistory()

Check failure on line 376 in tests/BucketManagerTest.php

GitHub Actions / server_linux_x86_64 (8.3, zts, 7.6.0)

/home/runner/work/couchbase-php-client/couchbase-php-client/tests/BucketManagerTest.php.testUpdateHistory

BucketManagerTest::testUpdateHistory Couchbase\Exception\BucketNotFoundException: bucket_not_found (10): "unable to execute HTTP operation "bucket_get""
{
$this->skipIfCaves();
$this->skipIfProtostellar();
$this->cluster = $this->connectCluster();
}
public function testConsistency()

Check failure on line 23 in tests/ViewTest.php

GitHub Actions / server_linux_x86_64 (8.3, nts, 7.0.5)

/home/runner/work/couchbase-php-client/couchbase-php-client/tests/ViewTest.php.testConsistency

ViewTest::testConsistency Couchbase\Exception\AmbiguousTimeoutException: ambiguous_timeout (13): "unable to execute HTTP operation "view_query""

Check failure on line 23 in tests/ViewTest.php

GitHub Actions / server_linux_x86_64 (8.3, zts, 7.0.5)

/home/runner/work/couchbase-php-client/couchbase-php-client/tests/ViewTest.php.testConsistency

ViewTest::testConsistency Couchbase\Exception\AmbiguousTimeoutException: ambiguous_timeout (13): "unable to execute HTTP operation "view_query""
{
$this->skipIfCaves();
// TODO: drop design doc.
}
public function testGrouping()

Check failure on line 62 in tests/ViewTest.php

GitHub Actions / server_linux_x86_64 (8.3, nts, 7.0.5)

/home/runner/work/couchbase-php-client/couchbase-php-client/tests/ViewTest.php.testGrouping

ViewTest::testGrouping Couchbase\Exception\AmbiguousTimeoutException: ambiguous_timeout (13): "unable to execute HTTP operation "view_query""

Check failure on line 62 in tests/ViewTest.php

GitHub Actions / server_linux_x86_64 (8.3, zts, 7.0.5)

/home/runner/work/couchbase-php-client/couchbase-php-client/tests/ViewTest.php.testGrouping

ViewTest::testGrouping Couchbase\Exception\AmbiguousTimeoutException: ambiguous_timeout (13): "unable to execute HTTP operation "view_query""
{
$this->skipIfCaves();
}
}
public function testQueryIndexesCrud()

Check failure on line 47 in tests/QueryIndexManagerTest.php

GitHub Actions / server_linux_x86_64 (8.3, zts, 7.6.0)

/home/runner/work/couchbase-php-client/couchbase-php-client/tests/QueryIndexManagerTest.php.testQueryIndexesCrud

QueryIndexManagerTest::testQueryIndexesCrud timed out waiting for create index to succeed
{
$this->skipIfCaves();