1

I get the following error when running an azure pipeline. enter image description here

Here is the pytest part of my pipelines yaml file.

 steps:
  #test
  - task: UsePythonVersion@0
    inputs:
      versionSpec: '$(python.version)'
    displayName: 'Use Python $(python.version)'

  #test
  - script: |
      python -m pip install --upgrade pip
      python -m pip install wheel
      pip install -r requirements.txt
    condition: ne(variables.CACHE_RESTORED, 'true')
    displayName: 'Install dependencies'
  #test
  - script: |
      python -m spacy download de_core_news_sm
      python -m spacy download de_core_news_md
  #test
  - script: |
      pip install pytest pytest-azurepipelines
      pytest
    displayName: 'pytest'

The file tat_core/criteria/checks/zw2n_test.py does not exist on my local copy of the repository. I deleted it.

How can I tell the pipeline that the file does not exist and the test does not have to be run? I assume there is some kind of caching indicated by the path /opt/hostedtoolscache. Can I empty this cache?

Osvald Laurits
  • 1,228
  • 2
  • 17
  • 32

2 Answers2

1

You can try to remove the '__init__.py' file form your project to see if it can work, like as mentioned in this topic.

In addition, please also try the pytest for the same project on your local machine to see if the same issue occurs.

Bright Ran-MSFT
  • 5,190
  • 1
  • 5
  • 12
0

I added the module 'zahlwort2num' to requirements.txt. The pipeline runs now. Unused dependency in requirements.txt is a drawback.

Osvald Laurits
  • 1,228
  • 2
  • 17
  • 32