kopia lustrzana https://github.com/OpenDroneMap/WebODM
Allow selectively testing (parts) front/backend.
rodzic
26be8f1834
commit
cfa84d210c
22
webodm.sh
22
webodm.sh
|
@ -174,7 +174,7 @@ usage(){
|
||||||
echo " liveupdate Update WebODM to the latest release without stopping it"
|
echo " liveupdate Update WebODM to the latest release without stopping it"
|
||||||
echo " rebuild Rebuild all docker containers and perform cleanups"
|
echo " rebuild Rebuild all docker containers and perform cleanups"
|
||||||
echo " checkenv Do an environment check and install missing components"
|
echo " checkenv Do an environment check and install missing components"
|
||||||
echo " test Run the unit test suite (developers only)"
|
echo " test [frontend|backend] [args] Run tests (all tests, or just frontend/backend with optional arguments)"
|
||||||
echo " resetadminpassword \"<new password>\" Reset the administrator's password to a new one. WebODM must be running when executing this command and the password must be enclosed in double quotes."
|
echo " resetadminpassword \"<new password>\" Reset the administrator's password to a new one. WebODM must be running when executing this command and the password must be enclosed in double quotes."
|
||||||
echo ""
|
echo ""
|
||||||
echo "Options:"
|
echo "Options:"
|
||||||
|
@ -510,17 +510,26 @@ run_tests(){
|
||||||
# If in a container, we run the actual test commands
|
# If in a container, we run the actual test commands
|
||||||
# otherwise we launch this command from the container
|
# otherwise we launch this command from the container
|
||||||
if [[ -f /.dockerenv ]]; then
|
if [[ -f /.dockerenv ]]; then
|
||||||
|
test_type=${1:-"all"}
|
||||||
|
shift || true
|
||||||
|
|
||||||
|
if [[ $test_type = "frontend" || $test_type = "all" ]]; then
|
||||||
echo -e "\033[1mRunning frontend tests\033[0m"
|
echo -e "\033[1mRunning frontend tests\033[0m"
|
||||||
run "npm run test"
|
run "npm run test $@"
|
||||||
|
fi
|
||||||
|
|
||||||
echo "\033[1mRunning backend tests\033[0m"
|
if [[ $test_type = "backend" || $test_type = "all" ]]; then
|
||||||
run "python manage.py test"
|
echo -e "\033[1mRunning backend tests\033[0m"
|
||||||
|
run "python manage.py test $@"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $test_type = "all" ]]; then
|
||||||
echo ""
|
echo ""
|
||||||
echo -e "\033[1mDone!\033[0m Everything looks in order."
|
echo -e "\033[1mDone!\033[0m Everything looks in order."
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo "Running tests in webapp container"
|
echo "Running tests in webapp container"
|
||||||
run "$docker_compose exec webapp /bin/bash -c \"/webodm/webodm.sh test\""
|
run "$docker_compose exec webapp /bin/bash -c \"/webodm/webodm.sh test $@\""
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -622,7 +631,8 @@ elif [[ $1 = "liveupdate" ]]; then
|
||||||
elif [[ $1 = "checkenv" ]]; then
|
elif [[ $1 = "checkenv" ]]; then
|
||||||
environment_check
|
environment_check
|
||||||
elif [[ $1 = "test" ]]; then
|
elif [[ $1 = "test" ]]; then
|
||||||
run_tests
|
shift || true
|
||||||
|
run_tests "$@"
|
||||||
elif [[ $1 = "resetadminpassword" ]]; then
|
elif [[ $1 = "resetadminpassword" ]]; then
|
||||||
resetpassword "$2"
|
resetpassword "$2"
|
||||||
else
|
else
|
||||||
|
|
Ładowanie…
Reference in New Issue