Commit f11d083b authored by Hunter Loftis's avatar Hunter Loftis

test and implementation for performance dynos

parent e14c33b6
......@@ -20,9 +20,10 @@ detect_memory() {
local limit=$(ulimit -u)
case $limit in
256) echo "512";;
512) echo "1024";;
32768) echo "6144";;
256) echo "512";; # Standard-1X
512) echo "1024";; # Standard-2X
16384) echo "2560";; # Performance-M
32768) echo "6144";; # Performance-L
*) echo "$default";;
esac
}
......
#!/usr/bin/env bash
# See README.md for info on running these tests.
testBuildWithUserCacheDirectoriesCamel() {
cache=$(mktmpdir)
compile "cache-directories-camel" $cache
assertCaptured "- non/existent (nothing to cache)"
assertEquals "1" "$(ls -1 $cache/node/server | grep node_modules | wc -l | tr -d ' ')"
assertEquals "1" "$(ls -1 $cache/node/client | grep node_modules | wc -l | tr -d ' ')"
assertCapturedSuccess
compile "cache-directories-camel" $cache
assertCaptured "Loading 3 from cacheDirectories"
assertCaptured "- server/node_modules"
assertCaptured "- client/node_modules"
assertCaptured "- non/existent (not cached - skipping)"
assertCapturedSuccess
}
testConcurrency1X() {
LOG_CONCURRENCY=true MEMORY_AVAILABLE=512 capture $(pwd)/profile/nodejs.sh
assertCaptured "Detected 512 MB available memory, 512 MB limit per process (WEB_MEMORY)"
......@@ -15,6 +32,13 @@ testConcurrency2X() {
assertCapturedSuccess
}
testConcurrencyPerformanceM() {
LOG_CONCURRENCY=true MEMORY_AVAILABLE=2560 capture $(pwd)/profile/nodejs.sh
assertCaptured "Detected 2560 MB available memory, 512 MB limit per process (WEB_MEMORY)"
assertCaptured "Recommending WEB_CONCURRENCY=5"
assertCapturedSuccess
}
testConcurrencyPX() {
LOG_CONCURRENCY=true MEMORY_AVAILABLE=6144 capture $(pwd)/profile/nodejs.sh
assertCaptured "Detected 6144 MB available memory, 512 MB limit per process (WEB_MEMORY)"
......@@ -302,22 +326,9 @@ testBuildWithUserCacheDirectories() {
assertCapturedSuccess
}
testBuildWithUserCacheDirectoriesCamel() {
cache=$(mktmpdir)
compile "cache-directories-camel" $cache
assertCaptured "- non/existent (nothing to cache)"
assertEquals "1" "$(ls -1 $cache/node/server | grep node_modules | wc -l | tr -d ' ')"
assertEquals "1" "$(ls -1 $cache/node/client | grep node_modules | wc -l | tr -d ' ')"
assertCapturedSuccess
compile "cache-directories-camel" $cache
assertCaptured "Loading 3 from cacheDirectories"
assertCaptured "- server/node_modules"
assertCaptured "- client/node_modules"
assertCaptured "- non/existent (not cached - skipping)"
assertCapturedSuccess
}
testUserConfig() {
compile "userconfig"
......
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