gitlab-ci - 如何通过 Fastlane 将测试报告附加到松弛通知
问题描述
我找不到非常简单(恕我直言)设置的解决方案。
在我的 iOS 应用程序中,我使用 Fastlane 通过scan
命令运行测试。这会生成一个非常有用的 xpretty 测试报告 HTML 文件。
我想在测试结束时发送一个松弛通知,并附上我生成的 HTML 测试结果文件的链接。我正在使用一个安装在 minimac 上的运行器的 Gitlab 来运行我的 CI 管道。
到目前为止,我找不到此设置的解决方案。有人能指出我正确的方向吗?
解决方案
我希望您在最近 2 年内已经找到了解决方案。正如评论中所指出的,您可以使用 Slack 的 webhook。然后你可以像这样slack
在你的步骤中运行命令:
platform :ios do
before_all do
ENV["SLACK_URL"] = "https://hooks.slack.com/services/T0A6LPW3A/B5B2SBA13/etc..."
desc "Tests, builds and uploads to iTunesConnect"
lane :appstore do
ENV["LANE_NAME"] = "Flicker"
ENV["BUNDLE_ID"] = "com.epri.fem"
ENV["SCHEME_NAME"] = ENV["LANE_NAME"]
ENV["TEAM_NAME"] = "Electric Power Research Institute"
runConfiguration()
end
def runConfiguration()
slack(
message: ENV["LANE_NAME"] + ") Incoming from branch " + sh("git rev-parse --abbrev-ref HEAD") + " - " + sh("git rev-parse HEAD"),
slack_url: ENV["SLACK_URL"]
)
sigh(team_name: ENV["TEAM_NAME"],
app_identifier: ENV["BUNDLE_ID"],
skip_certificate_verification: true) # Update Provisioing Profiles / Code Signing
slack(
message: "Finished updating provisioing profiles",
default_payloads: [],
slack_url: ENV["SLACK_URL"]
)
scan(
scheme: ENV["SCHEME_NAME"],
slack_url: ENV["SLACK_URL"]
) # run tests
gym(scheme: ENV["SCHEME_NAME"],
clean: true) # build the app
slack(
message: "Finished building app",
default_payloads: [],
slack_url: ENV["SLACK_URL"]
)
pilot(skip_submission: true,
team_name: ENV["TEAM_NAME"]) #upload to test flight
slack(
message: "Finished archiving and uploading to iTunesConnect",
default_payloads: [],
slack_url: ENV["SLACK_URL"]
)
end
error do |lane, exception|
slack(
message: exception.message,
default_payloads: [],
slack_url: ENV["SLACK_URL"]
)
end
推荐阅读
- python - 如何记忆/散列 **kwargs(或一般的字典)以用作键
- javascript - 有没有办法设置适用于 Safari 的 cookie?
- django - Django静态图像显示然后不显示,视图共享静态徽标图像所在的基本Html文件
- python - 多处理功能不停止
- javascript - 组织产品类别 Angular
- javascript - 如何通过变量元素的标签名称找到子元素?
- python - -W 如何与 DeprecationWarning 和 PendingDeprecationWarning 交互?
- amazon-web-services - 对于 AWS 区域内的每个可用区
- c++ - C++ 模板和参数化 Google 测试
- python - Plotly express 运行良好的地图不能作为 Pyinstaller exe 工作