Commit 74cbd1c1 authored by Mikaël Salson's avatar Mikaël Salson

servers/tests/functional: Use same launch_functional_tests script as the client

parent ca4752f1
......@@ -334,7 +334,7 @@ test_server_functional:
- docker exec docker_nginx_1 make -C /usr/share/vidjil browser
- source /etc/profile.d/rvm.sh
- rvm use 2.6.1
- HEADLESS=1 make functional_server || (cd docker && docker-compose stop; docker stop $(docker ps -aq); docker rm $(docker ps -aq); docker rmi "vidjil/server:test" "vidjil/client:test"; false)
- HEADLESS=1 make functional_server BROWSERS="--browsers-from-file" || (cd docker && docker-compose stop; docker stop $(docker ps -aq); docker rm $(docker ps -aq); docker rmi "vidjil/server:test" "vidjil/client:test"; false)
- cd docker && docker-compose stop
- docker stop $(docker ps -aq)
- docker rm $(docker ps -aq)
......
......@@ -4,6 +4,6 @@ headless:
HEADLESS=1 $(MAKE) functional
functional:
sh launch_functional_tests functional/test_*.rb
sh launch_functional_tests $(BROWSERS) functional/test_*.rb
.PHONY: all functional headless
# sh launch_functional_tests functional/test_*rb
FUNCTIONAL_TESTS=$*
rename_reports_in() {
dir="$1"
b="$2"
if [ "$b" = "." ]; then
b="default"
else
b=$(echo "$b" | tr '/' '-')
fi
for file in $1/*.xml; do
filename=$(basename -s .xml $file)
mv $file $dir/$filename-$b.xml
done
}
rm -f test/*.xml
EXIT=0
if [ -z "$FUNCTIONAL_CLIENT_BROWSER_PATH" ]; then
FUNCTIONAL_CLIENT_BROWSER_PATH="."
fi
for browser in $FUNCTIONAL_CLIENT_BROWSER_PATH; do
sh init_func_test_db.sh
for file in $FUNCTIONAL_TESTS; do
if [ ${#browser} -gt 1 ]; then
export WATIR_BROWSER_PATH="$browser"
fi
ruby -I functional $file;
TMP_EXIT=$?
if [ $TMP_EXIT -ne 0 ]; then
EXIT=$TMP_EXIT
fi
rename_reports_in test/reports/ "$browser"
mv test/reports/*.xml test/
done
done
exit $EXIT
../../../../../browser/test/launch_functional_tests
\ No newline at end of file
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