mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 15:23:06 +00:00
Rename dummy to benchmark
This commit is contained in:
@@ -15,7 +15,7 @@ require 'English'
|
||||
|
||||
class BenchmarkDriver
|
||||
ROOT = Pathname File.expand_path(File.join('..', '..'), __FILE__)
|
||||
BASE = ENV.fetch('BASE') { ROOT.join('test', 'dummy') }
|
||||
BASE = ENV.fetch('BASE') { ROOT.join('test', 'benchmark') }
|
||||
ESCAPED_BASE = Shellwords.shellescape(BASE)
|
||||
|
||||
def self.benchmark(options)
|
||||
|
||||
@@ -4,18 +4,18 @@ set -e
|
||||
case "$1" in
|
||||
|
||||
start)
|
||||
config="${CONFIG_RU:-test/dummy/config.ru}"
|
||||
bundle exec ruby -Ilib -S rackup "$config" --daemonize --pid tmp/dummy_app.pid --warn --server webrick
|
||||
until [ -f 'tmp/dummy_app.pid' ]; do
|
||||
config="${CONFIG_RU:-test/benchmark/config.ru}"
|
||||
bundle exec ruby -Ilib -S rackup "$config" --daemonize --pid tmp/benchmark_app.pid --warn --server webrick
|
||||
until [ -f 'tmp/benchmark_app.pid' ]; do
|
||||
sleep 0.1 # give it time to start.. I don't know a better way
|
||||
done
|
||||
cat tmp/dummy_app.pid
|
||||
cat tmp/benchmark_app.pid
|
||||
true
|
||||
;;
|
||||
|
||||
stop)
|
||||
if [ -f 'tmp/dummy_app.pid' ]; then
|
||||
kill -TERM $(cat tmp/dummy_app.pid)
|
||||
if [ -f 'tmp/benchmark_app.pid' ]; then
|
||||
kill -TERM $(cat tmp/benchmark_app.pid)
|
||||
else
|
||||
echo 'No pidfile'
|
||||
false
|
||||
@@ -23,8 +23,8 @@ case "$1" in
|
||||
;;
|
||||
|
||||
status)
|
||||
if [ -f 'tmp/dummy_app.pid' ]; then
|
||||
kill -0 $(cat tmp/dummy_app.pid)
|
||||
if [ -f 'tmp/benchmark_app.pid' ]; then
|
||||
kill -0 $(cat tmp/benchmark_app.pid)
|
||||
[ "$?" -eq 0 ]
|
||||
else
|
||||
echo 'No pidfile'
|
||||
Reference in New Issue
Block a user