mirror of
https://github.com/YunoHost/ynh-dev.git
synced 2024-09-03 20:05:59 +02:00
Be able to selects which tests to run
This commit is contained in:
parent
b0b73cde1d
commit
7b0cd76b2e
1 changed files with 18 additions and 5 deletions
15
ynh-dev
15
ynh-dev
|
@ -270,10 +270,17 @@ function run_tests()
|
||||||
local PACKAGES="$@"
|
local PACKAGES="$@"
|
||||||
for PACKAGE in "$PACKAGES";
|
for PACKAGE in "$PACKAGES";
|
||||||
do
|
do
|
||||||
|
local TEST_MODULE=""
|
||||||
|
if [[ "$PACKAGE" == *"/"* ]]
|
||||||
|
then
|
||||||
|
TEST_MODULE=$(echo "$PACKAGE" | awk -F'/' '{print $2}')
|
||||||
|
PACKAGE=$(echo "$PACKAGE" | awk -F'/' '{print $1}')
|
||||||
|
fi
|
||||||
|
|
||||||
case $PACKAGE in
|
case $PACKAGE in
|
||||||
yunohost)
|
yunohost)
|
||||||
# Pytest and tests dependencies
|
# Pytest and tests dependencies
|
||||||
if ! type "pytest" > /dev/null; then
|
if ! type "pytest" > /dev/null 2>&1; then
|
||||||
info "> Installing pytest ..."
|
info "> Installing pytest ..."
|
||||||
apt-get install python-pip -y
|
apt-get install python-pip -y
|
||||||
pip2 install pytest
|
pip2 install pytest
|
||||||
|
@ -294,10 +301,16 @@ function run_tests()
|
||||||
|
|
||||||
# Run tests
|
# Run tests
|
||||||
echo "Running tests for YunoHost"
|
echo "Running tests for YunoHost"
|
||||||
|
if [[ -z "$TEST_MODULE" ]]
|
||||||
|
then
|
||||||
cd /ynh-dev/yunohost/
|
cd /ynh-dev/yunohost/
|
||||||
py.test tests
|
py.test tests
|
||||||
cd /ynh-dev/yunohost/src/yunohost
|
cd /ynh-dev/yunohost/src/yunohost
|
||||||
py.test tests
|
py.test tests
|
||||||
|
else
|
||||||
|
cd /ynh-dev/yunohost/src/yunohost
|
||||||
|
py.test tests/test_"$TEST_MODULE".py
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
Loading…
Add table
Reference in a new issue