-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clarify API health checks and smoke tests (#332)
Resolves #116.
- Loading branch information
Showing
16 changed files
with
75 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'skuba': patch | ||
--- | ||
|
||
**template/\*-rest-api:** Explicitly register `listen.ts` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'skuba': patch | ||
--- | ||
|
||
**template/\*-rest-api:** Clarify health checks and smoke tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { Handler } from 'express'; | ||
|
||
/** | ||
* Signifies that the API is available to serve requests. | ||
* | ||
* The deployment environment calls this endpoint to see if the container is | ||
* unhealthy and needs to be recycled. | ||
*/ | ||
export const healthCheckHandler: Handler = (_req, res) => { | ||
res.send(''); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { Handler } from 'express'; | ||
|
||
/** | ||
* Tests connectivity to ensure appropriate access and network configuration. | ||
*/ | ||
export const smokeTestHandler: Handler = async (_req, res) => { | ||
await Promise.all([]); | ||
|
||
res.send(''); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
import './register'; | ||
|
||
import app from './app'; | ||
import { rootLogger } from './framework/logging'; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
import 'skuba-dive/register'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,11 @@ | ||
import { smokeTestJobStorage } from 'src/storage/jobs'; | ||
import { Middleware } from 'src/types/koa'; | ||
|
||
export const smokeTestHandler: Middleware = (ctx) => (ctx.body = ''); | ||
/** | ||
* Tests connectivity to ensure appropriate access and network configuration. | ||
*/ | ||
export const smokeTestHandler: Middleware = async (ctx) => { | ||
await Promise.all([smokeTestJobStorage]); | ||
|
||
ctx.body = ''; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
import 'skuba-dive/register'; | ||
import './register'; | ||
|
||
import { router } from 'src/api'; | ||
import { config } from 'src/config'; | ||
import { createApp } from 'src/framework/server'; | ||
import { router } from './api'; | ||
import { config } from './config'; | ||
import { createApp } from './framework/server'; | ||
|
||
const app = createApp(router.allowedMethods(), router.routes()); | ||
|
||
export default Object.assign(app, { port: config.port }); | ||
export default Object.assign(app, { | ||
port: config.port, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
import './register'; | ||
|
||
import app from './app'; | ||
import { rootLogger } from './framework/logging'; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
import 'skuba-dive/register'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters