From 96d5997d3d28dfa033c2c2982c9625b123887171 Mon Sep 17 00:00:00 2001 From: Piyush Garg Date: Fri, 24 Jul 2020 15:53:08 +0530 Subject: [PATCH] Fix pytest and pylint task This will the fix the pytest and pylint task which fails if run as non root user in case of non-root user, it install at location which is not in PATH of image so adding the required PATH fix the issue --- task/pylint/0.1/pylint.yaml | 7 ++++--- task/pytest/0.1/pytest.yaml | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/task/pylint/0.1/pylint.yaml b/task/pylint/0.1/pylint.yaml index c8250d6e..54966eac 100644 --- a/task/pylint/0.1/pylint.yaml +++ b/task/pylint/0.1/pylint.yaml @@ -39,6 +39,7 @@ spec: image: docker.io/python:$(inputs.params.PYTHON) workingDir: /workspace/source script: | - pip install -r $(inputs.params.SOURCE_PATH)/$(inputs.params.REQUIREMENTS_FILE) - pip show pylint || echo "###\nWarning: Pylint is missing in your requirements\n###" && pip install pylint - pylint $(inputs.params.ARGS) $(inputs.params.MODULE_PATH) + export PATH=$PATH:$HOME/.local/bin + pip install -r $(inputs.params.SOURCE_PATH)/$(inputs.params.REQUIREMENTS_FILE) + pip show pylint || echo "###\nWarning: Pylint is missing in your requirements\n###" && pip install pylint + pylint $(inputs.params.ARGS) $(inputs.params.MODULE_PATH) diff --git a/task/pytest/0.1/pytest.yaml b/task/pytest/0.1/pytest.yaml index f8e4cdbc..2efa20b1 100644 --- a/task/pytest/0.1/pytest.yaml +++ b/task/pytest/0.1/pytest.yaml @@ -36,6 +36,7 @@ spec: image: docker.io/python:$(inputs.params.PYTHON) workingDir: /workspace/source script: | - pip install -r $(inputs.params.SOURCE_PATH)/$(inputs.params.REQUIREMENTS_FILE) - pip show pytest || echo "###\nWarning: Pytest is missing in your requirements\n###" && pip install pytest - pytest $(inputs.params.ARGS) $(inputs.params.SOURCE-PATH) + export PATH=$PATH:$HOME/.local/bin + pip install -r $(inputs.params.SOURCE_PATH)/$(inputs.params.REQUIREMENTS_FILE) + pip show pytest || echo "###\nWarning: Pytest is missing in your requirements\n###" && pip install pytest + pytest $(inputs.params.ARGS) $(inputs.params.SOURCE-PATH)