From 6c24755e73d6e764b6fca463e6dc07f966240d90 Mon Sep 17 00:00:00 2001 From: Kayou Date: Sun, 1 Dec 2019 16:51:12 +0900 Subject: [PATCH 1/4] Create .gitlab-ci.yml --- .gitlab-ci.yml | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 000000000..bb7754e56 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,86 @@ +stages: + - postinstall + - tests + +.tests: + variables: + SNAPSHOT_NAME: "after-postinstall" + before_script: + - apt-get install python-pip -y + - pip2 install pytest pytest-sugar pytest-mock requests-mock mock + - pushd src/yunohost/tests + - git clone https://github.com/YunoHost/test_apps ./apps + - cd apps + - git pull > /dev/null 2>&1 + - popd + - export PYTEST_ADDOPTS="--color=yes" + + +postinstall: + variables: + SNAPSHOT_NAME: "before-postinstall" + stage: postinstall + script: + - yunohost tools postinstall -d domain.tld -p the_password --ignore-dyndns + +root-tests: + extends: .tests + stage: tests + script: + - py.test tests + +test-apps: + extends: .tests + stage: tests + script: + - cd src/yunohost + - py.test tests/test_apps.py + +test-appscatalog: + extends: .tests + stage: tests + script: + - cd src/yunohost + - py.test tests/test_appscatalog.py + +test-appurl: + extends: .tests + stage: tests + script: + - cd src/yunohost + - py.test tests/test_appurl.py + +test-backuprestore: + extends: .tests + stage: tests + script: + - cd src/yunohost + - py.test tests/test_backuprestore.py + +test-changeurl: + extends: .tests + stage: tests + script: + - cd src/yunohost + - py.test tests/test_changeurl.py + +test-permission: + extends: .tests + stage: tests + script: + - cd src/yunohost + - py.test tests/test_permission.py + +test-settings: + extends: .tests + stage: tests + script: + - cd src/yunohost + - py.test tests/test_settings.py + +test-user-group: + extends: .tests + stage: tests + script: + - cd src/yunohost + - py.test tests/test_user-group.py From 2b0711b1f4f6d35ca5ad43ac0b08465fb12b67e8 Mon Sep 17 00:00:00 2001 From: Kayou Date: Mon, 23 Dec 2019 20:27:57 +0800 Subject: [PATCH 2/4] Use image --- .gitlab-ci.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bb7754e56..d28f46ba5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,8 +3,7 @@ stages: - tests .tests: - variables: - SNAPSHOT_NAME: "after-postinstall" + image: stretch:after-postinstall before_script: - apt-get install python-pip -y - pip2 install pytest pytest-sugar pytest-mock requests-mock mock @@ -17,8 +16,7 @@ stages: postinstall: - variables: - SNAPSHOT_NAME: "before-postinstall" + image: stretch:before-postinstall stage: postinstall script: - yunohost tools postinstall -d domain.tld -p the_password --ignore-dyndns From e3a3b00034a77695a2af5a89fa50084d6b1d808b Mon Sep 17 00:00:00 2001 From: Kayou Date: Mon, 23 Dec 2019 20:28:24 +0800 Subject: [PATCH 3/4] Use cache --- .gitlab-ci.yml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d28f46ba5..c52092c5c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,14 +6,24 @@ stages: image: stretch:after-postinstall before_script: - apt-get install python-pip -y - - pip2 install pytest pytest-sugar pytest-mock requests-mock mock + - mkdir -p .pip + - pip install -U pip + - hash -d pip + - pip --cache-dir=.pip install pytest pytest-sugar pytest-mock requests-mock mock - pushd src/yunohost/tests - - git clone https://github.com/YunoHost/test_apps ./apps + - > + 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: + - .pip + - src/yunohost/tests/apps + key: "$CI_JOB_STAGE-$CI_COMMIT_REF_SLUG" postinstall: image: stretch:before-postinstall From dc3e37cc79b8c87f51d20973d926040af61fdaec Mon Sep 17 00:00:00 2001 From: Kayou Date: Thu, 19 Mar 2020 23:01:37 +0100 Subject: [PATCH 4/4] Update image --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c52092c5c..8e3938ad6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,7 +3,7 @@ stages: - tests .tests: - image: stretch:after-postinstall + image: after-postinstall before_script: - apt-get install python-pip -y - mkdir -p .pip @@ -26,7 +26,7 @@ stages: key: "$CI_JOB_STAGE-$CI_COMMIT_REF_SLUG" postinstall: - image: stretch:before-postinstall + image: before-postinstall stage: postinstall script: - yunohost tools postinstall -d domain.tld -p the_password --ignore-dyndns