如何在Jenkins中通过电子邮件发送测试结果 Jmeter 板

xuo3flqw  于 2023-06-05  发布在  Jenkins
关注(0)|答案(2)|浏览(162)

我现在附上我的python脚本的控制台输出,用jenkins发送邮件
有没有什么方法可以使用jenkins将测试结果 Jmeter 板直接发送到电子邮件?
任何帮助都将不胜感激,谢谢

irtuqstp

irtuqstp1#

是你的脚本生成任何HTML报告,如果是,你可以发布在电子邮件正文的HTML。Display HTML page inside mail body with Email-ext plugin in Jenkins

wixjitnu

wixjitnu2#

通过将email-ext插件与Jenkins集成,将其添加到您的管道中。

post {
        fixed {
            emailext body: 'Check console output at $BUILD_URL to view the results. \n\n ${CHANGES} \n\n -------------------------------------------------- \n${BUILD_LOG, maxLines=100, escapeHtml=false}',
                    to: "${EMAIL_TO}",
                    subject: 'FIXED: $PROJECT_NAME - #$BUILD_NUMBER'
        }
        failure {
            emailext body: 'Check console output at $BUILD_URL to view the results. \n\n ${CHANGES} \n\n -------------------------------------------------- \n${BUILD_LOG, maxLines=100, escapeHtml=false}',
                    to: "${EMAIL_TO}",
                    subject: 'FAILED: $PROJECT_NAME - #$BUILD_NUMBER'
        }
        unstable {
            emailext body: 'Check console output at $BUILD_URL to view the results. \n\n ${CHANGES} \n\n -------------------------------------------------- \n${BUILD_LOG, maxLines=100, escapeHtml=false}',
                    to: "${EMAIL_TO}",
                    subject: 'UNSTABLE: $PROJECT_NAME - #$BUILD_NUMBER'
        }
    }

相关问题