Commit aa8f09e0 authored by Hunter Loftis's avatar Hunter Loftis

test and implementation to detect un-downloadable binaries

parent bc0bcf73
## Upcoming
- Fix runtime signature cache invalidation
- Provide error messaging for un-downloadable binaries
## v77
......
......@@ -18,7 +18,8 @@ install_nodejs() {
echo "Downloading and installing node $version..."
local download_url="http://s3pository.heroku.com/node/v$version/node-v$version-$os-$cpu.tar.gz"
curl "$download_url" -s -o - | tar xzf - -C /tmp
curl "$download_url" --silent --fail -o /tmp/node.tar.gz || (echo "Unable to download node $version; does it exist?" && false)
tar xzf /tmp/node.tar.gz -C /tmp
mv /tmp/node-v$version-$os-$cpu/* $dir
chmod +x $dir/bin/*
}
......@@ -34,7 +35,8 @@ install_iojs() {
echo "Downloading and installing iojs $version..."
local download_url="https://iojs.org/dist/v$version/iojs-v$version-$os-$cpu.tar.gz"
curl $download_url -s -o - | tar xzf - -C /tmp
curl "$download_url" --silent --fail -o /tmp/node.tar.gz || (echo "Unable to download iojs $version; does it exist?" && false)
tar xzf /tmp/node.tar.gz -C /tmp
mv /tmp/iojs-v$version-$os-$cpu/* $dir
chmod +x $dir/bin/*
}
......
......@@ -6,7 +6,9 @@
"type" : "git",
"url" : "http://github.com/example/example.git"
},
"dependencies": {
},
"engines": {
"node": ">2.0"
"iojs": "2.0.99"
}
}
A fake README, to keep npm from polluting stderr.
\ No newline at end of file
{
"name": "node-buildpack-test-app",
"version": "0.0.1",
"description": "node buildpack integration test app",
"repository" : {
"type" : "git",
"url" : "http://github.com/example/example.git"
},
"dependencies": {
},
"engines": {
"node": "0.11.33"
}
}
#!/usr/bin/env bash
# See README.md for info on running these tests.
testInvalidNode() {
compile "invalid-node"
assertCaptured "Downloading and installing node 0.11.33"
assertCaptured "Unable to download node 0.11.33"
assertCapturedError
}
testInvalidIo() {
compile "invalid-io"
assertCaptured "Downloading and installing iojs 2.0.99"
assertCaptured "Unable to download iojs 2.0.99"
assertCapturedError
}
testBuildWithCache() {
cache=$(mktmpdir)
......
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