Skip to content

Commit

Permalink
rerun remaining
Browse files Browse the repository at this point in the history
  • Loading branch information
amrita-shrestha committed Jan 13, 2025
1 parent 39058dc commit 30ed7ba
Show file tree
Hide file tree
Showing 8 changed files with 210 additions and 130 deletions.
18 changes: 18 additions & 0 deletions tests/acceptance/TestHelpers/OcisConfigHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,22 @@ public static function startOcis(): ResponseInterface {
$url = self::getWrapperUrl() . "/start";
return self::sendRequest($url, "POST");
}

/**
* this method stops the running oCIS instance,
* restarts it while excluding specific services,
* and then starts the excluded services separately.
*
* @param string $service
*
* @return ResponseInterface
* @throws GuzzleException
*/
public static function startService(string $service): ResponseInterface {
$envs = [
"OCIS_LOG_LEVEL" => "info",
];
$url = self::getWrapperUrl() . "/services/" . $service;
return self::sendRequest($url, "POST", \json_encode($envs));
}
}
2 changes: 1 addition & 1 deletion tests/acceptance/bootstrap/FeatureContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ public static function logStep(BeforeStepScope $scope): void {
* NOTE: This method is called after each scenario having the @env-config tag
* This ensures that the server is running for clean-up purposes
*
* @AfterScenario @env-config
* @AfterScenario @backup-consistency
*
* @return void
*/
Expand Down
18 changes: 18 additions & 0 deletions tests/acceptance/bootstrap/OcisConfigContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,24 @@ public function theConfigHasBeenSetToValue(TableNode $table): void {
);
}

/**
* @Given the ocis server has served service :service separately
*
* @param string $service
*
* @return void
* @throws GuzzleException
*/
public function theOcisServerHasExcludedService(string $service) {
$response = OcisConfigHelper::startService($service);

Assert::assertEquals(
200,
$response->getStatusCode(),
"Failed to set config"
);
}

/**
* @AfterScenario @env-config
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ Feature: service health check
Then the HTTP status code of responses on all endpoints should be "200"

@issue-10661
Scenario: check default services readiness
Scenario: check default services readiness (graph, idp, proxy)
When a user requests these URLs with "GET" and no authentication
| endpoint | service |
| http://%base_url_hostname%:9124/readyz | graph |
Expand All @@ -122,7 +122,7 @@ Feature: service health check
Then the HTTP status code of responses on all endpoints should be "200"

@env-config @issue-10661
Scenario: check extra services readiness
Scenario: check auth-bearer service readiness
Given the following configs have been set:
| config | value |
| OCIS_ADD_RUN_SERVICES | auth-bearer |
Expand All @@ -131,3 +131,11 @@ Feature: service health check
| endpoint | service |
| http://%base_url_hostname%:9149/readyz | auth-bearer |
Then the HTTP status code of responses on all endpoints should be "200"

@env-config
Scenario: check services health while running separately
Given the ocis server has served service "storage-users" separately
When a user requests these URLs with "GET" and no authentication
| endpoint | service |
| http://%base_url_hostname%:9159/healthz | storage-users |
Then the HTTP status code of responses on all endpoints should be "200"
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@env-config
@env-config @backup-consistency
Feature: backup consistency
As a user
I want to check my data for inconsistencies
Expand Down Expand Up @@ -53,4 +53,4 @@ Feature: backup consistency
And the administrator has started the server
When user "Alice" gets the number of versions of file "/textfile0.txt"
Then the HTTP status code should be "207"
And the number of versions should be "2"
And the number of versions should be "2"
Loading

0 comments on commit 30ed7ba

Please sign in to comment.