initial commit
Some checks failed
CI Pipeline / Build and Test (push) Has been cancelled
Build and Publish TechDocs / build-and-publish (push) Has been cancelled

Change-Id: Ia748646eaf5c18f44eb5b147ff577d0d5ee844e8
This commit is contained in:
Scaffolder
2026-03-23 17:40:04 +00:00
commit 3f7396407b
60 changed files with 4361 additions and 0 deletions

12
result/tests/Dockerfile Normal file
View File

@@ -0,0 +1,12 @@
FROM node:8.9-slim
RUN apt-get update -qq && apt-get install -qy \
ca-certificates \
bzip2 \
curl \
libfontconfig \
--no-install-recommends
RUN yarn global add phantomjs-prebuilt
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() {
});
});

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

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