Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
H
heroku-buildpack-nodejs
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Python-Dev
heroku-buildpack-nodejs
Commits
db801a04
Commit
db801a04
authored
Jun 30, 2016
by
Hunter Loftis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test and implementation for no-start warnings
parent
6046385b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
47 additions
and
0 deletions
+47
-0
compile
bin/compile
+3
-0
failure.sh
lib/failure.sh
+20
-0
package.json
test/fixtures/no-start/package.json
+12
-0
package.json
test/fixtures/no-version/package.json
+3
-0
run
test/run
+9
-0
No files found.
bin/compile
View file @
db801a04
...
@@ -43,6 +43,7 @@ handle_failure() {
...
@@ -43,6 +43,7 @@ handle_failure() {
warn_untracked_dependencies
"
$LOG_FILE
"
warn_untracked_dependencies
"
$LOG_FILE
"
warn_angular_resolution
"
$LOG_FILE
"
warn_angular_resolution
"
$LOG_FILE
"
warn_missing_devdeps
"
$LOG_FILE
"
warn_missing_devdeps
"
$LOG_FILE
"
warn_no_start
"
$LOG_FILE
"
failure_message | output
"
$LOG_FILE
"
failure_message | output
"
$LOG_FILE
"
}
}
trap
'handle_failure'
ERR
trap
'handle_failure'
ERR
...
@@ -159,3 +160,5 @@ summarize_build() {
...
@@ -159,3 +160,5 @@ summarize_build() {
header
"Build succeeded!"
header
"Build succeeded!"
summarize_build | output
"
$LOG_FILE
"
summarize_build | output
"
$LOG_FILE
"
warn_no_start
"
$LOG_FILE
"
lib/failure.sh
View file @
db801a04
...
@@ -35,6 +35,14 @@ warning() {
...
@@ -35,6 +35,14 @@ warning() {
echo
""
>>
$warnings
echo
""
>>
$warnings
}
}
warn
()
{
local
tip
=
${
1
:-}
local
url
=
${
2
:-
https
://devcenter.heroku.com/articles/nodejs-support
}
echo
" !
$tip
"
||
true
echo
"
$url
"
||
true
echo
""
}
warn_node_engine
()
{
warn_node_engine
()
{
local
node_engine
=
${
1
:-}
local
node_engine
=
${
1
:-}
if
[
"
$node_engine
"
==
""
]
;
then
if
[
"
$node_engine
"
==
""
]
;
then
...
@@ -101,3 +109,15 @@ warn_missing_devdeps() {
...
@@ -101,3 +109,15 @@ warn_missing_devdeps() {
fi
fi
fi
fi
}
}
warn_no_start
()
{
local
log_file
=
"
$1
"
if
!
[
-e
"
$BUILD_DIR
/Procfile"
]
;
then
local
startScript
=
$(
read_json
"
$BUILD_DIR
/package.json"
".scripts.start"
)
if
[
"
$startScript
"
==
""
]
;
then
if
!
[
-e
"
$BUILD_DIR
/server.js"
]
;
then
warn
"This app may not specify any way to start a node process"
"https://devcenter.heroku.com/articles/nodejs-support#default-web-process-type"
fi
fi
fi
}
test/fixtures/no-start/package.json
0 → 100644
View file @
db801a04
{
"name"
:
"no-start"
,
"version"
:
"1.0.0"
,
"description"
:
""
,
"main"
:
"index.js"
,
"scripts"
:
{
},
"keywords"
:
[],
"author"
:
""
,
"license"
:
"ISC"
}
test/fixtures/no-version/package.json
View file @
db801a04
...
@@ -5,5 +5,8 @@
...
@@ -5,5 +5,8 @@
"repository"
:
{
"repository"
:
{
"type"
:
"git"
,
"type"
:
"git"
,
"url"
:
"http://github.com/example/example.git"
"url"
:
"http://github.com/example/example.git"
},
"scripts"
:
{
"start"
:
"node server.js"
}
}
}
}
test/run
View file @
db801a04
#!/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.
testWarnNoStart
()
{
compile
"no-start"
assertCaptured
"may not specify any way to start"
assertCapturedSuccess
compile
"no-version"
assertNotCaptured
"may not specify any way to start"
assertCapturedSuccess
}
testWarnDevDeps
()
{
testWarnDevDeps
()
{
compile
"missing-devdeps-1"
compile
"missing-devdeps-1"
assertCaptured
"A module may be missing"
assertCaptured
"A module may be missing"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment