mirror of
https://github.com/tektoncd/catalog.git
synced 2024-11-22 06:02:51 +00:00
bddd282012
Centralize all the the git-clone apply commands we had around the pre-apply-task-hook to a central common function. This will make easier to have the same git-clone task version used everywhere. Add some documentation about the helper functions along the way. Signed-off-by: Chmouel Boudjnah <chmouel@redhat.com> |
||
---|---|---|
.. | ||
tests | ||
pytest.yaml | ||
README.md |
pytest
The task provides test execution based on pytest for Python. The used images are based on the official Docker Hub Python images. The installation of the packages is performed via a pip install
.
It is required that pytest
is part of the requirements file for the task. If the module is not included a warning will be printed.
Install the Task
Workspaces
- source: A Workspace volume containing the python code.
Install pytest
kubectl apply -f https://raw.githubusercontent.com/tektoncd/catalog/master/task/pytest/0.1/pytest.yaml
Parameters
- PYTHON: The used Python version, more precisely the tag for the Python image (default:
3.6
) - ARGS: The additional arguments to be used with pytest
- SOURCE_PATH: The path to the source code (default:
.
) - REQUIREMENTS_FILE: The name of the requirements file inside the source location (default:
requirements.txt
)
Usage
This TaskRun
runs pytest
on a repository.
apiVersion: tekton.dev/v1beta1
kind: TaskRun
metadata:
name: pytest
spec:
taskRef:
name: pytest
workspaces:
- name: source
persistentVolumeClaim:
claimName: my-source
params:
- name: PYTHON
value: "3.7"
- name: ARGS
value: "-rfs"