繁体   English   中英

将文件从 gitlab-ci 保存到 gitlab 存储库

[英]Save a file from gitlab-ci to a gitlab repository

我制作了这个 citlab-ci.yml 文件,但最后我可以在我的仓库中找到 html 报告。

你能告诉我为什么吗?

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

德克萨斯哈德里安

您实际上可以在 gitlab 中生成测试报告 为此,从 Pytest 生成 XML 报告,该报告将作为工件存储在 GitLab 中。 在您的.gitlab-ci.yml文件中

image: python:3.6

stages: 
    - test

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

然后,您可以下载此报告在此处输入图像描述

或在管道的Tests标签下将其可视化。

在此处输入图像描述

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM