diff --git a/lib/manager/bazel/update.js b/lib/manager/bazel/update.js index 28093dc779e0166febdc051a4ad4b8311b397c6e..c5f8aad28d0dd759a5df9d88e2776189d9eef507 100644 --- a/lib/manager/bazel/update.js +++ b/lib/manager/bazel/update.js @@ -1,5 +1,5 @@ const crypto = require('crypto'); -const got = require('got'); +const got = require('../../util/got'); module.exports = { updateDependency, @@ -37,8 +37,6 @@ async function updateDependency(fileContent, upgrade) { }/${shortRepo}-${upgrade.newValue}.tar.gz`; file = (await got(newUrl, { encoding: null, - // TODO: Move to configurable host rules, or use utils/got - timeout: 60 * 1000, })).body; } catch (err) { logger.debug( diff --git a/lib/manager/gradle-wrapper/update.js b/lib/manager/gradle-wrapper/update.js index 77a42696ebea91d1014b828570c306b3e0222c21..171e604cb3597cdca79e9a53d863714e8c7804bb 100644 --- a/lib/manager/gradle-wrapper/update.js +++ b/lib/manager/gradle-wrapper/update.js @@ -1,4 +1,4 @@ -const got = require('got'); +const got = require('../../util/got'); module.exports = { updateDependency, @@ -38,10 +38,7 @@ function replaceType(url) { async function getChecksum(url) { try { - const response = await got(url, { - // TODO: Move to configurable host rules, or use utils/got - timeout: 60 * 1000, - }); + const response = await got(url); return response.body; } catch (err) { if (err.statusCode === 404 || err.code === 'ENOTFOUND') { diff --git a/lib/manager/homebrew/update.js b/lib/manager/homebrew/update.js index b5519e6e765cbf09e8e6add7bcf1a8e6b59c4d8f..f5f8d69e941a569846226a995ad20ae21450d28f 100644 --- a/lib/manager/homebrew/update.js +++ b/lib/manager/homebrew/update.js @@ -1,8 +1,8 @@ -const got = require('got'); const crypto = require('crypto'); const { coerce } = require('semver'); const { parseUrlPath } = require('./extract'); const { skip, isSpace, removeComments } = require('./util'); +const got = require('../../util/got'); module.exports = { updateDependency, @@ -36,8 +36,6 @@ async function updateDependency(content, upgrade) { )}.tar.gz`; file = (await got(newUrl, { encoding: null, - // TODO: Move to configurable host rules, or use utils/got - timeout: 60 * 1000, })).body; } catch (errOuter) { logger.debug( diff --git a/test/manager/bazel/update.spec.js b/test/manager/bazel/update.spec.js index da781a8a842a60d08907207443435c8fd5987f52..e5397778b7f326961c8ff9b8733a3235cfe17faf 100644 --- a/test/manager/bazel/update.spec.js +++ b/test/manager/bazel/update.spec.js @@ -1,9 +1,9 @@ const fs = require('fs'); const path = require('path'); -const got = require('got'); +const got = require('../../../lib/util/got'); const bazelfile = require('../../../lib/manager/bazel/update'); -jest.mock('got'); +jest.mock('../../../lib/util/got'); const content = fs.readFileSync( path.resolve('test/manager/bazel/_fixtures/WORKSPACE1'), @@ -93,7 +93,7 @@ describe('manager/bazel/update', () => { res.includes('"aaa09d789f3dba190787f8b4454c7d3c936fe123", # v1.0.3') ).toBe(true); }); - it('updates http archive', async () => { + it('updates WORKSPACE http archive', async () => { const upgrade = { depName: 'io_bazel_rules_go', depType: 'http_archive', diff --git a/test/manager/gradle-wrapper/update.spec.js b/test/manager/gradle-wrapper/update.spec.js index fa3029b4a4923d1c63d23075aa8a291842af1a8e..5b9367181c5a2843f1f9dd3336fde190a65b187e 100644 --- a/test/manager/gradle-wrapper/update.spec.js +++ b/test/manager/gradle-wrapper/update.spec.js @@ -1,8 +1,8 @@ const fs = require('fs'); -const got = require('got'); +const got = require('../../../lib/util/got'); const dcUpdate = require('../../../lib/manager/gradle-wrapper/update'); -jest.mock('got'); +jest.mock('../../../lib/util/got'); const propertiesFile2 = fs.readFileSync( 'test/datasource/gradle-wrapper/_fixtures/gradle-wrapper-2.properties', diff --git a/test/manager/homebrew/update.spec.js b/test/manager/homebrew/update.spec.js index 6a3b39894fea38de21d18a2dc13a41f437dd36ab..43655ea298792886d0a82adfbdfb53508cd0d6e1 100644 --- a/test/manager/homebrew/update.spec.js +++ b/test/manager/homebrew/update.spec.js @@ -1,8 +1,8 @@ -const got = require('got'); const fs = require('fs'); +const got = require('../../../lib/util/got'); const { updateDependency } = require('../../../lib/manager/homebrew/update'); -jest.mock('got'); +jest.mock('../../../lib/util/got'); const aide = fs.readFileSync('test/manager/homebrew/_fixtures/aide.rb', 'utf8'); const ibazel = fs.readFileSync(