Merge pull request #11428 from owncloud/cli-search-flaky

[tests-only][full-ci] fix search reindexing cli tests
This commit is contained in:
Sawjan Gurung authored and GitHub committed 2025-06-16 10:07:55 +05:45
commit 379317b6fb
3 files changed
+21 -2

No files matched your search

+10
View File
@@ -53,6 +53,16 @@ class CliContext implements Context {
$this->spacesContext = BehatHelper::getContext($scope, $environment, 'SpacesContext');
}
/**
* @Given the administrator has cleaned the search service data
*
* @return void
*/
public function theAdministratorHasCleanedTheSearchServiceData(): void {
$dataPath = $this->featureContext->getOcisDataPath() . "/search";
\exec("rm -rf $dataPath");
}
/**
* @Given the administrator has stopped the server
*
@@ -731,8 +731,16 @@ class FeatureContext extends BehatVariablesContext {
/**
* @return string
*/
public function getStorageUsersRoot(): string {
public function getOcisDataPath(): string {
$ocisDataPath = getenv("OCIS_BASE_DATA_PATH") ? getenv("OCIS_BASE_DATA_PATH") : getenv("HOME") . '/.ocis';
return $ocisDataPath;
}
/**
* @return string
*/
public function getStorageUsersRoot(): string {
$ocisDataPath = $this->getOcisDataPath();
return getenv("STORAGE_USERS_OCIS_ROOT") ? getenv("STORAGE_USERS_OCIS_ROOT") : $ocisDataPath . "/storage/users";
}
@@ -5,7 +5,8 @@ Feature: reindex space via CLI command
So that I can improve search performance by ensuring that the index is up-to-date
Background:
Given user "Alice" has been created with default attributes
Given the administrator has cleaned the search service data
And user "Alice" has been created with default attributes
And using spaces DAV path
And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API
And user "Alice" has created a space "new-space" with the default quota using the Graph API