Merge pull request #1251 from YunoHost/move-some-tests

Move some tests
This commit is contained in:
Alexandre Aubin 2021-06-10 15:24:47 +02:00 committed by GitHub
commit 3ce978aa2f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 49 additions and 3 deletions

View file

@ -5,6 +5,7 @@ stages:
- tests
- lint
- doc
- translation
default:
tags:

View file

@ -37,6 +37,8 @@ full-tests:
- yunohost tools postinstall -d domain.tld -p the_password --ignore-dyndns --force-diskspace
script:
- python3 -m pytest --cov=yunohost tests/ src/yunohost/tests/ --junitxml=report.xml
- cd tests
- bash test_helpers.sh
needs:
- job: build-yunohost
artifacts: true
@ -48,10 +50,29 @@ full-tests:
reports:
junit: report.xml
root-tests:
test-i18n-keys:
extends: .test-stage
script:
- python3 -m pytest tests
- python3 -m pytest tests tests/test_i18n_keys.py
only:
changes:
- locales/*
test-translation-format-consistency:
extends: .test-stage
script:
- python3 -m pytest tests tests/test_translation_format_consistency.py
only:
changes:
- locales/*
test-actionmap:
extends: .test-stage
script:
- python3 -m pytest tests tests/test_actionmap.py
only:
changes:
- data/actionsmap/*.yml
test-helpers:
extends: .test-stage
@ -159,4 +180,4 @@ test-service:
- python3 -m pytest tests/test_service.py
only:
changes:
- src/yunohost/service.py
- src/yunohost/service.py

View file

@ -0,0 +1,24 @@
########################################
# TRANSLATION
########################################
remove-stale-translated-strings:
stage: translation
image: "before-install"
needs: []
before_script:
- apt-get update -y && apt-get install git hub -y
- git config --global user.email "yunohost@yunohost.org"
- git config --global user.name "$GITHUB_USER"
script:
- cd tests # Maybe move this script location to another folder?
# create a local branch that will overwrite distant one
- git checkout -b "ci-remove-stale-translated-strings-${CI_COMMIT_REF_NAME}" --no-track
- python remove_stale_translated_strings.py
- '[ $(git diff | wc -l) != 0 ] || exit 0' # stop if there is nothing to commit
- git commit -am "[CI] Remove stale translated strings" || true
- git push -f origin "ci-remove-stale-translated-strings-${CI_COMMIT_REF_NAME}":"ci-remove-stale-translated-strings-${CI_COMMIT_REF_NAME}"
- hub pull-request -m "[CI] Remove stale translated strings" -b Yunohost:dev -p || true # GITHUB_USER and GITHUB_TOKEN registered here https://gitlab.com/yunohost/yunohost/-/settings/ci_cd
only:
changes:
- locales/*