Skip to content
This repository has been archived by the owner on Apr 18, 2019. It is now read-only.

Commit

Permalink
Merge pull request #8 from Financial-Times/fix/healthcheck-severity
Browse files Browse the repository at this point in the history
Reduced healthcheck severity to 2. Tests don't pass yet.
  • Loading branch information
kovacshuni committed Mar 5, 2018
2 parents 397d96f + b3a5f45 commit b2dd79a
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 29 deletions.
4 changes: 2 additions & 2 deletions handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"time"

fthealth "github.com/Financial-Times/go-fthealth/v1_1"
log "github.com/sirupsen/logrus"
"github.com/Financial-Times/service-status-go/gtg"
log "github.com/sirupsen/logrus"
)

const (
Expand All @@ -32,7 +32,7 @@ func (hh *httpHandlers) HealthCheck() fthealth.Check {
BusinessImpact: "Unable to respond to Public Six Degrees",
Name: "Check connectivity to Neo4j - neoUrl is a parameter in hieradata for this service",
PanicGuide: "https://dewey.ft.com/public-six-degrees-api.html",
Severity: 1,
Severity: 3,
TechnicalSummary: `Cannot connect to Neo4j. If this check fails, check that Neo4j instance is up and running.`,
Checker: hh.Checker,
}
Expand Down
54 changes: 27 additions & 27 deletions handlers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,20 +331,20 @@ func TestCheckConnectivity(t *testing.T) {

testSuccessResponse := fthealth.HealthResult{
SchemaVersion: 1,
SystemCode: "public-six-degrees-api",
Name: "Public Six Degrees API",
Description: "Six Degrees Backend provides mostMentionedPeople and connectedPeople endpoints for Six Degrees Frontend.",
Ok: true,
SystemCode: "public-six-degrees-api",
Name: "Public Six Degrees API",
Description: "Six Degrees Backend provides mostMentionedPeople and connectedPeople endpoints for Six Degrees Frontend.",
Ok: true,
Checks: []fthealth.CheckResult{
{
Name: "Check connectivity to Neo4j - neoUrl is a parameter in hieradata for this service",
Ok: true,
Severity: 1,
BusinessImpact: "Unable to respond to Public Six Degrees",
PanicGuide: "https://dewey.ft.com/public-six-degrees-api.html",
Name: "Check connectivity to Neo4j - neoUrl is a parameter in hieradata for this service",
Ok: true,
Severity: 3,
BusinessImpact: "Unable to respond to Public Six Degrees",
PanicGuide: "https://dewey.ft.com/public-six-degrees-api.html",
TechnicalSummary: "Cannot connect to Neo4j. If this check fails, check that Neo4j instance is up and running. You can find\n\t\t\t\tthe neoUrl as a parameter in hieradata for this service.",
CheckOutput: "Connectivity to neo4j is ok",
LastUpdated: testSuccessTime,
CheckOutput: "Connectivity to neo4j is ok",
LastUpdated: testSuccessTime,
},
},
}
Expand All @@ -354,21 +354,21 @@ func TestCheckConnectivity(t *testing.T) {

testErrorResponse := fthealth.HealthResult{
SchemaVersion: 1,
SystemCode: "public-six-degrees-api",
Name: "Public Six Degrees API",
Description: "Six Degrees Backend provides mostMentionedPeople and connectedPeople endpoints for Six Degrees Frontend.",
Ok: false,
Severity: 1,
SystemCode: "public-six-degrees-api",
Name: "Public Six Degrees API",
Description: "Six Degrees Backend provides mostMentionedPeople and connectedPeople endpoints for Six Degrees Frontend.",
Ok: false,
Severity: 3,
Checks: []fthealth.CheckResult{
{
Name: "Check connectivity to Neo4j - neoUrl is a parameter in hieradata for this service",
Ok: false,
Severity: 1,
BusinessImpact: "Unable to respond to Public Six Degrees",
PanicGuide: "https://dewey.ft.com/public-six-degrees-api.html",
Name: "Check connectivity to Neo4j - neoUrl is a parameter in hieradata for this service",
Ok: false,
Severity: 3,
BusinessImpact: "Unable to respond to Public Six Degrees",
PanicGuide: "https://dewey.ft.com/public-six-degrees-api.html",
TechnicalSummary: "Cannot connect to Neo4j. If this check fails, check that Neo4j instance is up and running. You can find\n\t\t\t\tthe neoUrl as a parameter in hieradata for this service.",
CheckOutput: "Error connecting to neo4j",
LastUpdated: testErrorTime,
CheckOutput: "Error connecting to neo4j",
LastUpdated: testErrorTime,
},
},
}
Expand All @@ -391,7 +391,7 @@ func TestCheckConnectivity(t *testing.T) {
driver: &dummyDriver{shouldFail: true},
statusCode: http.StatusOK,
contentType: "",
body: string(testErrorResponseStr),
body: string(testErrorResponseStr),
},
}

Expand All @@ -403,10 +403,10 @@ func TestCheckConnectivity(t *testing.T) {

timedHC := fthealth.TimedHealthCheck{
HealthCheck: fthealth.HealthCheck{
SystemCode: "public-six-degrees-api",
Name: "Public Six Degrees API",
SystemCode: "public-six-degrees-api",
Name: "Public Six Degrees API",
Description: "Six Degrees Backend provides mostMentionedPeople and connectedPeople endpoints for Six Degrees Frontend.",
Checks: []fthealth.Check{httpHandler.HealthCheck()},
Checks: []fthealth.Check{httpHandler.HealthCheck()},
},
Timeout: 10 * time.Second,
}
Expand Down

0 comments on commit b2dd79a

Please sign in to comment.