Skip to content

Commit

Permalink
Merge pull request #669 from meilisearch/bug/flaky-tests
Browse files Browse the repository at this point in the history
Update phpunit migration & embedders test flaky test
  • Loading branch information
brunoocasali authored Aug 26, 2024
2 parents 211fd30 + c144b96 commit fdacdc5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 27 deletions.
38 changes: 15 additions & 23 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,25 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.1/phpunit.xsd"
bootstrap="vendor/autoload.php"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
stopOnFailure="false"
cacheResult="false"
colors="true">
<testsuites>
<testsuite name="Tests">
<directory suffix="Test.php">./tests</directory>
</testsuite>
</testsuites>
<coverage>
<include>
<directory>src/</directory>
</include>
</coverage>
<php>
<env name="MEILISEARCH_URL" value="http://localhost:7700"/>
<env name="MEILISEARCH_API_KEY" value="masterKey"/>
</php>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" bootstrap="vendor/autoload.php" stopOnFailure="false" cacheResult="false" colors="true" cacheDirectory=".phpunit.cache">
<testsuites>
<testsuite name="Tests">
<directory suffix="Test.php">./tests</directory>
</testsuite>
</testsuites>
<php>
<env name="MEILISEARCH_URL" value="http://localhost:7700"/>
<env name="MEILISEARCH_API_KEY" value="masterKey"/>
</php>
<source>
<include>
<directory>src/</directory>
</include>
</source>
</phpunit>
8 changes: 4 additions & 4 deletions tests/Settings/EmbeddersTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function testUpdateEmbeddersWithOpenAi(): void
$promise = $index->updateEmbedders(['myEmbedder' => $embedderConfig]);

$this->assertIsValidPromise($promise);
$index->waitForTask($promise['taskUid']);
$index->waitForTask($promise['taskUid'], 10000);

$embedders = $index->getEmbedders();
$embedderConfig['apiKey'] = '<yoXXXXX...';
Expand All @@ -58,7 +58,7 @@ public function testUpdateEmbeddersWithUserProvided(): void
$promise = $index->updateEmbedders(['myEmbedder' => $embedderConfig]);

$this->assertIsValidPromise($promise);
$index->waitForTask($promise['taskUid']);
$index->waitForTask($promise['taskUid'], 10000);

$embedders = $index->getEmbedders();

Expand Down Expand Up @@ -95,11 +95,11 @@ public function testResetEmbedders(): void

$promise = $index->updateEmbedders(['myEmbedder' => $embedderConfig]);
$this->assertIsValidPromise($promise);
$index->waitForTask($promise['taskUid']);
$index->waitForTask($promise['taskUid'], 10000);

$promise = $index->resetEmbedders();
$this->assertIsValidPromise($promise);
$index->waitForTask($promise['taskUid']);
$index->waitForTask($promise['taskUid'], 10000);

self::assertEmpty($index->getEmbedders());
}
Expand Down

0 comments on commit fdacdc5

Please sign in to comment.