In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces the knowledge of "how Jenkins uses publish html report plug-ins to display HTML reports". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Install the plug-in
Manage Jenkins-- > Manage Plugins-- > optional plug-ins-- > search publish html repor
Description: the screenshot shows that the plug-in has been installed, so in the installed
Prepare to test the code
Create a new test_01.py with the following code
Install python package: pip install pytest-html
#-*-coding: utf-8-*-# @ Time: 2021 @ Author: Dahai # @ File: test_40.pyimport osdef test_add (): C = 1 + 2 assert c = = 2if _ name__ = ='_ _ main__': os.system ('pytest-s test_02.py-- html=report.html-- self-contained-html')
Pipeline
Pipeline {agent any stages {stage ('checkout code') {steps {checkout ([$class:' GitSCM', branches: [[name:'* / Branch']], extensions: [], userRemoteConfigs: [[credentialsId: 'authentication information' Url: 'your warehouse address'])} stage ('auto test') {steps {bat' python test_01.py'} post {always {/ / reportDir report directory The name of the reportFiles report; the name of the reportName displayed in the Jenkins menu bar; and the Title publishHTML displayed in the reportTitles test report ([allowMissing: true, alwaysLinkToLastBuild: true, keepAll: false, reportDir:'. /', reportFiles: 'report.html', reportName:' test report', reportTitles: 'test report'])}} view the report
Menu list on the left, click Test report
The resolution report has no style.
Official website description: https://www.jenkins.io/doc/book/security/configuring-content-security-policy/
Click the Mange Jenkins page to find Script Console
Run the following script
System.setProperty ("hudson.model.DirectoryBrowserSupport.CSP", "")
Shift + f5 refresh the page many times (unsuccessful), you can clear the browser history, re-enter there will be a CSS style
That's all for "how Jenkins uses the publish html report plug-in to present the HTML report". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.