Rename services to remove "app"

This commit is contained in:
Ben Firshman
2016-06-18 09:14:28 -07:00
parent dd03d8937a
commit 09279e12a8
20 changed files with 32 additions and 32 deletions

5
result/tests/Dockerfile Normal file
View File

@ -0,0 +1,5 @@
FROM node
RUN npm install -g phantomjs
ADD . /app
WORKDIR /app
CMD ["/app/tests.sh"]

15
result/tests/render.js Normal file
View File

@ -0,0 +1,15 @@
var system = require('system');
var page = require('webpage').create();
var url = system.args[1];
page.onLoadFinished = function() {
setTimeout(function(){
console.log(page.content);
phantom.exit();
}, 1000);
};
page.open(url, function() {
page.evaluate(function() {
});
});

15
result/tests/tests.sh Executable file
View File

@ -0,0 +1,15 @@
#!/bin/sh
while ! timeout 1 bash -c "echo > /dev/tcp/vote/80"; do sleep 1; done
curl -sS -X POST --data "vote=a" http://vote > /dev/null
curl -sS -X POST --data "vote=b" http://vote > /dev/null
sleep 10
if phantomjs render.js http://result | grep -q '2 votes'; then
echo -e "\e[42m------------"
echo -e "\e[92mTests passed"
echo -e "\e[42m------------"
exit 0
fi
echo -e "\e[41m------------"
echo -e "\e[91mTests failed"
echo -e "\e[41m------------"
exit 1