Why can't CircleCi find my tests?

See the repo structure below. I want to run tests in root / app2 / tests /. I am using py.test.

After CircleCi was unable to automatically dump the test directory, I added the circle.yml file to the root directory, but still no tests were found. Any help is greatly appreciated.

circle.yml file content:

general:
  build_dir: app2/tests

      

Storage structure:

root
├── circle.yml
├── app1
│   ├── xxx
│   ├── yyy
└── app2
    ├── src
    ├── tests
        |-- test_module_1.py
        |-- test_module_2.py

      

+3


source to share


2 answers


Ok with CircleCI I figured out how to use py.test with CircleCI:

In the file circle.yml

add:

test:
    override:
        - py.test <optional path to subdir with tests>

dependencies:
    pre:
       -  pip install pytest

      

If your code uses multiple packages in addition to py.test, you can create a requirements.txt file:



pip freeze > requirements.txt

      

place your requirements.txt file in the same directory as your circle.yml file (or in your build_dir file if you specified it in your circle.yml file) and add to circle.yml:

dependencies:
      pre:
         -  pip install -r requirements.txt

      

+5


source


In general, to install build_dir

only to the application directory, take good care to find the tests subdirectory yourself.

Could you try replacing your current command in circle.yml

with this?



general:
  build_dir: app2

      

0


source







All Articles