У меня есть тесты, которые работают на Дженкинс. - Робот Framework Тесты. Они бегают по расписанию, но никто не смотрит.
Я хотел посмотреть, есть ли механизм, с помощью которого я мог бы сообщать результаты в свободный канал, когда задание завершает выполнение тестов.
def branch = "branchName"
node ('AWS-LoadTest') {
stage ('Checkout') {
cleanWs()
checkout([$class: 'GitSCM', branches: [[name: branch]], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: '9999999-99999999', url: 'git@github.com:Abcd/abc.git']]])
}
stage ('Execute Tests'){
def colorCode = '#FF0000'
def buildStatus = 'FAILURE'
String slackChannel='#slackChannelName'
try {
bat """
robot -d outputs --variable ENV:prod -i production TestAutomation/RobotTests/testsuites/test.robot
"""
buildStatus = 'SUCCESS'
colorCode = '#00FF00'
} catch (e) {
colorCode = '#FF0000'
def summary = "${buildStatus}: Production Health Check Test, ${env.BUILD_URL}",
slackSend(channel: slackChannel, color: 'danger', message: """)
}
finally {
step([
$class : 'RobotPublisher',
outputPath : 'outputs/',
outputFileName : "*.xml",
disableArchiveOutput : false,
passThreshold : 100,
unstableThreshold: 80.0,
otherFiles : "*.png" ])
}
}
}