简体   繁体   English

Gatling index.html 报告发布后在 AZure Devops 中未正确加载

[英]Gatling index.html report not loading properly in AZure Devops after publishing

Image of the Gatling index.html report not loading properly : Gatling index.html 报告未正确加载的图像

点击这里参考

This file is meant to be loaded from your local disk on your local desktop/laptop, not from a web server.此文件旨在从本地台式机/笔记本电脑上的本地磁盘加载,而不是从 web 服务器加载。

If you're looking for online reports for Gatling, you could consider FrontLine .如果您正在寻找有关 Gatling 的在线报告,您可以考虑FrontLine It's also available on the Azure Marketplace.它也可在 Azure 市场上获得。

I could reproduce the same issue when I publish the Index.html file in azure devops.当我在 azure devops 中发布 Index.html 文件时,我可以重现同样的问题。

在此处输入图像描述

When I check the source code of the Index.html file, I notice that this file needs to call the style from the style and js folder.当我查看 Index.html 文件的源代码时,我注意到该文件需要从 style 和 js 文件夹中调用样式。

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link rel="shortcut icon" type="image/x-icon" href="style/favicon.ico"/>
<link href="style/style.css" rel="stylesheet" type="text/css" />
<link href="style/bootstrap.min.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/jquery-3.5.1.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/gatling.js"></script>
<script type="text/javascript" src="js/moment-2.24.0.min.js"></script>
<script type="text/javascript" src="js/menu.js"></script>
<script type="text/javascript" src="js/all_sessions.js"></script>
<script type="text/javascript" src="js/stats.js"></script>
<script type="text/javascript" src="js/highstock.js"></script>
<script type="text/javascript" src="js/highcharts-more.js"></script>
<script type="text/javascript" src="js/theme.js"></script>
<script type="text/javascript" src="js/unpack.js"></script>
<title>Gatling Stats - Global Information</title>
</head>

When you only publish the index.html page, it cannot find the referenced style, so this problem occurs.只发布index.html页面时,找不到引用的样式,所以出现这个问题。

To view the correct content of the index.html, you need to publish the result as build artifacts in Azure Devops.要查看 index.html 的正确内容,您需要将结果作为构建工件发布到 Azure Devops 中。

steps:
- task: Maven@3
  displayName: 'Maven pom.xml'
  inputs:
    goals: 'mvn gatling:test'

- powershell: 'mvn gatling:test'
  workingDirectory: '$(build.sourcesdirectory)'
  displayName: 'PowerShell Script'

- task: PublishBuildArtifacts@1
  displayName: 'Publish Artifact: drop'
  inputs:
    PathtoPublish: '$(Build.sourcesdirectory)/filepath'

在此处输入图像描述

Then you could download the artifacts to your local machine.然后您可以将工件下载到本地计算机。

在此处输入图像描述

All in all, in azure devops, there is no method to load the referenced style in build tab(eg Published Html), so you can only download it locally for viewing.总而言之,在azure devops中,没有办法在build选项卡中加载引用的样式(例如Published Html),所以只能下载到本地查看。

Update1:更新1:

在此处输入图像描述

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

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