Hadrien Poquet
Hadrien Poquet

Reputation: 17

Save a file from gitlab-ci to a gitlab repository

I made this citlab-ci.yml file but i can find the html report in my repo at the end.

Can you tell me why ?

image: python

services:
- selenium/standalone-chrome:latest
variables:
  selenium_remote_url: "http://selenium__standalone-chrome:4444/wd/hub"
cucumber:
  script: 
  - python --version
  - pwd
  - ls
  - pip install pytest
  - pip install pytest_bdd 
  - pip install selenium
  - pip install chromedriver
  - pip install pytest-html
  - cd test_pytest
  - ls
  - python -m pytest step_defs/test_web_steps.py --html=report.html

tx Hadrien

Upvotes: 1

Views: 2367

Answers (1)

Miguel Trejo
Miguel Trejo

Reputation: 6667

You can actually generate test reports in gitlab. For this, generate an XML report from Pytest that would be stored in GitLab as an artifact. On your .gitlab-ci.yml file

image: python:3.6

stages: 
    - test

testing:
  stage: test
  when: manual
  script:
    ...
    - pytest --junitxml=report.xml
  artifacts:
    when: always
    reports:
      junit: report.xml

Then, you can download this report enter image description here

or visualize it under the Tests tag of your pipeline.

enter image description here

Upvotes: 2

Related Questions