Skip to content Skip to sidebar Skip to footer

Running Python Unit Test In Google Cloud Build

I would like Google Cloud Build to run the unit test I have in my python project after pushing the changes. I am able to configure the step that runs the test, but I am not sure h

Solution 1:

  1. Why do you use appengine container? Why not just use an official Python container - name: python:3.7? Steps run as Docker containers, and I see no reason to run Docker in docker when you want to run docker container. Try this:
steps:
  - name: python:3.7
    args: ["python","-m","unittest","discover","--verbose","-s","./package_name/test/","-p","*_test.py"]
    id: unittest
  1. Also, do you have __init__.py file in the directory ./package_name/test? The message directory is not importable usually means that this directory is not a Python package because of missing __init__.py file.

Post a Comment for "Running Python Unit Test In Google Cloud Build"