当有需求要在k8s上透过drone定期跑godog进行BDD测试,并将测试结果推送到mattermost时,怎麽办呢?
首先需求拆解:
在BDD专案内,制作你的pipeline
以下以Drone为范例
kind: pipeline
type: kubernetes
name: bdd
steps:
- name: godog solo basic.feature
image: rain123473/godog:v0.11.0
commands:
- cd solo
- godog run features/basic.feature
- name: send notification
when:
status:
- success
image: plugins/slack
settings:
webhook:
from_secret: bdd
channel: ithome-bdd
username: drone
icon_url: https://img.icons8.com/color/2x/good-pincode.png
template: >
[DEV] BDD test build {{build.link}} succeeded. Good job.
- name: send failure notification
when:
status:
- failure
image: plugins/slack
settings:
webhook:
from_secret: bdd
channel: ithome-bdd
username: drone
icon_url: https://img.icons8.com/color/2x/high-priority.png
template: >
{{#success build.status}}
[DEV] BDD test build {{build.link}} succeeded. Good job.
{{else}}
[DEV] BDD build {{build.link}} failed. Fix me please.
{{/success}}
在drone yaml设定,可以使用
when:
status:
来绑定此step的状态,所以可以从step
看得出来唷!
再次提醒一下
Cron Jobs 的时区是依照 UTC(Universal Time Coordinated),所以需要自己在转换一下时间
若你的需求是要台湾时间22:00~04:00,每小时触发的话,不能打22-04
唷!要改成14-20
才正确!
drone cron add "my/bdd-repo" "bdd-nighty-test" "0 0 14-20 * * *" --branch master
之後就能在Mattermost该channel内看到效果罗
---
以上就完成上述之需求(在k8s上透过drone定期跑godog进行BDD测试,并将测试结果推送到mattermost)了,今天就这样子拉~
<<: 冒险村19 - Activerecord-import
>>: [Day20] Flutter GetX routing
选择器(Selector)是指用来选择HTML中,哪些内容要套上的样式。 依据对象的不同有不同的写法...
在ML的专案中,从资料的收集、建构模型、测试到部署到产品。这个流程除了需要自动化之外,也需要保有该行...
# -*- coding: utf-8 -*- import cv2 import numpy as...
大家好~上次文章介绍了录音录影的功能,这次要来弄个多人视讯聊天室,竟然我们已经知道怎麽取得影音档案,...
今天的目标: 当要整理 Google Drive 时,会发现好多的档案、文件不确定哪个要怎麽做。一个...