Commit cf59592d authored by Hunter Loftis's avatar Hunter Loftis

test and implementation for detecting bower angular resolution failures

parent 8d2b627a
...@@ -37,6 +37,7 @@ source $BP_DIR/lib/dependencies.sh ...@@ -37,6 +37,7 @@ source $BP_DIR/lib/dependencies.sh
handle_failure() { handle_failure() {
header "Build failed" header "Build failed"
warn_untracked_dependencies "$LOG_FILE" warn_untracked_dependencies "$LOG_FILE"
warn_angular_resolution "$LOG_FILE"
failure_message | output "$LOG_FILE" failure_message | output "$LOG_FILE"
} }
trap 'handle_failure' ERR trap 'handle_failure' ERR
......
...@@ -71,10 +71,17 @@ warn_old_npm() { ...@@ -71,10 +71,17 @@ warn_old_npm() {
warn_untracked_dependencies() { warn_untracked_dependencies() {
local log_file="$1" local log_file="$1"
if grep -qi 'gulp: not found' "$log_file"; then if grep -qi 'gulp: not found' "$log_file"; then
warning "gulp may not be tracked in package.json" "https://devcenter.heroku.com/articles/troubleshooting-node-deploys#ensure-you-aren-t-relying-on-untracked-dependencies" warning "Gulp may not be tracked in package.json" "https://devcenter.heroku.com/articles/troubleshooting-node-deploys#ensure-you-aren-t-relying-on-untracked-dependencies"
elif grep -qi 'grunt: not found' "$log_file"; then elif grep -qi 'grunt: not found' "$log_file"; then
warning "grunt may not be tracked in package.json" "https://devcenter.heroku.com/articles/troubleshooting-node-deploys#ensure-you-aren-t-relying-on-untracked-dependencies" warning "Grunt may not be tracked in package.json" "https://devcenter.heroku.com/articles/troubleshooting-node-deploys#ensure-you-aren-t-relying-on-untracked-dependencies"
elif grep -qi 'bower: not found' "$log_file"; then elif grep -qi 'bower: not found' "$log_file"; then
warning "bower may not be tracked in package.json" "https://devcenter.heroku.com/articles/troubleshooting-node-deploys#ensure-you-aren-t-relying-on-untracked-dependencies" warning "Bower may not be tracked in package.json" "https://devcenter.heroku.com/articles/troubleshooting-node-deploys#ensure-you-aren-t-relying-on-untracked-dependencies"
fi
}
warn_angular_resolution() {
local log_file="$1"
if grep -qi 'Unable to find suitable version for angular' "$log_file"; then
warning "Bower may need a resolution hint for angular" "https://github.com/bower/bower/issues/1746"
fi fi
} }
{
"name": "bower-angular-resolution",
"version": "0.0.0",
"homepage": "https://github.com/heroku/heroku-buildpack-nodejs",
"authors": [
"Hunter Loftis <hunter@hunterloftis.com>"
],
"description": "",
"main": "",
"moduleType": [],
"license": "MIT",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"dependencies": {
"angular": "1.0.7",
"angular-ui-router": "0.2.15"
}
}
{
"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": {
"bower": "1.5.3"
},
"engines": {
"node": "4.1.1"
},
"scripts": {
"postinstall": "bower install"
}
}
#!/usr/bin/env bash #!/usr/bin/env bash
# See README.md for info on running these tests. # See README.md for info on running these tests.
testBowerAngularResolution() {
compile "bower-angular-resolution"
assertCaptured "Bower may need a resolution hint for angular"
assertCapturedError
}
testUntrackedDependencies() { testUntrackedDependencies() {
compile "missing-grunt" compile "missing-grunt"
assertCaptured "grunt may not be tracked in package.json" assertCaptured "Grunt may not be tracked in package.json"
assertCapturedError assertCapturedError
} }
......
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