Commit e5b29e27 authored by Ryan Herbert's avatar Ryan Herbert

refactor init_db call to a shell script

so we can use sed to edit it when executing functional tests in docker
with gitlab-ci
parent b8b169f5
Pipeline #33884 failed with stages
in 5 minutes and 11 seconds
...@@ -245,6 +245,7 @@ test_server_functional: ...@@ -245,6 +245,7 @@ test_server_functional:
- docker build --no-cache --build-arg git_branch=$CI_COMMIT_REF_NAME --build-arg build_env=TEST -t "vidjil/server:test" docker/vidjil-server - docker build --no-cache --build-arg git_branch=$CI_COMMIT_REF_NAME --build-arg build_env=TEST -t "vidjil/server:test" docker/vidjil-server
- docker build --no-cache --build-arg git_branch=$CI_COMMIT_REF_NAME --build-arg build_env=TEST -t "vidjil/client:test" docker/vidjil-client - docker build --no-cache --build-arg git_branch=$CI_COMMIT_REF_NAME --build-arg build_env=TEST -t "vidjil/client:test" docker/vidjil-client
- cd docker && docker-compose up -d && cd .. - cd docker && docker-compose up -d && cd ..
- sed -i "s/^python/docker exec docker_uwsgi_1 python/" server/web2py/applications/vidjil/tests/init_func_test_db.sh
- docker exec docker_uwsgi_1 sed -i "s/^\(FILE_SOURCE .*\)/FILE_SOURCE = '\/usr\/share\/vidjil\/demo'/" /usr/share/vidjil/server/web2py/applications/vidjil/modules/defs.py - docker exec docker_uwsgi_1 sed -i "s/^\(FILE_SOURCE .*\)/FILE_SOURCE = '\/usr\/share\/vidjil\/demo'/" /usr/share/vidjil/server/web2py/applications/vidjil/modules/defs.py
- docker exec docker_nginx_1 make -C /usr/share/vidjil browser - docker exec docker_nginx_1 make -C /usr/share/vidjil browser
- docker exec docker_uwsgi_1 python /usr/share/vidjil/server/web2py/web2py.py -S vidjil -M -R /usr/share/vidjil/server/web2py/applications/vidjil/tests/functional/init_test_db.py - docker exec docker_uwsgi_1 python /usr/share/vidjil/server/web2py/web2py.py -S vidjil -M -R /usr/share/vidjil/server/web2py/applications/vidjil/tests/functional/init_test_db.py
......
#!/bin/sh
python ../../../web2py.py -M -S vidjil -R applications/vidjil/tests/functional/init_test_db.py
...@@ -22,7 +22,7 @@ if [ -z "$FUNCTIONAL_CLIENT_BROWSER_PATH" ]; then ...@@ -22,7 +22,7 @@ if [ -z "$FUNCTIONAL_CLIENT_BROWSER_PATH" ]; then
FUNCTIONAL_CLIENT_BROWSER_PATH="." FUNCTIONAL_CLIENT_BROWSER_PATH="."
fi fi
for browser in $FUNCTIONAL_CLIENT_BROWSER_PATH; do for browser in $FUNCTIONAL_CLIENT_BROWSER_PATH; do
python ../../../web2py.py -M -S vidjil -R applications/vidjil/tests/functional/init_test_db.py sh init_func_test_db.sh
for file in $FUNCTIONAL_TESTS; do for file in $FUNCTIONAL_TESTS; do
if [ ${#browser} -gt 1 ]; then if [ ${#browser} -gt 1 ]; then
export WATIR_BROWSER_PATH="$browser" export WATIR_BROWSER_PATH="$browser"
......
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