Update AB test runners
Use variable to connect in clientRunner Use new(ish) `host.docker.internal` address provided by Docker to connect to host machine Run client tests port 9002 so suites can be run concurrently
This commit is contained in:
parent
fb8cf474be
commit
d5c0684ab4
@ -30,7 +30,7 @@
|
|||||||
"guzzlehttp/psr7": "^1.0"
|
"guzzlehttp/psr7": "^1.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"phpunit/phpunit": "5.7.*",
|
"phpunit/phpunit": "^5.7",
|
||||||
"react/socket": "^1.3"
|
"react/socket": "^1.3"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@ -15,7 +15,7 @@ require __DIR__ . '/../bootstrap.php';
|
|||||||
|
|
||||||
define('AGENT', 'RatchetRFC/0.3');
|
define('AGENT', 'RatchetRFC/0.3');
|
||||||
|
|
||||||
$testServer = "127.0.0.1";
|
$testServer = "host.docker.internal";
|
||||||
|
|
||||||
$loop = React\EventLoop\Factory::create();
|
$loop = React\EventLoop\Factory::create();
|
||||||
|
|
||||||
@ -55,9 +55,9 @@ function getTestCases() {
|
|||||||
|
|
||||||
$deferred = new Deferred();
|
$deferred = new Deferred();
|
||||||
|
|
||||||
$connector->connect($testServer . ':9001')->then(function (ConnectionInterface $connection) use ($deferred) {
|
$connector->connect($testServer . ':9002')->then(function (ConnectionInterface $connection) use ($deferred, $testServer) {
|
||||||
$cn = new ClientNegotiator();
|
$cn = new ClientNegotiator();
|
||||||
$cnRequest = $cn->generateRequest(new Uri('ws://127.0.0.1:9001/getCaseCount'));
|
$cnRequest = $cn->generateRequest(new Uri('ws://' . $testServer . ':9002/getCaseCount'));
|
||||||
|
|
||||||
$rawResponse = "";
|
$rawResponse = "";
|
||||||
$response = null;
|
$response = null;
|
||||||
@ -120,10 +120,10 @@ function runTest($case)
|
|||||||
|
|
||||||
$deferred = new Deferred();
|
$deferred = new Deferred();
|
||||||
|
|
||||||
$connector->connect($testServer . ':9001')->then(function (ConnectionInterface $connection) use ($deferred, $casePath, $case) {
|
$connector->connect($testServer . ':9002')->then(function (ConnectionInterface $connection) use ($deferred, $casePath, $case, $testServer) {
|
||||||
$cn = new ClientNegotiator(
|
$cn = new ClientNegotiator(
|
||||||
PermessageDeflateOptions::permessageDeflateSupported() ? PermessageDeflateOptions::createEnabled() : null);
|
PermessageDeflateOptions::permessageDeflateSupported() ? PermessageDeflateOptions::createEnabled() : null);
|
||||||
$cnRequest = $cn->generateRequest(new Uri('ws://127.0.0.1:9001' . $casePath));
|
$cnRequest = $cn->generateRequest(new Uri('ws://' . $testServer . ':9002' . $casePath));
|
||||||
|
|
||||||
$rawResponse = "";
|
$rawResponse = "";
|
||||||
$response = null;
|
$response = null;
|
||||||
@ -179,12 +179,12 @@ function createReport() {
|
|||||||
|
|
||||||
$deferred = new Deferred();
|
$deferred = new Deferred();
|
||||||
|
|
||||||
$connector->connect($testServer . ':9001')->then(function (ConnectionInterface $connection) use ($deferred) {
|
$connector->connect($testServer . ':9002')->then(function (ConnectionInterface $connection) use ($deferred, $testServer) {
|
||||||
// $reportPath = "/updateReports?agent=" . AGENT . "&shutdownOnComplete=true";
|
// $reportPath = "/updateReports?agent=" . AGENT . "&shutdownOnComplete=true";
|
||||||
// we will stop it using docker now instead of just shutting down
|
// we will stop it using docker now instead of just shutting down
|
||||||
$reportPath = "/updateReports?agent=" . AGENT;
|
$reportPath = "/updateReports?agent=" . AGENT;
|
||||||
$cn = new ClientNegotiator();
|
$cn = new ClientNegotiator();
|
||||||
$cnRequest = $cn->generateRequest(new Uri('ws://127.0.0.1:9001' . $reportPath));
|
$cnRequest = $cn->generateRequest(new Uri('ws://' . $testServer . ':9002' . $reportPath));
|
||||||
|
|
||||||
$rawResponse = "";
|
$rawResponse = "";
|
||||||
$response = null;
|
$response = null;
|
||||||
|
@ -1,12 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
set -x
|
|
||||||
|
|
||||||
echo "Running $0"
|
|
||||||
|
|
||||||
echo Adding "$1 host.ratchet.internal" to /etc/hosts file
|
|
||||||
|
|
||||||
echo $1 host.ratchet.internal >> /etc/hosts
|
|
||||||
|
|
||||||
echo /etc/hosts contains:
|
|
||||||
cat /etc/hosts
|
|
||||||
echo
|
|
@ -5,7 +5,7 @@
|
|||||||
, "outdir": "/reports/servers"
|
, "outdir": "/reports/servers"
|
||||||
, "servers": [{
|
, "servers": [{
|
||||||
"agent": "RatchetRFC/0.3"
|
"agent": "RatchetRFC/0.3"
|
||||||
, "url": "ws://host.ratchet.internal:9001"
|
, "url": "ws://host.docker.internal:9001"
|
||||||
, "options": {"version": 18}
|
, "options": {"version": 18}
|
||||||
}]
|
}]
|
||||||
, "cases": [
|
, "cases": [
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
, "outdir": "/reports/servers"
|
, "outdir": "/reports/servers"
|
||||||
, "servers": [{
|
, "servers": [{
|
||||||
"agent": "RatchetRFC/0.3"
|
"agent": "RatchetRFC/0.3"
|
||||||
, "url": "ws://host.ratchet.internal:9001"
|
, "url": "ws://host.docker.internal:9001"
|
||||||
, "options": {"version": 18}
|
, "options": {"version": 18}
|
||||||
}]
|
}]
|
||||||
, "cases": ["*"]
|
, "cases": ["*"]
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"url": "ws://127.0.0.1:9001"
|
"url": "ws://127.0.0.1:9002"
|
||||||
, "options": {
|
, "options": {
|
||||||
"failByDrop": false
|
"failByDrop": false
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"url": "ws://127.0.0.1:9001"
|
"url": "ws://127.0.0.1:9002"
|
||||||
, "options": {
|
, "options": {
|
||||||
"failByDrop": false
|
"failByDrop": false
|
||||||
}
|
}
|
||||||
|
@ -14,13 +14,13 @@ if [ "$ABTEST" = "client" ]; then
|
|||||||
-d \
|
-d \
|
||||||
-v ${PWD}:/config \
|
-v ${PWD}:/config \
|
||||||
-v ${PWD}/reports:/reports \
|
-v ${PWD}/reports:/reports \
|
||||||
-p 9001:9001 \
|
-p 9002:9002 \
|
||||||
--name fuzzingserver \
|
--name fuzzingserver \
|
||||||
crossbario/autobahn-testsuite wstest -m fuzzingserver -s /config/fuzzingserver$SKIP_DEFLATE.json
|
crossbario/autobahn-testsuite wstest -m fuzzingserver -s /config/fuzzingserver$SKIP_DEFLATE.json
|
||||||
sleep 5
|
sleep 5
|
||||||
if [ "$TRAVIS" != "true" ]; then
|
if [ "$TRAVIS" != "true" ]; then
|
||||||
echo "Running tests vs Autobahn test client"
|
echo "Running tests vs Autobahn test client"
|
||||||
###docker run -it --rm --name abpytest crossbario/autobahn-testsuite wstest --mode testeeclient -w ws://host.docker.internal:9001
|
###docker run -it --rm --name abpytest crossbario/autobahn-testsuite wstest --mode testeeclient -w ws://host.docker.internal:9002
|
||||||
fi
|
fi
|
||||||
php -d memory_limit=256M clientRunner.php
|
php -d memory_limit=256M clientRunner.php
|
||||||
|
|
||||||
@ -48,7 +48,7 @@ if [ "$ABTEST" = "server" ]; then
|
|||||||
-v ${PWD}:/config \
|
-v ${PWD}:/config \
|
||||||
-v ${PWD}/reports:/reports \
|
-v ${PWD}/reports:/reports \
|
||||||
--name fuzzingclient \
|
--name fuzzingclient \
|
||||||
crossbario/autobahn-testsuite /bin/sh -c "sh /config/docker_bootstrap.sh $IPADDR; wstest -m fuzzingclient -s /config/fuzzingclient$SKIP_DEFLATE.json"
|
crossbario/autobahn-testsuite /bin/sh -c "wstest -m fuzzingclient -s /config/fuzzingclient$SKIP_DEFLATE.json"
|
||||||
sleep 1
|
sleep 1
|
||||||
|
|
||||||
# send the shutdown command to the PHP echo server
|
# send the shutdown command to the PHP echo server
|
||||||
|
Loading…
Reference in New Issue
Block a user