Unverified Commit 778ad489 authored by Jeremy Morrell's avatar Jeremy Morrell Committed by GitHub

Fix travis builds (#551)

* Fix travis builds

- Yarn reworked the structure of their cache directory with a recent release, which broke one of the tests.

- added new fixtures for Node versions: 6, 8, 9, and 10

- Added new utilities for asserting that a file exists or does not exist after a build
parent 8ed4c0a3
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": {
"hashish": "*"
},
"engines": {
"node": "10.x"
},
"scripts": {
"start": "node foo.js"
}
}
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": {
"hashish": "*"
},
"engines": {
"node": "6.x"
},
"scripts": {
"start": "node foo.js"
}
}
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": {
"hashish": "*"
},
"engines": {
"node": "8.x"
},
"scripts": {
"start": "node foo.js"
}
}
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": {
"hashish": "*"
},
"engines": {
"node": "9.x"
},
"scripts": {
"start": "node foo.js"
}
}
...@@ -3,6 +3,9 @@ ...@@ -3,6 +3,9 @@
"version": "1.0.0", "version": "1.0.0",
"main": "index.js", "main": "index.js",
"license": "MIT", "license": "MIT",
"engines": {
"yarn": "1.x"
},
"dependencies": { "dependencies": {
"lodash": "^4.16.4" "lodash": "^4.16.4"
} }
......
...@@ -65,8 +65,8 @@ testYarnCacheDirectory() { ...@@ -65,8 +65,8 @@ testYarnCacheDirectory() {
compile "yarn" $cache $env_dir compile "yarn" $cache $env_dir
# These will be created if yarn is using the directory for its cache # These will be created if yarn is using the directory for its cache
assertDirectoryExists ${cache_dir}/yarn assertDirectoryExists ${cache_dir}/yarn
assertDirectoryExists ${cache_dir}/yarn/v1 assertDirectoryExists ${cache_dir}/yarn/v2
assertDirectoryExists ${cache_dir}/yarn/v1/npm-lodash-4.16.4-01ce306b9bad1319f2a5528674f88297aeb70127 assertFileExists ${cache_dir}/yarn/v2/npm-lodash-4.16.4-01ce306b9bad1319f2a5528674f88297aeb70127
assertCapturedSuccess assertCapturedSuccess
} }
...@@ -979,13 +979,4 @@ assertFile() { ...@@ -979,13 +979,4 @@ assertFile() {
assertEquals "$1" "$(cat ${compile_dir}/$2)" assertEquals "$1" "$(cat ${compile_dir}/$2)"
} }
assertDirectoryExists() {
if [[ ! -e "$1" ]]; then
fail "$1 does not exist"
fi
if [[ ! -d $1 ]]; then
fail "$1 is not a directory"
fi
}
source $(pwd)/test/shunit2 source $(pwd)/test/shunit2
...@@ -188,3 +188,24 @@ assertFileMD5() ...@@ -188,3 +188,24 @@ assertFileMD5()
assertEquals "${expected_md5_cmd_output}" "`${md5_cmd}`" assertEquals "${expected_md5_cmd_output}" "`${md5_cmd}`"
} }
assertDirectoryExists() {
if [[ ! -e "$1" ]]; then
fail "$1 does not exist"
fi
if [[ ! -d $1 ]]; then
fail "$1 is not a directory"
fi
}
assertFileExists()
{
filename=$1
assertTrue "$filename doesn't exist" "[[ -e $filename ]]"
}
assertFileDoesNotExist()
{
filename=$1
assertTrue "$filename exists" "[[ ! -e $filename ]]"
}
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