forked from heroku/heroku-buildpack-play
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix detect script to work on mac, for local development
* Added test scripts for each buildpack phase * Testing done for detect and release :easy:
- Loading branch information
Naaman Newbold
committed
Jan 18, 2012
1 parent
b1c2bf9
commit 0e29eb9
Showing
4 changed files
with
84 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/sh | ||
|
||
#. ${BUILDPACK_TEST_RUNNER_HOME}/lib/test_utils.sh | ||
|
||
#PLAY_URL="https://s3.amazonaws.com/heroku-jvm-langpack-play/play-heroku-$VER_TO_INSTALL.tar.gz" | ||
|
||
# test cache is unpacked | ||
# test play version is picked up correctly in PLAY_VERSION from dependencies.yml | ||
# test play is installed correctly | ||
# test an upgrade of play version | ||
# test a valid version of play that isn't in S3 | ||
# test a fake version of play | ||
# test ivysettings.xml is removed and our custom settings are used | ||
# test dependencies are correctly retrieved | ||
# test precompile phase compiles artifacts | ||
# test play gets put into cache after precompile | ||
# test modules and ivy deps from build time are removed and not included in the slug | ||
# test a warning is printed if no procfile is present |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/sh | ||
|
||
source ${BUILDPACK_TEST_RUNNER_HOME}/lib/test_utils.sh | ||
|
||
testDetectWithConfFileDetectsPlayApp() { | ||
mkdir -p ${BUILD_DIR}/play-app/conf | ||
touch ${BUILD_DIR}/play-app/conf/application.conf | ||
detect | ||
|
||
assertAppDetected "Play!" | ||
} | ||
|
||
testNoConfFileDoesNotDetectPlayApp() { | ||
mkdir -p ${BUILD_DIR}/play-app/conf | ||
detect | ||
|
||
assertNoAppDetected | ||
} | ||
|
||
testConfFileWithModulesDirectoryDoesNotDetectPlayApp() { | ||
mkdir -p ${BUILD_DIR}/play-app/modules/conf | ||
touch ${BUILD_DIR}/play-app/modules/conf/application.conf | ||
detect | ||
|
||
assertNoAppDetected | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/sh | ||
|
||
source ${BUILDPACK_TEST_RUNNER_HOME}/lib/test_utils.sh | ||
|
||
# test with procfile | ||
# test without procfile | ||
|
||
testReleasedYamlDoesNotIncludeDefaultProcWhenProcfileIsPresent() { | ||
touch ${BUILD_DIR}/Procfile | ||
expectedReleaseYAML=`cat <<EOF | ||
--- | ||
config_vars: | ||
PATH: .play:.tools:/usr/local/bin:/usr/bin:/bin | ||
JAVA_OPTS: -Xmx384m | ||
PLAY_OPTS: --%prod -Dprecompiled=true | ||
addons: | ||
shared-database:5mb | ||
EOF` | ||
releaseYAML=`release` | ||
assertEquals "${expectedReleaseYAML}" "$(cat ${STD_OUT})" | ||
} | ||
testReleasedYamlHasDefaultProcessType() { | ||
expectedReleaseYAML=`cat <<EOF | ||
--- | ||
config_vars: | ||
PATH: .play:.tools:/usr/local/bin:/usr/bin:/bin | ||
JAVA_OPTS: -Xmx384m | ||
PLAY_OPTS: --%prod -Dprecompiled=true | ||
addons: | ||
shared-database:5mb | ||
default_process_types: | ||
web: play run --http.port=\\$PORT \\$PLAY_OPTS | ||
EOF` | ||
releaseYAML=`release` | ||
assertEquals "${expectedReleaseYAML}" "$(cat ${STD_OUT})" | ||
} |