Currently I am stuck with trying to configure the gitlab-ci.yml file. Im trying to automatically build and test my python code when I made a commit. At the moment, I just wanted to build a simple hello world program and purposely put a mistake within the python file by misspelling print (printt instead of print). When I commit, the pipeline is run, but it seems to successfully pass the build and test phase (which it shouldn't).
Any help how to properly configure the gitlab-ci.yml file to automatically test python codes?
I've also attached my current gitlab-ci.yml file.
It's dead simple. Here is minimal working example I use in my repo:
pytest:
image: python:3.6
script:
- apt-get update -q -y
- pip install -r requirements.txt
- pip install -r requirements-dev.txt
- pytest # or pytest tests/
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.