Skip to content

Commit

Permalink
Add healthy check to the smoke test for the service.
Browse files Browse the repository at this point in the history
Side effect being that all 3rd party dependencies of the service must be working for a successful deployment.
  • Loading branch information
cooperaj committed Jul 12, 2024
1 parent 01ac1a7 commit ef1c98a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tests/features/check-service-status.feature
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Feature: Check status of the service
Scenario: I want to check the service health
Given I fetch the healthcheck endpoint
Then I see JSON output
And it contains a "overall_healthy" key/value pair
And the service is declared healthy

@smoke
Scenario: I want to discover the service version
Expand Down
11 changes: 11 additions & 0 deletions tests/smoke/context/CommonContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,17 @@ public function iSeeJsonOutput(): void
$this->responseJson = $this->assertJsonResponse();
}

/**
* @Then the service is declared healthy
*/
public function theServiceIsDeclaredHealthy(): void
{
$this->responseJson = $this->assertJsonResponse();

$this->itContainsAKeyValuePair('overall_healthy');
Assert::assertTrue($this->responseJson['overall_healthy']);
}

/**
* @Then it contains a :key key\/value pair
*/
Expand Down

0 comments on commit ef1c98a

Please sign in to comment.