This is my first time using Bitbucket Pipeline to build a python program. The code I have is this:
image: python:3.8.11
pipelines:
default:
- step:
name: Install dependencies
script:
- if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- step:
name: PyTest
script:
- pip install pytest
- pytest -v tests/* --junitxml=test-reports\report.xml
- step:
name: Unit test
script:
- python -m unittest discover tests-reports/
- step:
name: Django test
script:
- pip install django
- python manage.py test
- step:
name: Lint code
script:
# Enforce style consistency across Python projects https://flake8.pycqa.org/en/latest/manpage.html
- pip install flake8
- flake8 . --extend-exclude=dist,build --show-source --statistics
The first step "Install dependencies" passes. But the second step "PyTest" fails. Here is the error message:
+ pytest -v tests/* --junitxml=test-reports\report.xml
============================= test session starts ==============================
platform linux -- Python 3.8.11, pytest-6.2.4, py-1.10.0, pluggy-0.13.1 -- /usr/local/bin/python
cachedir: .pytest_cache
rootdir: /opt/atlassian/pipelines/agent/build
collecting ... collected 0 items
- generated xml file: /opt/atlassian/pipelines/agent/build/test-reportsreport.xml -
============================ no tests ran in 0.00s =============================
ERROR: file or directory not found: tests/*
I am not sure what is going on with pipeline and deployment as I am new to the process. Can anyone let me know how to resolve this?