Testing: Copy yaml file to build folder

Hi all !

I am trying to run a test which suceeds on my computer but fails on gitlab-ci. This is due to the paths used by gitlab. My tests are in the tests folder and the same folder contains some yaml file to use.
It seems the tests are run from a build folder but the config files are not present there.

My question is:
How can I copy required files to the folder ?
or how can I point to the source folder in order to run the test ? (my software is python based)

I get this error message:

File “/builds/MaralAfris/CashMe/cashme/db_helper.py”, line 86, in yaml_load with open(yaml_file, ‘r’) as d:
FileNotFoundError: [Errno 2] No such file or directory: ‘/builds/MaralAfris/CashMe/tests/test_db_specs.yml’

Here is my gitlab-ci file:
image: debian

before_script:
  - apt-get update && apt-get clean
  - apt-get install --fix-missing -y python-dev python-pip python-setuptools
  - apt-get install --fix-missing -y python3-dev python3-pip python3-setuptools
  - python3 -m pip install -r requirements.txt

tests:
  script:
  - python3 -m unittest discover
 
coverage:
  script:
    - python3 -m pip install coverage
    - python3 -m coverage run -m unittest discover
    - python3 -m coverage report -m
    - python3 -m coverage html
  artifacts:
    paths:
      - htmlcov/
  
pages:
  stage: deploy
  dependencies:
    - coverage
  script:
    - mv htmlcov/ public/
  artifacts:
    paths:
      - public
    expire_in: 30 days
  only:
   - master

By the way, any other improvement suggestion on my CI config is welcome :slight_smile:

Thanks for the help !

MA

Ok my bad, the yml file was unstaged and then did not end up in the build folder…