Pour tout problème contactez-nous par mail : support@froggit.fr | La FAQ :grey_question: | Rejoignez-nous sur le Chat :speech_balloon:

Skip to content
Snippets Groups Projects
Commit fb8d54f9 authored by Dorian Turba's avatar Dorian Turba
Browse files

pytest template test

parent 0a935935
No related branches found
No related tags found
No related merge requests found
Pipeline #22062 passed
......@@ -10,12 +10,12 @@ pytest:
stage: templates
variables:
PROJECT_PATH: "tests/pytest_project"
PYTHON_SETUP: "pip install ${PROJECT_PATH} pytest"
only:
changes:
- .gitlab-ci.yml
- pyproject.toml
- templates/python/testing/pytest/**/*
- tests/pytest_project/**/*
flake8:
stage: templates
......
stages:
- code_quality
include:
- remote: 'https://api.r2devops.io/job/r/gitlab/dorianturba/r2devops_catalog/python_install@latest.yaml'
......@@ -19,5 +16,4 @@ flake8:
- ${PROJECT_PATH}/**/*.py
- .gitlab-ci.yml
- ${PROJECT_PATH}/pyproject.toml
- ${PROJECT_PATH}/setup.cfg
- ${PROJECT_PATH}/.flake8
include:
- remote: 'https://api.r2devops.io/job/r/gitlab/dorianturba/r2devops_catalog/python_install@latest.yaml'
pytest:
image: python:${IMAGE_TAG}
stage: test
variables:
IMAGE_TAG: "latest"
IMAGE_TAG: !reference [.python_install, variables, IMAGE_TAG]
PROJECT_PATH: "."
PYTHON_SETUP: "pip install ${PROJECT_PATH}[TESTS]"
script:
- python --version # Debug
- python -m venv venv --upgrade-deps || python -m venv venv # upgrade-deps is not supported before 3.9
- source venv/bin/activate
- ${PYTHON_SETUP}
- !reference [.python_install, script]
- pytest ${PROJECT_PATH}
only:
changes:
- ${PROJECT_PATH}/**/*.py
- .gitlab-ci.yml
- ${PROJECT_PATH}/pyproject.toml
- ${PROJECT_PATH}/pytest.ini
......@@ -17,3 +17,8 @@ testpaths = [
"tests",
"integration",
]
[project.optional-dependencies]
TESTS = [
"pytest",
]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment