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: ...@@ -10,12 +10,12 @@ pytest:
stage: templates stage: templates
variables: variables:
PROJECT_PATH: "tests/pytest_project" PROJECT_PATH: "tests/pytest_project"
PYTHON_SETUP: "pip install ${PROJECT_PATH} pytest"
only: only:
changes: changes:
- .gitlab-ci.yml - .gitlab-ci.yml
- pyproject.toml - pyproject.toml
- templates/python/testing/pytest/**/* - templates/python/testing/pytest/**/*
- tests/pytest_project/**/*
flake8: flake8:
stage: templates stage: templates
......
stages:
- code_quality
include: include:
- remote: 'https://api.r2devops.io/job/r/gitlab/dorianturba/r2devops_catalog/python_install@latest.yaml' - remote: 'https://api.r2devops.io/job/r/gitlab/dorianturba/r2devops_catalog/python_install@latest.yaml'
...@@ -19,5 +16,4 @@ flake8: ...@@ -19,5 +16,4 @@ flake8:
- ${PROJECT_PATH}/**/*.py - ${PROJECT_PATH}/**/*.py
- .gitlab-ci.yml - .gitlab-ci.yml
- ${PROJECT_PATH}/pyproject.toml - ${PROJECT_PATH}/pyproject.toml
- ${PROJECT_PATH}/setup.cfg
- ${PROJECT_PATH}/.flake8 - ${PROJECT_PATH}/.flake8
include:
- remote: 'https://api.r2devops.io/job/r/gitlab/dorianturba/r2devops_catalog/python_install@latest.yaml'
pytest: pytest:
image: python:${IMAGE_TAG} image: python:${IMAGE_TAG}
stage: test stage: test
variables: variables:
IMAGE_TAG: "latest" IMAGE_TAG: !reference [.python_install, variables, IMAGE_TAG]
PROJECT_PATH: "." PROJECT_PATH: "."
PYTHON_SETUP: "pip install ${PROJECT_PATH}[TESTS]" PYTHON_SETUP: "pip install ${PROJECT_PATH}[TESTS]"
script: script:
- python --version # Debug - !reference [.python_install, script]
- python -m venv venv --upgrade-deps || python -m venv venv # upgrade-deps is not supported before 3.9
- source venv/bin/activate
- ${PYTHON_SETUP}
- pytest ${PROJECT_PATH} - pytest ${PROJECT_PATH}
only: only:
changes: changes:
- ${PROJECT_PATH}/**/*.py - ${PROJECT_PATH}/**/*.py
- .gitlab-ci.yml - .gitlab-ci.yml
- ${PROJECT_PATH}/pyproject.toml - ${PROJECT_PATH}/pyproject.toml
- ${PROJECT_PATH}/pytest.ini
...@@ -17,3 +17,8 @@ testpaths = [ ...@@ -17,3 +17,8 @@ testpaths = [
"tests", "tests",
"integration", "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