简体   繁体   English

Jmeter 仪表板为空 Jenkins HTML 报告发布

[英]Jmeter Dashboard empty on Jenkins HTML report publish

I'm successfully generating a jmeter dashboard through maven jmeter plug in. I have this build configured on Jenkins to run and it also generates the dashboard successfully with all graphs/data showing. I'm successfully generating a jmeter dashboard through maven jmeter plug in. I have this build configured on Jenkins to run and it also generates the dashboard successfully with all graphs/data showing. I now try to publish this dashboard with the HTML publisher so it can be accessed from the Jenkins build.我现在尝试使用 HTML 发布者发布此仪表板,以便可以从 Jenkins 构建中访问它。 The plugin works correctly and moves the generated dashboard with all necessary folders/files to the archive location and displays a link on the build page to the index.html.该插件正常工作,并将生成的仪表板与所有必要的文件夹/文件移动到存档位置,并在构建页面上显示指向 index.html 的链接。

If I click that link however it opens the index page but everything is empty...just showing the headings/navigation eg: Empty dashboard through jenkins .如果我单击该链接,但它会打开索引页面,但一切都是空的……只显示标题/导航,例如:通过 jenkins 清空仪表板 If I open the exact same dashboard index page through the build server machine it displays fine and everything shows up and works.如果我通过构建服务器机器打开完全相同的仪表板索引页面,它会显示正常,并且一切都会显示并正常工作。

I've added the following to jenkins.xml in hopes it is a css etc. permission issue:我已将以下内容添加到 jenkins.xml 中,希望它是 css 等权限问题:

-Dhudson.model.DirectoryBrowserSupport.CSP= -Dhudson.model.DirectoryBrowserSupport.CSP=

But that did not do anything.但这并没有做任何事情。

Any ideas why the jmeter dashboard report might not be displaying correctly through Jenkins but does when access directly through the server?任何想法为什么 jmeter 仪表板报告可能无法通过 Jenkins 正确显示,但在直接通过服务器访问时会正确显示? As a side note, I'm also publishing jacoco and surefire reports the exact same way and they display fine.作为旁注,我还以完全相同的方式发布 jacoco 和 surefire 报告,并且它们显示良好。 I'm also using the performance plug in and that also pulls the data and shows some graphs from jmeter as well...but I'd like the nice dashboard to work, too.我也在使用性能插件,它还提取数据并显示来自 jmeter 的一些图表......但我也希望漂亮的仪表板也能工作。

Thanks!谢谢!

To solve this, go to Manage Jenkins, Script Console section and type this command:要解决此问题,请转到“管理 Jenkins”、“脚本控制台”部分并键入以下命令:

System.setProperty("hudson.model.DirectoryBrowserSupport.CSP", "") System.setProperty("hudson.model.DirectoryBrowserSupport.CSP", "")

Press Run.按运行。 After that run your build again and now you should be able to see generated dashboard...之后再次运行您的构建,现在您应该能够看到生成的仪表板...

I had the same issue, that the dasboard of the jMeter-report was empty while accessing the dasboard unsing Firefox.我遇到了同样的问题,在访问 Firefox 的 dasboard 时,jMeter-report 的 dasboard 是空的。 While using Internet-Explorer and Chrome, the report was visible.在使用 Internet-Explorer 和 Chrome 时,报告是可见的。

The solution and problem was, that we accessed the html-report using the ip adress of the jenkins-server and not the fqdn.解决方案和问题是,我们使用 jenkins-server 的 IP 地址而不是 fqdn 访问了 html-report。 After using the fqdn the report was accessible with Firefox as well.使用 fqdn 后,Firefox 也可以访问该报告。

For autostart create a Groovy script file $JENKINS_HOME/init.groovy , or any .groovy file in the directory $JENKINS_HOME/init.groovy.d/ with the following content:对于自动启动,创建一个 Groovy 脚本文件$JENKINS_HOME/init.groovy ,或目录$JENKINS_HOME/init.groovy.d/中的任何.groovy文件,其内容如下:

System.setProperty("hudson.model.DirectoryBrowserSupport.CSP", "sandbox allow-scripts; default-src 'self'; img-src *; style-src 'self' 'unsafe-inline'; script-src * 'unsafe-inline';")

systemctl restart jenkins systemctl 重启詹金斯

https://wiki.jenkins.io/display/JENKINS/Post-initialization+script https://wiki.jenkins.io/display/JENKINS/Post-initialization+script

I had a different issue.我有一个不同的问题。 I was only able to see the report results when I downloaded the entire zip directory file from the Jenkins artifact page and unzip on my windows workstation.当我从 Jenkins 工件页面下载整个 zip 目录文件并在我的 Windows 工作站上解压缩时,我只能看到报告结果。 The report showed all of the data.报告显示了所有数据。

Thanks below worked感谢以下工作

System.setProperty("hudson.model.DirectoryBrowserSupport.CSP", "") System.setProperty("hudson.model.DirectoryBrowserSupport.CSP", "")

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM