mirror of
https://github.com/gotenberg/gotenberg.git
synced 2026-08-08 00:22:14 +01:00
122 lines
5.2 KiB
Gherkin
122 lines
5.2 KiB
Gherkin
# TODO:
|
|
# 1. Check if down for each module.
|
|
# 2. Restarting modules do not make health check fail.
|
|
|
|
@health
|
|
Feature: /health
|
|
|
|
Scenario: GET /health
|
|
Given I have a default Gotenberg container
|
|
When I make a "GET" request to Gotenberg at the "/health" endpoint
|
|
Then the response status code should be 200
|
|
Then the response header "Content-Type" should be "application/json; charset=utf-8"
|
|
Then the response body should match JSON:
|
|
"""
|
|
{
|
|
"status": "up",
|
|
"details": {
|
|
"chromium": {
|
|
"status": "up",
|
|
"timestamp": "ignore"
|
|
},
|
|
"libreoffice": {
|
|
"status": "up",
|
|
"timestamp": "ignore"
|
|
}
|
|
}
|
|
}
|
|
"""
|
|
Then the Gotenberg container should log the following entries:
|
|
| "path":"/health" |
|
|
|
|
@telemetry
|
|
Scenario: GET /health (Telemetry)
|
|
Given I have a default Gotenberg container
|
|
When I make a "GET" request to Gotenberg at the "/health" endpoint with the following header(s):
|
|
| X-Correlation-ID | get_health |
|
|
| traceparent | 00-12345678901234567890123456789012-1234567890123456-01 |
|
|
Then the response status code should be 200
|
|
Then the response header "X-Correlation-ID" should be "get_health"
|
|
Then the Gotenberg container should log the following entries:
|
|
| "correlation_id":"get_health" |
|
|
| "trace_id":"12345678901234567890123456789012" |
|
|
|
|
@telemetry
|
|
Scenario: GET /health (No Telemetry)
|
|
Given I have a Gotenberg container with the following environment variable(s):
|
|
| API_DISABLE_HEALTH_CHECK_ROUTE_TELEMETRY | true |
|
|
When I make a "GET" request to Gotenberg at the "/health" endpoint with the following header(s):
|
|
| X-Correlation-ID | get_health_no_telemetry |
|
|
| traceparent | 00-12345678901234567890123456789012-1234567890123456-01 |
|
|
Then the response status code should be 200
|
|
Then the Gotenberg container should NOT log the following entries:
|
|
| "correlation_id":"get_health_no_telemetry" |
|
|
| "trace_id":"12345678901234567890123456789012" |
|
|
|
|
Scenario: GET /health (Basic Auth)
|
|
Given I have a Gotenberg container with the following environment variable(s):
|
|
| API_ENABLE_BASIC_AUTH | true |
|
|
| GOTENBERG_API_BASIC_AUTH_USERNAME | foo |
|
|
| GOTENBERG_API_BASIC_AUTH_PASSWORD | bar |
|
|
When I make a "GET" request to Gotenberg at the "/health" endpoint
|
|
Then the response status code should be 200
|
|
|
|
Scenario: GET /foo/health (Root Path)
|
|
Given I have a Gotenberg container with the following environment variable(s):
|
|
| API_ROOT_PATH | /foo/ |
|
|
When I make a "GET" request to Gotenberg at the "/foo/health" endpoint
|
|
Then the response status code should be 200
|
|
|
|
Scenario: HEAD /health
|
|
Given I have a default Gotenberg container
|
|
When I make a "HEAD" request to Gotenberg at the "/health" endpoint
|
|
Then the response status code should be 200
|
|
Then the response body should match string:
|
|
"""
|
|
|
|
"""
|
|
Then the Gotenberg container should log the following entries:
|
|
| "path":"/health" |
|
|
|
|
@telemetry
|
|
Scenario: HEAD /health (Telemetry)
|
|
Given I have a default Gotenberg container
|
|
When I make a "HEAD" request to Gotenberg at the "/health" endpoint with the following header(s):
|
|
| X-Correlation-ID | head_health |
|
|
| traceparent | 00-12345678901234567890123456789012-1234567890123456-01 |
|
|
Then the response status code should be 200
|
|
Then the response header "X-Correlation-ID" should be "head_health"
|
|
Then the Gotenberg container should log the following entries:
|
|
| "correlation_id":"head_health" |
|
|
| "trace_id":"12345678901234567890123456789012" |
|
|
|
|
@telemetry
|
|
Scenario: HEAD /health (No Telemetry)
|
|
Given I have a Gotenberg container with the following environment variable(s):
|
|
| API_DISABLE_HEALTH_CHECK_ROUTE_TELEMETRY | true |
|
|
When I make a "HEAD" request to Gotenberg at the "/health" endpoint with the following header(s):
|
|
| X-Correlation-ID | head_health_no_telemetry |
|
|
| traceparent | 00-12345678901234567890123456789012-1234567890123456-01 |
|
|
Then the response status code should be 200
|
|
Then the Gotenberg container should NOT log the following entries:
|
|
| "correlation_id":"head_health_no_telemetry" |
|
|
| "trace_id":"12345678901234567890123456789012" |
|
|
|
|
Scenario: HEAD /health (Basic Auth)
|
|
Given I have a Gotenberg container with the following environment variable(s):
|
|
| API_ENABLE_BASIC_AUTH | true |
|
|
| GOTENBERG_API_BASIC_AUTH_USERNAME | foo |
|
|
| GOTENBERG_API_BASIC_AUTH_PASSWORD | bar |
|
|
When I make a "HEAD" request to Gotenberg at the "/health" endpoint
|
|
Then the response status code should be 200
|
|
|
|
Scenario: HEAD /foo/health (Root Path)
|
|
Given I have a Gotenberg container with the following environment variable(s):
|
|
| API_ROOT_PATH | /foo/ |
|
|
When I make a "HEAD" request to Gotenberg at the "/foo/health" endpoint
|
|
Then the response status code should be 200
|
|
|
|
|
|
# TODO:
|
|
# 1. Check if down for each module.
|
|
# 2. Restarting modules do not make health check fail. |