Small changes around testing

This commit is contained in:
Adam Štrauch 2020-04-01 23:47:12 +02:00
parent a430efbbe0
commit c689d55c9b
Signed by: cx
GPG Key ID: 018304FFA8988F8D
3 changed files with 71 additions and 5 deletions

View File

@ -10,4 +10,5 @@ jobs:
- uses: actions/checkout@v1
- name: testing
run: |
make build
make test

View File

@ -7,7 +7,7 @@ build:
$(DOCKER) pull debian:buster
$(DOCKER) build -t rosti/runtime:dev .
test: build
test:
DOCKER=$(DOCKER) ./tests.sh
squashed:

View File

@ -6,7 +6,7 @@ fi
CONTAINER_NAME=runtime-test
I=1
COUNT=5
COUNT=9
PROBLEM=0
function run() {
@ -32,7 +32,6 @@ I=$((I+1))
stop
###############
# Node.js 12.14.1
run
@ -46,10 +45,43 @@ else
PROBLEM=1
fi
I=$((I+1))
stop
# Node.js 12.16.1
run
$DOCKER exec -e TESTMODE=1 -e MENUITEM=tech -e TECH=node-12.16.1 $CONTAINER_NAME su app -c rosti > /dev/null
sleep 3
$DOCKER exec $CONTAINER_NAME curl http://localhost:8000 | grep package.json > /dev/null
if [ $? -eq 0 ]; then
echo "$I/$COUNT Node.js 12.16.1 response correct"
else
echo "$I/$COUNT Node.js 12.16.1 response incorrect"
PROBLEM=1
fi
I=$((I+1))
stop
###############
# Node.js 13.12.0
run
$DOCKER exec -e TESTMODE=1 -e MENUITEM=tech -e TECH=node-13.12.0 $CONTAINER_NAME su app -c rosti > /dev/null
sleep 3
$DOCKER exec $CONTAINER_NAME curl http://localhost:8000 | grep package.json > /dev/null
if [ $? -eq 0 ]; then
echo "$I/$COUNT Node.js 13.12.0 response correct"
else
echo "$I/$COUNT Node.js 13.12.0 response incorrect"
PROBLEM=1
fi
I=$((I+1))
stop
# Node.js 13.7.0
run
@ -67,8 +99,7 @@ I=$((I+1))
stop
###############
# Python 3.8.2
# Python 3.8.1
run
$DOCKER exec -e TESTMODE=1 -e MENUITEM=tech -e TECH=python-3.8.1 $CONTAINER_NAME su app -c rosti > /dev/null
@ -81,6 +112,23 @@ else
PROBLEM=1
fi
I=$((I+1))
stop
# Python 3.8.2
run
$DOCKER exec -e TESTMODE=1 -e MENUITEM=tech -e TECH=python-3.8.2 $CONTAINER_NAME su app -c rosti > /dev/null
sleep 5
$DOCKER exec $CONTAINER_NAME curl http://localhost:8000 | grep "app.py" > /dev/null
if [ $? -eq 0 ]; then
echo "$I/$COUNT Python 3.8.2 response correct"
else
echo "$I/$COUNT Python 3.8.2 response incorrect"
PROBLEM=1
fi
I=$((I+1))
stop
###############
@ -100,6 +148,23 @@ fi
I=$((I+1))
stop
# PHP 7.4.4
run
$DOCKER exec -e TESTMODE=1 -e MENUITEM=tech -e TECH=php-7.4.4 $CONTAINER_NAME su app -c rosti > /dev/null
sleep 5
$DOCKER exec $CONTAINER_NAME curl http://localhost:8000 | grep "PHP aplikaci" > /dev/null
if [ $? -eq 0 ]; then
echo "$I/$COUNT PHP 7.4.4 response correct"
else
echo "$I/$COUNT PHP 7.4.4 response incorrect"
PROBLEM=1
fi
I=$((I+1))
stop
###############
if [ "$PROBLEM" = "0" ]; then