mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[tests/mod] auto clone/pull the test app when running tests
This commit is contained in:
parent
f760d6aa0f
commit
e80fe075e6
2 changed files with 11 additions and 9 deletions
|
@ -26,14 +26,6 @@ postinstall:
|
|||
- pip install -U pip
|
||||
- hash -d pip
|
||||
- pip --cache-dir=.pip install pytest pytest-sugar pytest-mock requests-mock mock
|
||||
- pushd src/yunohost/tests
|
||||
- >
|
||||
if [ ! -d "./apps" ]; then
|
||||
git clone https://github.com/YunoHost/test_apps ./apps
|
||||
fi
|
||||
- cd apps
|
||||
- git pull > /dev/null 2>&1
|
||||
- popd
|
||||
- export PYTEST_ADDOPTS="--color=yes"
|
||||
cache:
|
||||
paths:
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import os
|
||||
import pytest
|
||||
import sys
|
||||
import moulinette
|
||||
|
@ -9,6 +10,15 @@ from contextlib import contextmanager
|
|||
sys.path.append("..")
|
||||
|
||||
|
||||
@pytest.fixture(scope="session", autouse=True)
|
||||
def clone_test_app(request):
|
||||
cwd = os.path.split(os.path.realpath(__file__))[0]
|
||||
|
||||
if not os.path.exists(cwd + "/apps"):
|
||||
os.system("git clone https://github.com/YunoHost/test_apps %s/apps" % cwd)
|
||||
else:
|
||||
os.system("cd %s/apps && git pull > /dev/null 2>&1" % cwd)
|
||||
|
||||
|
||||
@contextmanager
|
||||
def message(mocker, key, **kwargs):
|
||||
|
|
Loading…
Add table
Reference in a new issue