Generating a faulty report when running JMeter 3.0 test with Ant - html

I have been at it for days. Basically I want to create a HTML report from JMeter test file, using Ant. I am using Linux Ubuntu 16.04.1. Here is my build.xml :
<project name="performance-tests" default="run-performance-tests" basedir=".">
<property name="testpath" value="${user.dir}"/>
<poperty name="jmeter.home" value="/home/richard/Asjad/apache-jmeter-3.0"/>
<!-- Name of test (without .jmx) -->
<property name="test" value="Test"/>
<path id="jmeter.path">
<fileset dir="${basedir}" includes="/*.jar" />
</path>
<target name="run-performance-tests">
<delete dir="${basedir}/target" quiet="true" failonerror="false"/>
<mkdir dir="${basedir}/target"/>
<!-- Allow jar to be picked up locally -->
<path id="jmeter.classpath">
<fileset dir="${basedir}">
<include name="ant-jmeter*.jar"/>
</fileset>
</path>
<taskdef name="jmeter"
classpathref="jmeter.classpath"
classname="org.programmerplanet.ant.taskdefs.jmeter.JMeterTask" />
<echo message="Running load tests in testing.xml"/>
<jmeter
jmeterhome="${jmeter.home}"
testplan ="${testpath}/${test}.jmx"
resultlog="${basedir}/target/JMeterResults.xml">
<jvmarg value="-Xincgc"/>
<jvmarg value="-Xmx512m"/>
<jvmarg value="-Dproperty=value"/>
<property name="request.threads" value="5"/>
<property name="request.loop" value="50"/>
<property name="jmeter.save.saveservice.assertion_results" value="all"/>
<property name="jmeter.save.saveservice.output_format" value="xml"/>
</jmeter>
<xslt in="${basedir}/target/JMeterResults.xml"
out="${basedir}/target/Test.html"
style="${basedir}/jmeter-results-detail-report.xsl"/>
</target>
This is what I see when I run the script:
Buildfile: /home/richard/Asjad/apache-jmeter-3.0/extras/build.xml
run-performance-tests:
[delete] Deleting directory /home/richard/Asjad/apache-jmeter-3.0/extras/target
[mkdir] Created dir: /home/richard/Asjad/apache-jmeter-3.0/extras/target
[echo] Running load tests in testing.xml
[jmeter] Executing test plan: /home/richard/Asjad/apache-jmeter-3.0/extras/TestPlan/Test.jmx ==> /home/richard/Asjad/apache-jmeter-3.0/extras/target/JMeterResults.xml
[jmeter] Java HotSpot(TM) 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release
[jmeter] Writing log file to: /home/richard/Asjad/apache-jmeter-3.0/bin/jmeter.log
[jmeter] Creating summariser <summary>
[jmeter] Created the tree successfully using /home/richard/Asjad/apache-jmeter-3.0/extras/TestPlan/Test.jmx
[jmeter] Starting the test # Fri Jul 29 11:57:25 EEST 2016 (1469782645099)
[jmeter] Waiting for possible Shutdown/StopTestNow/Heapdump message on port 4445
[jmeter] summary = 10 in 00:00:02 = 4.6/s Avg: 214 Min: 105 Max: 344 Err: 0 (0.00%)
[jmeter] Tidying up ... # Fri Jul 29 11:57:27 EEST 2016 (1469782647345)
[jmeter] ... end of run
[xslt] Processing /home/richard/Asjad/apache-jmeter-3.0/extras/target/JMeterResults.xml to /home/richard/Asjad/apache-jmeter-3.0/extras/target/Result_One.html
[xslt] Loading stylesheet /home/richard/Asjad/apache-jmeter-3.0/extras/jmeter-results-detail-report.xsl
BUILD SUCCESSFUL
Total time: 3 seconds
The build succeeds and then it gives me a HTML file and when I open it I see this:
HTML report
I would be really thankful if someone could at least tell me my mistake or direction I am supposed to go.

It looks like JMeter developers broke jmeter-results-detail-report.xsl file, bug was reported here:
https://bz.apache.org/bugzilla/show_bug.cgi?id=59918
It will be fixed in next Apache JMeter version 3.1.
In order to revert to previous behaviour take the following steps:
Download apache-jmeter-2.13.zip
Extract jmeter-results-detail-report_21.xsl file from apache-jmeter-2.13/extras folder and drop it to "extras" folder of your JMeter 3.0 installation
Modify your build.xml file to use jmeter-results-detail-report_21.xsl file like:
<xslt in="${basedir}/target/JMeterResults.xml"
out="${basedir}/target/Test.html"
style="${basedir}/jmeter-results-detail-report_21.xsl"/>
Alternatively you can get XSLT file i.e. from here
See Visualizing JMeter .jtl Files Viewed as An .xsl Stylesheet article for more details on transforming JMeter XML result files to HTML format.

It's a bug that I reported here:
https://bz.apache.org/bugzilla/show_bug.cgi?id=59918
It will be fixed in next Apache JMeter version 3.1 or 3.0.1.
You can test if it's ok by using nightly build present here:
http://jmeter.apache.org/nightly.html
Why still use Ant + xslt to generate a report while since 3.0 you have a new web report with lots of dynamic graphsand tables with significant metrics.
See :
https://jmeter.apache.org/usermanual/generating-dashboard.html

Related

How to do IIS Deployment with XML Transformation in Azure-DevOPS Release pipeline?

How to create a release pipeline for IIS Deployment with XML Transformation
I create a build pipeline in azure devops.I am planning to create a release pipeline which needs to deploy the build in 3 IIS Websites(DEV,QA,STAG) to on Premise Servers (iam not using Azure servers)
As per my research, i created 3 configs in the application with their environment specific values in each config
When i use the IIS Deploy task,i have an option to select the xml transformation.How does the xml transformation works?
Xml transformation takes effect only when the configuration file(web.config) and transform file(web.stage.config) are in the same folder within the specified package. For more information you can check this official site
The transform file is an XML file that specifies how the Web.config file should be changed when it is deployed. For its syntax you can check this(https://learn.microsoft.com/en-us/previous-versions/aspnet/dd465326(v=vs.110))
So in your case, Firstly you should specify a configuration file (eg. Web.config) and three transform files, the transform file should be named after its environment configuration(eg. web.dev.config, web.qa.config, web.stag.config).
In the these three transform files, specify the elements and attributes that need to be transformed with XDT syntax(check above syntax link)(XML-Document-Transform).
Secondly: you should create three stages named dev, qa, stag respectively in your release pipeline.
Thirdly: enable XML transformation of IIS Web App Deploy task for each stage.
Hope you can find above helpful?
Refer to these steps below:
Step 1: Create a Asp.net Web Application (Name:SalesDemo)
Step 2.1: Create Nested Configs (e.g. web.SalesDemoQA.config, web.SalesDemoStag.config,web.SalesDemoProd.config), Copy to Output Directory: Always)
Sept 2. 2 open your csproj file in a text editor and check the following
<None Include="web.SalesDemoQA.config">
<DependentUpon>web.config</DependentUpon>
</None>
change the above code to the below code
<Content Include="web.SalesDemoQA.config">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content >
Step 2.3 Sample code in web.SalesDemoQA.config
<connectionStrings>
<add name="SalesDemo" connectionString="Data Source=ReleaseSQLServer;Initial Catalog=SalesDemoDBQA;Integrated Security=True"
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
</connectionStrings>
Step 3: Login to Azure DevOPS site
Step 4: Create Build Pipeline
Step 4.1: Select a Repsotiory
Step 4.2: Select a Template (Asp.net Template)
Sep 4.3 msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:TransformWebConfigEnabled=False /p:AutoParameterizationWebConfigConnectionStrings=False /p:PackageLocation="$(build.artifactstagingdirectory)\\"'
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
Note: I added the following additional parameters in the msBuildArgs
/p:TransformWebConfigEnabled=False /p:AutoParameterizationWebConfigConnectionStrings=False
Step 4.4: Publish Build Artifacts
Step 5 Create a Release pipeline
Step 5.1:Create a Stage Name:(SalesDemoQA)
Step 5.2 :Create IIS Web App Manage Task
Step 5.3 :Create IIS Web App Deploy Task
Step 5.4 :Set the (Package or Folder: $(System.DefaultWorkingDirectory)/_SalesDemo/drop/SalesDemo.zip;
Step 5.5 :Check XML transformation option
Assuming that the web.SalesDemoQA.config file will be transformed to web.config file.
Note :The Stage Name matches with the config name(www.salesDemo.config)

Where to put "dotnet bundle" in .NET Core project (project.json replaced with *.csproj file)

Since the most recent .NET Core (I am actually using AspNetCore 1.1.2) has replace the project.json file with *.csproj it is still not clear to me where to put the "dotnet bundle", precompile option.
"scripts": {
"precompile": ["dotnet bundle"]
}
Prior the above block of json was found in the project.json file. Any clue where this goes? Is it already in some other configuration file? Below is a link that explains this change, and shows what the *.csproj file equivalent is to the project.json file:
https://learn.microsoft.com/en-us/dotnet/core/tools/project-json-to-csproj
As always, apologies for any incorrect vernacular here, .NET Core is new to me.
You can use Target and Exec to accomplish this in .csproj:
<Target Name="PrepublishScript" BeforeTargets="PrepareForPublish">
<Exec Command=”bower install” EnvironmentVariables=”Path=$(ExternalToolsPath)” />
<Exec Command="dotnet bundle" />
</Target>
See this answer on how to get dotnet bundle to work with new .csproj format.

FlashBuildeC native extension 'InputMethodContext' required by the application was not found

I am working on an existing Flex project and I am using FlashBuilder. I would like to use FlashBuilderC and fb.exportReleaseBuild ant task to schedule nightly builds.
It seems I have a problem with native extensions.
fb.exportReleaseBuild] com.adobe.air.InvalidInputException: An implementation f
or native extension 'InputMethodContext' required by the application was not fou
nd for the target platform
Using Flash Builder GUI, I can successfully build and package the project
This is my build.xml
<?xml version="1.0"?>
<project default="main">
<target name="main">
<fb.exportReleaseBuild project="myproject" />
</target>
</project>
And this is the script I use
set WORKSPACE=path_to_my_workspace
REM works with either FlashBuilderC.exe or eclipsec.exe
"C:\Program Files\Adobe\Adobe Flash Builder 4.7 (64 Bit)\FlashBuilderC.exe" ^
--launcher.suppressErrors ^
-noSplash ^
-configuration C:\flashbuilderconf ^
-application org.eclipse.ant.core.antRunner ^
-data "%WORKSPACE%" ^
-file "%cd%\build.xml"
Am I missing anything?

Developer Licence error when running WinRT unit tests using vstest.console.exe from the command line

I'm getting the following error when I try to execute WinRT MSTests from the command line:
EXEC : error : Could not start test run for unit tests for Windows Store app: No valid developer license found for running unit tests for Windows Store apps. Please install/renew your developer license..
This used to work, but has suddenly started failing. The odd thing is that they execute fine from within visual studio.
I'm using the following MSBuild task.
<Target Name="UnitTest" DependsOnTargets="Compile" >
<ItemGroup>
<TestAppx Include="$(SolutionDir)\**\*x86*\**\*Tests*.appx" />
</ItemGroup>
<Message Importance="high" Text="Running tests for %(TestAppx.Identity)" />
<Exec Command='"$(VSINSTALLDIR)\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe" %(TestAppx.Identity) /InIsolation /platform:x86 /Logger:trx /UseVsixExtensions:true'
WorkingDirectory="$(SolutionDir)"/>
</Target>
Still not exactly sure why VisualStudio and vstest were out-of-sync, but I found a solution.
Open PowerShell as an administrator
Execute: Unregister-WindowsDeveloperLicense
Open the solution in visual studio
Log in to your live account when prompted to re-create your developer licence
Source: http://msdn.microsoft.com/en-us/library/windows/apps/hh974578.aspx#getting_a_developer_license_at_a_command_prompt

phing with phpdoc2 doesn't run

So I have a jenkins job to update a copy of my code and generate the phpdoc for my library, this is all done with phing
When I use these line in de build.xml it generates jsut fine (but with phpdocumentor 1.4.4)
<target name="phpdoc">
<echo msg="PHP Documentor..." />
<phpdoc title="API Documentation"
destdir="/var/www/corelib"
sourcecode="yes"
output="HTML:Smarty:PHP">
<fileset dir="./library/Core">
<include name="**/*.php" />
</fileset>
</phpdoc>
</target>
I want to use the new version of phpdocumentor so i installed it with pear
pear install phpdoc/phpDocumentor-alpha
But when I run this command (I found this in the phing docs), jenkins prints "PHP documentor" and then directly marks the build as failed
<target name="phpdoc">
<echo msg="PHP Documentor..." />
<phpdoc2 title="API Documentation" destdir="/var/www/corelib" template="responsive">
<fileset dir="./library/Core">
<include name="**/*.php" />
</fileset>
</phpdoc2>
</target>
I have zendserver installed on this server but that can't be a problem because phpdoc 1.4.4 runs fine
So how do i solve this?
Ok i found the solution, so i post it for future reference
With some help of the people on the irc channel of phpdocumentor
so this a bug with the latest build of phing in combination with the latest version of phpdocumentor. To fix this problem just revert the instalation of phpdocumentor2 to this version
phpDocumentor 2.0.0a3
This will fix the problem with phing and the documentation gets generated with no problem