diff --git a/spec/ci-spec.coffee b/spec/ci-spec.coffee index 2eb0ecdc..53b1fb5f 100644 --- a/spec/ci-spec.coffee +++ b/spec/ci-spec.coffee @@ -6,6 +6,7 @@ express = require 'express' wrench = require 'wrench' CSON = require 'season' apm = require '../lib/apm-cli' +nodeVersion = require('./config.json').nodeVersion describe 'apm ci', -> [atomHome, resourcePath, server] = [] @@ -23,16 +24,14 @@ describe 'apm ci', -> delete process.env.npm_config_cache app = express() - app.get '/node/v10.20.1/node-v10.20.1.tar.gz', (request, response) -> - response.sendFile path.join(__dirname, 'fixtures', 'node-v10.20.1.tar.gz') - app.get '/node/v10.20.1/node-v10.20.1-headers.tar.gz', (request, response) -> - response.sendFile path.join(__dirname, 'fixtures', 'node-v10.20.1-headers.tar.gz') - app.get '/node/v10.20.1/node.lib', (request, response) -> - response.sendFile path.join(__dirname, 'fixtures', 'node.lib') - app.get '/node/v10.20.1/x64/node.lib', (request, response) -> - response.sendFile path.join(__dirname, 'fixtures', 'node_x64.lib') - app.get '/node/v10.20.1/SHASUMS256.txt', (request, response) -> - response.sendFile path.join(__dirname, 'fixtures', 'SHASUMS256.txt') + app.get "/node/#{nodeVersion}/node-#{nodeVersion}-headers.tar.gz", (request, response) -> + response.sendFile path.join(__dirname, 'fixtures', 'node-dist', "node-#{nodeVersion}-headers.tar.gz") + app.get "/node/#{nodeVersion}/win-x86/node.lib", (request, response) -> + response.sendFile path.join(__dirname, 'fixtures', 'node-dist', 'node.lib') + app.get "/node/#{nodeVersion}/win-x64/node.lib", (request, response) -> + response.sendFile path.join(__dirname, 'fixtures', 'node-dist', 'node_x64.lib') + app.get "/node/#{nodeVersion}/SHASUMS256.txt", (request, response) -> + response.sendFile path.join(__dirname, 'fixtures', 'node-dist', 'SHASUMS256.txt') app.get '/test-module-with-dependencies', (request, response) -> response.sendFile path.join(__dirname, 'fixtures', 'install-locked-version.json') app.get '/test-module', (request, response) -> @@ -52,7 +51,7 @@ describe 'apm ci', -> server.listen 3000, '127.0.0.1', -> process.env.ATOM_ELECTRON_URL = "http://localhost:3000/node" process.env.ATOM_PACKAGES_URL = "http://localhost:3000/packages" - process.env.ATOM_ELECTRON_VERSION = 'v10.20.1' + process.env.ATOM_ELECTRON_VERSION = nodeVersion process.env.npm_config_registry = 'http://localhost:3000/' live = true waitsFor -> live diff --git a/spec/clean-spec.coffee b/spec/clean-spec.coffee index c9946461..3159ee98 100644 --- a/spec/clean-spec.coffee +++ b/spec/clean-spec.coffee @@ -5,6 +5,7 @@ express = require 'express' http = require 'http' wrench = require 'wrench' apm = require '../lib/apm-cli' +nodeVersion = require('./config.json').nodeVersion describe 'apm clean', -> [moduleDirectory, server] = [] @@ -15,16 +16,14 @@ describe 'apm clean', -> app = express() - app.get '/node/v10.20.1/node-v10.20.1.tar.gz', (request, response) -> - response.sendFile path.join(__dirname, 'fixtures', 'node-v10.20.1.tar.gz') - app.get '/node/v10.20.1/node-v10.20.1-headers.tar.gz', (request, response) -> - response.sendFile path.join(__dirname, 'fixtures', 'node-v10.20.1-headers.tar.gz') - app.get '/node/v10.20.1/node.lib', (request, response) -> - response.sendFile path.join(__dirname, 'fixtures', 'node.lib') - app.get '/node/v10.20.1/x64/node.lib', (request, response) -> - response.sendFile path.join(__dirname, 'fixtures', 'node_x64.lib') - app.get '/node/v10.20.1/SHASUMS256.txt', (request, response) -> - response.sendFile path.join(__dirname, 'fixtures', 'SHASUMS256.txt') + app.get "/node/#{nodeVersion}/node-#{nodeVersion}-headers.tar.gz", (request, response) -> + response.sendFile path.join(__dirname, 'fixtures', 'node-dist', "node-#{nodeVersion}-headers.tar.gz") + app.get "/node/#{nodeVersion}/win-x86/node.lib", (request, response) -> + response.sendFile path.join(__dirname, 'fixtures', 'node-dist', 'node.lib') + app.get "/node/#{nodeVersion}/win-x64/node.lib", (request, response) -> + response.sendFile path.join(__dirname, 'fixtures', 'node-dist', 'node_x64.lib') + app.get "/node/#{nodeVersion}/SHASUMS256.txt", (request, response) -> + response.sendFile path.join(__dirname, 'fixtures', 'node-dist', 'SHASUMS256.txt') app.get '/test-module', (request, response) -> response.sendFile path.join(__dirname, 'fixtures', 'install-test-module.json') app.get '/tarball/test-module-1.2.0.tgz', (request, response) -> @@ -38,7 +37,7 @@ describe 'apm clean', -> atomHome = temp.mkdirSync('apm-home-dir-') process.env.ATOM_HOME = atomHome process.env.ATOM_ELECTRON_URL = "http://localhost:3000/node" - process.env.ATOM_ELECTRON_VERSION = 'v10.20.1' + process.env.ATOM_ELECTRON_VERSION = nodeVersion process.env.npm_config_registry = 'http://localhost:3000/' moduleDirectory = path.join(temp.mkdirSync('apm-test-module-'), 'test-module-with-dependencies') diff --git a/spec/config.json b/spec/config.json new file mode 100644 index 00000000..b2f6541f --- /dev/null +++ b/spec/config.json @@ -0,0 +1,4 @@ +{ + "nodeVersion": "v12.2.3", + "node-version-comment": "Note: This 'nodeVersion' string is used by various spec files. Update it to match, if/when the related (Node dist) fixture files (node[...]headers.tar.gz, node[_x64].lib, and SHASUMS256.txt) are updated for a new Node or Electron version." +} diff --git a/spec/fixtures/SHASUMS256.txt b/spec/fixtures/SHASUMS256.txt deleted file mode 100644 index ee71e09b..00000000 --- a/spec/fixtures/SHASUMS256.txt +++ /dev/null @@ -1,4 +0,0 @@ -f2777bf2b140033c01d5f912df510dfa394e748f92bbaed24c832abf36cb3bdf ./node-v10.20.1-headers.tar.gz -ea39a70b715bfbd0281979c95a5b81136ffdc0e5bf66b1fd7dc3ef3473ce2c5a ./node-v10.20.1.tar.gz -213d72051a68c37afc37a5d185a4c5bfacc985bc35331024e5f28635f084da70 ./x64/node.lib -e5224f36cf5ae52ee8532e383142073fd6c28866745e9967992de28cfbf5b63a ./node.lib diff --git a/spec/fixtures/node-dist/SHASUMS256.txt b/spec/fixtures/node-dist/SHASUMS256.txt new file mode 100644 index 00000000..3b646e0f --- /dev/null +++ b/spec/fixtures/node-dist/SHASUMS256.txt @@ -0,0 +1,13 @@ +092a039e403f758f542a0f801acac8604e2d7a9b63d8f3c8c31df71c7ba8aac5 node-v12.2.3.tar.gz +092a039e403f758f542a0f801acac8604e2d7a9b63d8f3c8c31df71c7ba8aac5 node-v12.2.3-headers.tar.gz +092a039e403f758f542a0f801acac8604e2d7a9b63d8f3c8c31df71c7ba8aac5 iojs-v12.2.3.tar.gz +092a039e403f758f542a0f801acac8604e2d7a9b63d8f3c8c31df71c7ba8aac5 iojs-v12.2.3-headers.tar.gz +4c59ee4f9b78dfdd904cc211080acbbc485104d467c29df24bf45c4017ef638e node.lib +248a81dd4d5cdaf8c0497a4f6c6855c1e2db3e0439757bfed4f2c1e3c530d04e x64/node.lib +4c59ee4f9b78dfdd904cc211080acbbc485104d467c29df24bf45c4017ef638e win-x86/iojs.lib +248a81dd4d5cdaf8c0497a4f6c6855c1e2db3e0439757bfed4f2c1e3c530d04e win-x64/iojs.lib +4c59ee4f9b78dfdd904cc211080acbbc485104d467c29df24bf45c4017ef638e win-x86/node.lib +248a81dd4d5cdaf8c0497a4f6c6855c1e2db3e0439757bfed4f2c1e3c530d04e win-x64/node.lib +8552821153af0eb55643f9c370ca35b1e5427c06ca51cd81c53db98d28af9494 arm64/node.lib +8552821153af0eb55643f9c370ca35b1e5427c06ca51cd81c53db98d28af9494 win-arm64/iojs.lib +8552821153af0eb55643f9c370ca35b1e5427c06ca51cd81c53db98d28af9494 win-arm64/node.lib diff --git a/spec/fixtures/node-dist/node-v12.2.3-headers.tar.gz b/spec/fixtures/node-dist/node-v12.2.3-headers.tar.gz new file mode 100644 index 00000000..dda35902 Binary files /dev/null and b/spec/fixtures/node-dist/node-v12.2.3-headers.tar.gz differ diff --git a/spec/fixtures/node-dist/node.lib b/spec/fixtures/node-dist/node.lib new file mode 100644 index 00000000..759fdbf4 Binary files /dev/null and b/spec/fixtures/node-dist/node.lib differ diff --git a/spec/fixtures/node-dist/node_x64.lib b/spec/fixtures/node-dist/node_x64.lib new file mode 100644 index 00000000..87906c16 Binary files /dev/null and b/spec/fixtures/node-dist/node_x64.lib differ diff --git a/spec/fixtures/node-v10.20.1-headers.tar.gz b/spec/fixtures/node-v10.20.1-headers.tar.gz deleted file mode 100644 index 20dfb4fe..00000000 Binary files a/spec/fixtures/node-v10.20.1-headers.tar.gz and /dev/null differ diff --git a/spec/fixtures/node-v10.20.1.tar.gz b/spec/fixtures/node-v10.20.1.tar.gz deleted file mode 100644 index 7a2745cc..00000000 Binary files a/spec/fixtures/node-v10.20.1.tar.gz and /dev/null differ diff --git a/spec/fixtures/node.lib b/spec/fixtures/node.lib deleted file mode 100644 index a153bb31..00000000 Binary files a/spec/fixtures/node.lib and /dev/null differ diff --git a/spec/fixtures/node_x64.lib b/spec/fixtures/node_x64.lib deleted file mode 100644 index f0dcd463..00000000 Binary files a/spec/fixtures/node_x64.lib and /dev/null differ diff --git a/spec/install-spec.coffee b/spec/install-spec.coffee index 480e2d5f..f630682c 100644 --- a/spec/install-spec.coffee +++ b/spec/install-spec.coffee @@ -7,6 +7,7 @@ http = require 'http' wrench = require 'wrench' apm = require '../lib/apm-cli' Install = require '../lib/install' +nodeVersion = require('./config.json').nodeVersion describe 'apm install', -> [atomHome, resourcePath] = [] @@ -29,16 +30,14 @@ describe 'apm install', -> beforeEach -> app = express() - app.get '/node/v10.20.1/node-v10.20.1.tar.gz', (request, response) -> - response.sendFile path.join(__dirname, 'fixtures', 'node-v10.20.1.tar.gz') - app.get '/node/v10.20.1/node-v10.20.1-headers.tar.gz', (request, response) -> - response.sendFile path.join(__dirname, 'fixtures', 'node-v10.20.1-headers.tar.gz') - app.get '/node/v10.20.1/node.lib', (request, response) -> - response.sendFile path.join(__dirname, 'fixtures', 'node.lib') - app.get '/node/v10.20.1/x64/node.lib', (request, response) -> - response.sendFile path.join(__dirname, 'fixtures', 'node_x64.lib') - app.get '/node/v10.20.1/SHASUMS256.txt', (request, response) -> - response.sendFile path.join(__dirname, 'fixtures', 'SHASUMS256.txt') + app.get "/node/#{nodeVersion}/node-#{nodeVersion}-headers.tar.gz", (request, response) -> + response.sendFile path.join(__dirname, 'fixtures', 'node-dist', "node-#{nodeVersion}-headers.tar.gz") + app.get "/node/#{nodeVersion}/win-x86/node.lib", (request, response) -> + response.sendFile path.join(__dirname, 'fixtures', 'node-dist', 'node.lib') + app.get "/node/#{nodeVersion}/win-x64/node.lib", (request, response) -> + response.sendFile path.join(__dirname, 'fixtures', 'node-dist', 'node_x64.lib') + app.get "/node/#{nodeVersion}/SHASUMS256.txt", (request, response) -> + response.sendFile path.join(__dirname, 'fixtures', 'node-dist', 'SHASUMS256.txt') app.get '/test-module', (request, response) -> response.sendFile path.join(__dirname, 'fixtures', 'install-test-module.json') app.get '/tarball/test-module-1.1.0.tgz', (request, response) -> @@ -78,7 +77,7 @@ describe 'apm install', -> process.env.ATOM_HOME = atomHome process.env.ATOM_ELECTRON_URL = "http://localhost:3000/node" process.env.ATOM_PACKAGES_URL = "http://localhost:3000/packages" - process.env.ATOM_ELECTRON_VERSION = 'v10.20.1' + process.env.ATOM_ELECTRON_VERSION = nodeVersion process.env.npm_config_registry = 'http://localhost:3000/' live = true waitsFor -> live diff --git a/spec/rebuild-spec.coffee b/spec/rebuild-spec.coffee index f006fcb0..cec78de1 100644 --- a/spec/rebuild-spec.coffee +++ b/spec/rebuild-spec.coffee @@ -6,6 +6,7 @@ express = require 'express' http = require 'http' wrench = require 'wrench' apm = require '../lib/apm-cli' +nodeVersion = require('./config.json').nodeVersion describe 'apm rebuild', -> [server, originalPathEnv] = [] @@ -15,16 +16,14 @@ describe 'apm rebuild', -> silenceOutput() app = express() - app.get '/node/v10.20.1/node-v10.20.1.tar.gz', (request, response) -> - response.sendFile path.join(__dirname, 'fixtures', 'node-v10.20.1.tar.gz') - app.get '/node/v10.20.1/node-v10.20.1-headers.tar.gz', (request, response) -> - response.sendFile path.join(__dirname, 'fixtures', 'node-v10.20.1-headers.tar.gz') - app.get '/node/v10.20.1/node.lib', (request, response) -> - response.sendFile path.join(__dirname, 'fixtures', 'node.lib') - app.get '/node/v10.20.1/x64/node.lib', (request, response) -> - response.sendFile path.join(__dirname, 'fixtures', 'node_x64.lib') - app.get '/node/v10.20.1/SHASUMS256.txt', (request, response) -> - response.sendFile path.join(__dirname, 'fixtures', 'SHASUMS256.txt') + app.get "/node/#{nodeVersion}/node-#{nodeVersion}-headers.tar.gz", (request, response) -> + response.sendFile path.join(__dirname, 'fixtures', 'node-dist', "node-#{nodeVersion}-headers.tar.gz") + app.get "/node/#{nodeVersion}/win-x86/node.lib", (request, response) -> + response.sendFile path.join(__dirname, 'fixtures', 'node-dist', 'node.lib') + app.get "/node/#{nodeVersion}/win-x64/node.lib", (request, response) -> + response.sendFile path.join(__dirname, 'fixtures', 'node-dist', 'node_x64.lib') + app.get "/node/#{nodeVersion}/SHASUMS256.txt", (request, response) -> + response.sendFile path.join(__dirname, 'fixtures', 'node-dist', 'SHASUMS256.txt') server = http.createServer(app) @@ -34,7 +33,7 @@ describe 'apm rebuild', -> process.env.ATOM_HOME = atomHome process.env.ATOM_ELECTRON_URL = "http://localhost:3000/node" process.env.ATOM_PACKAGES_URL = "http://localhost:3000/packages" - process.env.ATOM_ELECTRON_VERSION = 'v10.20.1' + process.env.ATOM_ELECTRON_VERSION = nodeVersion process.env.ATOM_RESOURCE_PATH = temp.mkdirSync('atom-resource-path-') originalPathEnv = process.env.PATH diff --git a/spec/stars-spec.coffee b/spec/stars-spec.coffee index 6b84e3e2..e295dd3a 100644 --- a/spec/stars-spec.coffee +++ b/spec/stars-spec.coffee @@ -4,6 +4,7 @@ fs = require 'fs-plus' http = require 'http' temp = require 'temp' apm = require '../lib/apm-cli' +nodeVersion = require('./config.json').nodeVersion describe 'apm stars', -> [atomHome, server] = [] @@ -17,16 +18,14 @@ describe 'apm stars', -> response.sendFile path.join(__dirname, 'fixtures', 'available.json') app.get '/users/hubot/stars', (request, response) -> response.sendFile path.join(__dirname, 'fixtures', 'stars.json') - app.get '/node/v10.20.1/node-v10.20.1.tar.gz', (request, response) -> - response.sendFile path.join(__dirname, 'fixtures', 'node-v10.20.1.tar.gz') - app.get '/node/v10.20.1/node-v10.20.1-headers.tar.gz', (request, response) -> - response.sendFile path.join(__dirname, 'fixtures', 'node-v10.20.1-headers.tar.gz') - app.get '/node/v10.20.1/node.lib', (request, response) -> - response.sendFile path.join(__dirname, 'fixtures', 'node.lib') - app.get '/node/v10.20.1/x64/node.lib', (request, response) -> - response.sendFile path.join(__dirname, 'fixtures', 'node_x64.lib') - app.get '/node/v10.20.1/SHASUMS256.txt', (request, response) -> - response.sendFile path.join(__dirname, 'fixtures', 'SHASUMS256.txt') + app.get "/node/#{nodeVersion}/node-#{nodeVersion}-headers.tar.gz", (request, response) -> + response.sendFile path.join(__dirname, 'fixtures', 'node-dist', "node-#{nodeVersion}-headers.tar.gz") + app.get "/node/#{nodeVersion}/win-x86/node.lib", (request, response) -> + response.sendFile path.join(__dirname, 'fixtures', 'node-dist', 'node.lib') + app.get "/node/#{nodeVersion}/win-x64/node.lib", (request, response) -> + response.sendFile path.join(__dirname, 'fixtures', 'node-dist', 'node_x64.lib') + app.get "/node/#{nodeVersion}/SHASUMS256.txt", (request, response) -> + response.sendFile path.join(__dirname, 'fixtures', 'node-dist', 'SHASUMS256.txt') app.get '/tarball/test-module-1.2.0.tgz', (request, response) -> response.sendFile path.join(__dirname, 'fixtures', 'test-module-1.2.0.tgz') app.get '/tarball/test-module2-2.0.0.tgz', (request, response) -> @@ -43,7 +42,7 @@ describe 'apm stars', -> process.env.ATOM_API_URL = "http://localhost:3000" process.env.ATOM_ELECTRON_URL = "http://localhost:3000/node" process.env.ATOM_PACKAGES_URL = "http://localhost:3000/packages" - process.env.ATOM_ELECTRON_VERSION = 'v10.20.1' + process.env.ATOM_ELECTRON_VERSION = nodeVersion process.env.npm_config_registry = 'http://localhost:3000/' live = true diff --git a/spec/upgrade-spec.coffee b/spec/upgrade-spec.coffee index 90a8e016..83483b6c 100644 --- a/spec/upgrade-spec.coffee +++ b/spec/upgrade-spec.coffee @@ -5,6 +5,7 @@ express = require 'express' http = require 'http' wrench = require 'wrench' apm = require '../lib/apm-cli' +nodeVersion = require('./config.json').nodeVersion apmRun = (args, callback) -> ran = false @@ -39,7 +40,7 @@ describe "apm upgrade", -> process.env.ATOM_HOME = atomHome process.env.ATOM_ELECTRON_URL = "http://localhost:3000/node" process.env.ATOM_PACKAGES_URL = "http://localhost:3000/packages" - process.env.ATOM_ELECTRON_VERSION = 'v10.20.1' + process.env.ATOM_ELECTRON_VERSION = nodeVersion process.env.ATOM_RESOURCE_PATH = atomApp fs.writeFileSync(path.join(atomApp, 'package.json'), JSON.stringify(version: '0.10.0'))