move tests to script file.

parent b03704f1
......@@ -129,25 +129,12 @@ test_build:
image: docker:git
script:
# build docker image to test building
# build docker imageg to test building
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN registry.gitlab.com
- docker build . -t testbuild
- docker build . -t admin
# run simple smoketests to verify Docker image is sane
- docker run --name testbuild -p 8000:8000 -d testbuild runuwsgi
# setup database and implicitly test running commands
- docker exec testbuild failmap-admin migrate
- docker exec testbuild failmap-admin loaddata development
# index page
- curl -s http://localhost:8000 |grep MSPAINT.EXE
# static files
- curl -sI http://localhost:8000/static/images/red-dot.png |grep 200\ OK
# compressed static files
- "curl -sI http://localhost:8000/static/$(curl -s http://localhost:8000/static/CACHE/manifest.json|sed -n 's,.*\(CACHE/js/.*js\).*,\1,p')|grep 200\ OK"
# admin login
- curl -si --cookie-jar cookie --cookie cookie http://localhost:8000/admin/login/|grep 200\ OK
- curl -si --cookie-jar cookie --cookie cookie --data "csrfmiddlewaretoken=$(grep csrftoken cookie | cut -f 7)&username=admin&password=faalkaart" http://localhost:8000/admin/login/|grep 302\ Found
- tests/docker.sh
# run on MR
except: [master]
......
# Netscape HTTP Cookie File
# https://curl.haxx.se/docs/http-cookies.html
# This file was generated by libcurl! Edit at your own risk.
localhost FALSE / FALSE 1540830889 csrftoken MYshXYjSbd6qKAJG3fqkyRUDcCgkM2Od5z1KY5JCyZb5k6PAMxkShf56CaE5xSjL
#HttpOnly_localhost FALSE / FALSE 1510590889 sessionid mwr79uewekos176t3vh16soxmyyehd1o
#!/bin/bash
set -ve
# run simple smoketests to verify docker image build is sane
# start docker container
docker run --name admin -p 8000:8000 -d admin runuwsgi
# setup database and implicitly test running commands
docker exec admin failmap-admin migrate
docker exec admin failmap-admin loaddata development
# index page
curl -s http://localhost:8000 |grep MSPAINT.EXE
# static files
curl -sI http://localhost:8000/static/images/red-dot.png |grep 200\ OK
# compressed static files
curl -sI "http://localhost:8000/static/$(curl -s http://localhost:8000/static/CACHE/manifest.json|sed -n 's,.*\(CACHE/js/.*js\).*,\1,p')"|grep 200\ OK
# admin login
curl -si --cookie-jar cookie --cookie cookie http://localhost:8000/admin/login/|grep 200\ OK
curl -si --cookie-jar cookie --cookie cookie --data "csrfmiddlewaretoken=$(grep csrftoken cookie | cut -f 7)&username=admin&password=faalkaart" http://localhost:8000/admin/login/|grep 302\ Found
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment