unit-testing - 如何在 GitHub Actions 中配置 dotnet-tests-report?
问题描述
我有一些使用 Azure Devops 的经验,而且我刚刚开始使用 GitHub Actions。
我的项目包括可以使用此操作进行测试的自动化测试。
但是,我认为我应该能够做到以下几点:
- 将测试配置为在发布模式下构建和运行。
- 如果测试失败,则使作业失败。
我发现保持简单很重要,因此我不想切换到此处描述的解决方案,因为这意味着创建多个操作并要求我的同事下载工件以查看测试结果。
我怎样才能制作出这些漂亮的测试报告,但仍然能够配置它?
解决方案
这一切都在动作定义中描述:
[...]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: use this action, test solution dir
uses: zyborg/dotnet-tests-report@v1
with:
project_path: tests/My.Project.Tests
report_name: my_project_tests
report_title: My Project Tests
github_token: ${{ secrets.GITHUB_TOKEN }}
# If set to true, the build will fail if at least one test fails
fail_build_on_failed_tests: true
# the configuration passed to the msbuild process, such as `Release` or `Debug`.
msbuild_configuration: Release
推荐阅读
- javascript - 无法获取/错误 Node.js
- webpack - Webpack 4: css-loader + file-loader 在构建过程中添加字体及其样式表
- python - pandas DataFrame.to_html 将 html 表中的负数更改为红色
- database - 如何从 csv 只更新数据库中的两个列而不使用 python 和 sqlite3 触及其他列中的数据?
- python - 数组中的 Bisection_method - numpy
- python - Keras:load_model ValueError:轴与数组不匹配
- elixir - 当有 2 个过去版本 ditillery elixir phoenix 时,热升级中断
- sqlalchemy - 多处理、sqlAlchemy 和 scoped_sessions
- javascript - 修复 NaN 错误
- python - 方法对象不可下标