Unverified Commit 8fa34723 authored by Jeremy Morrell's avatar Jeremy Morrell Committed by GitHub

Upgrade the Node Metrics plugin (#564)

Update to v3 of the node plugin
parent 9fa6f571
34990097468575e5a46d805a7cf4de471a29834f8c6f3513cd11c00b641654682e72adbab82bb15590643eb8203be45b294a912e28a0b7984a149fd0d4da4fd4 heroku-nodejs-plugin-node-10-v2.tar.gz
1af8d337d1bdbdbddd76a64e8d2a802729d26b4decfaf2b7cbc530c436575a31053b5cac5afc7b40e76ddb2fce5b6c96f3dc851dc0b6495693c5e3672f615675 heroku-nodejs-plugin-node-10-v3.tar.gz
29d68a7d6a41499c9d3f9d1ed5e56a827ae5dc3ce43ed55822cf1c6bdddbe1ba65fee3871c3f272414b39255e0a81538cae83f79e8899aef57095d02bdf2d401 heroku-nodejs-plugin-node-8-v2.tar.gz
314f894633ce4eb7aea2577a125cac9f08b3a53e46b8f4930f283603eaef0ff4fc08e8b3dc31c06d28383f9f24355b8bb1a8c6cac881d557fc25b6718ae204f7 heroku-nodejs-plugin-node-8-v3.tar.gz
2d0586809344cf1272cf2389df11df3d3398e6d75e86ce90447031d42d33c8d8c2ff60a7be9bb4fdbf7e557f91ce828f8d2db20aaf2d94458f6a6d5460041abf heroku-nodejs-plugin-node-9-v2.tar.gz
58ece877a2e0a9790a1e2c17936c2e9b224736015c5183a1e070ac4c08631bdcc131fb81db9b1d07a4819b946dd7cce1b1b7e2f7b512f350f81d1e69672bc009 heroku-nodejs-plugin-node-9-v3.tar.gz
require_relative '../spec_helper'
describe "Node metrics plugin should not fail other Node binaries" do
context "an app that runs the Heroku CLI with metrics" do
let(:app) {
Hatchet::Runner.new(
"spec/fixtures/repos/node-metrics-conflict",
buildpacks: [
Hatchet::App.default_buildpack,
"https://github.com/heroku/heroku-buildpack-cli"
],
config: {
"HEROKU_METRICS_URL" => "http://localhost:3000"
}
)
}
it "should not run within the heroku cli" do
app.deploy do |app|
data = successful_body(app)
expect(data).to include("not logged in")
expect(data).not_to include("was compiled against a different Node.js version")
end
end
end
end
{
"name": "node-metrics-test-app",
"version": "1.0.0",
"engines": {
"node": "8.x"
},
"main": "index.js",
"license": "MIT",
"devDependencies": {},
"dependencies": {}
}
#!/usr/bin/env node
const http = require('http');
const exec = require('child_process').exec;
const PORT = process.env.PORT || 5000;
const server = http.createServer((req, res) => {
/*
Note: we cannot use `heroku run` to test this since the metrics plugin is
disabled on run dynos
*/
exec('heroku whoami', (error, stdout, stderr) => {
res.statusCode = 200;
res.setHeader('Content-Type', 'text/plain');
res.end(stderr);
});
})
server.listen(PORT, () => console.log(`Listening on ${PORT}`));
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment