From 91af8a76d57f8271e6f7b0d9fc0bfa1549200105 Mon Sep 17 00:00:00 2001 From: Chris Boden Date: Wed, 11 Dec 2019 10:18:08 -0500 Subject: [PATCH] quality of life changes Kill the php server after AB tests are done Add script runners to composer for ease of use --- composer.json | 8 ++++++++ tests/ab/run_ab_tests.sh | 2 ++ 2 files changed, 10 insertions(+) diff --git a/composer.json b/composer.json index d9ff35d..b758876 100644 --- a/composer.json +++ b/composer.json @@ -27,5 +27,13 @@ "require-dev": { "phpunit/phpunit": "4.8.*", "react/socket": "^1.3" + }, + "scripts": { + "abtests": "sh tests/ab/run_ab_tests.sh", + "phpunit": "phpunit --colors=always", + "test": [ + "@abtests", + "@phpunit" + ] } } diff --git a/tests/ab/run_ab_tests.sh b/tests/ab/run_ab_tests.sh index 8fa9ced..f06a343 100644 --- a/tests/ab/run_ab_tests.sh +++ b/tests/ab/run_ab_tests.sh @@ -9,3 +9,5 @@ sleep 2 php startServer.php & sleep 3 wstest -m fuzzingclient -s fuzzingclient.json +sleep 1 +kill $(ps aux | grep 'php startServer.php' | awk '{print $2}' | head -n 1)