Allure Report 生成器使用教程

Allure Report 生成器使用教程

allure-report-actionAllure Report action with history项目地址:https://gitcode.com/gh_mirrors/al/allure-report-action

1、项目介绍

Allure Report 是一个灵活的、轻量级的测试报告工具,能够为测试结果生成清晰、有吸引力的报告。simple-elf/allure-report-action 是一个 GitHub Action,用于在 GitHub 工作流中自动生成 Allure 报告,并支持历史报告的保留。

2、项目快速启动

安装步骤

在你的 GitHub 仓库中,创建或编辑 .github/workflows/ci.yml 文件,添加以下内容:

name: CI
on: [push]
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout code
      uses: actions/checkout@v2

    - name: Run tests
      run: ./run-tests.sh

    - name: Generate Allure Report
      uses: simple-elf/allure-report-action@v1.9
      with:
        allure_results: 'allure-results'
        allure_report: 'allure-report'
        gh_pages: 'gh-pages'
        allure_history: 'allure-history'

    - name: Deploy report to GitHub Pages
      uses: peaceiris/actions-gh-pages@v2
      with:
        github_token: ${{ secrets.GITHUB_TOKEN }}
        publish_dir: 'allure-history'

配置说明

  • allure_results: Allure 测试结果的目录路径。
  • allure_report: 生成的 Allure 报告的目录路径。
  • gh_pages: GitHub Pages 分支的目录路径。
  • allure_history: 历史报告的目录路径。

3、应用案例和最佳实践

应用案例

假设你有一个 Java 项目,使用 JUnit 进行测试。你可以通过以下步骤集成 Allure 报告:

  1. 在项目中添加 Allure 依赖。
  2. 配置测试运行器以生成 Allure 结果。
  3. 在 GitHub Actions 中使用上述配置生成和部署报告。

最佳实践

  • 定期清理历史报告:为了节省存储空间,建议定期清理旧的历史报告。
  • 自定义报告模板:根据项目需求,自定义 Allure 报告的模板和样式。
  • 集成其他工具:将 Allure 报告与其他 CI/CD 工具集成,如 Jenkins、GitLab CI 等。

4、典型生态项目

Allure Report 可以与多种测试框架和工具集成,以下是一些典型的生态项目:

  • JUnit:Java 项目的测试框架。
  • pytest:Python 项目的测试框架。
  • Selenium:Web 自动化测试工具。
  • Jenkins:持续集成和持续部署工具。

通过这些集成,Allure Report 能够为不同类型的项目提供全面的测试报告解决方案。

allure-report-actionAllure Report action with history项目地址:https://gitcode.com/gh_mirrors/al/allure-report-action

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

甄墨疆

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值