increase [David] service test timeouts (#5966)

* tests: increase David service test timeouts

* tests: fix David not found tests
This commit is contained in:
Caleb Cartwright
2021-05-23 13:29:45 -05:00
committed by GitHub
parent 88b16a66e5
commit 9aa95d64c2
2 changed files with 10 additions and 2 deletions

View File

@@ -83,12 +83,12 @@ module.exports = class David extends BaseJsonService {
options: { qs: { path } },
errorMessages: {
/* note:
david returns a 500 response for 'not found'
david returns a 504 response for 'not found'
e.g: https://david-dm.org/foo/barbaz/info.json
not a 404 so we can't handle 'not found' cleanly
because this might also be some other error.
*/
500: 'repo or path not found or david internal error',
504: 'repo or path not found or david internal error',
},
})
}

View File

@@ -11,6 +11,7 @@ const isDependencyStatus = Joi.string().valid(
t.create('david dependencies (valid)')
.get('/expressjs/express.json')
.timeout(15000)
.expectBadge({
label: 'dependencies',
message: isDependencyStatus,
@@ -18,6 +19,7 @@ t.create('david dependencies (valid)')
t.create('david dev dependencies (valid)')
.get('/dev/expressjs/express.json')
.timeout(15000)
.expectBadge({
label: 'dev dependencies',
message: isDependencyStatus,
@@ -25,6 +27,7 @@ t.create('david dev dependencies (valid)')
t.create('david optional dependencies (valid)')
.get('/optional/elnounch/byebye.json')
.timeout(15000)
.expectBadge({
label: 'optional dependencies',
message: isDependencyStatus,
@@ -32,6 +35,7 @@ t.create('david optional dependencies (valid)')
t.create('david peer dependencies (valid)')
.get('/peer/webcomponents/generator-element.json')
.timeout(15000)
.expectBadge({
label: 'peer dependencies',
message: isDependencyStatus,
@@ -39,6 +43,7 @@ t.create('david peer dependencies (valid)')
t.create('david dependencies with path (valid)')
.get('/babel/babel.json?path=packages/babel-core')
.timeout(15000)
.expectBadge({
label: 'dependencies',
message: isDependencyStatus,
@@ -46,10 +51,12 @@ t.create('david dependencies with path (valid)')
t.create('david dependencies (none)')
.get('/peer/expressjs/express.json') // express does not specify peer dependencies
.timeout(15000)
.expectBadge({ label: 'peer dependencies', message: 'none' })
t.create('david dependencies (repo not found)')
.get('/pyvesb/emptyrepo.json')
.timeout(15000)
.expectBadge({
label: 'dependencies',
message: 'repo or path not found or david internal error',
@@ -57,6 +64,7 @@ t.create('david dependencies (repo not found)')
t.create('david dependencies (path not found')
.get('/babel/babel.json?path=invalid/path')
.timeout(15000)
.expectBadge({
label: 'dependencies',
message: 'repo or path not found or david internal error',