Skip to content

Commit

Permalink
Change version 1.2 add installer and script shell for jmeter-plugins-…
Browse files Browse the repository at this point in the history
…manager
  • Loading branch information
DABURON Vincent committed Jul 10, 2023
1 parent 21a0fc0 commit a9289cf
Show file tree
Hide file tree
Showing 5 changed files with 110 additions and 8 deletions.
26 changes: 21 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,15 @@ If you click on link "Name Test" fail , you will show the fail message<br>
![junit jenkins build detail fail](doc/images/junit_report_jenkins_detail_fail.png)

## Html out format
The result could be a html page ou partial html page (div)
The result could be a html page ou partial html page (div)<br>
![html out format](doc/images/html_out_result.png)

## Csv out format
The result in a csv file
The result in a csv file<br>
![csv out format](doc/images/csv_out_result.png)

## Json out format
The result in a Json file
The result in a Json file<br>
![csv out format](doc/images/json_out_result.png)

## License
Expand All @@ -155,7 +155,7 @@ The maven groupId, artifactId and version, this plugin is in the **Maven Central
```xml
<groupId>io.github.vdaburon</groupId>
<artifactId>junit-reporter-kpi-compare-jmeter-report-csv</artifactId>
<version>1.1</version>
<version>1.2</version>
```
Just include the plugin in your `pom.xml` and execute `mvn verify` <br>
or individual launch `mvn -jmeterReportCurrent=synthesis.csv -DjmeterReportReference=synthesis_ref.csv -DkpiFile=kpi.csv -DjunitFile=TEST-jmeter-junit-plugin-compare-jmreport.xml exec:java@create_junit-reporter-kpi-compare-jmeter-report`
Expand All @@ -174,7 +174,7 @@ or individual launch `mvn -jmeterReportCurrent=synthesis.csv -DjmeterReportRefer
<dependency>
<groupId>io.github.vdaburon</groupId>
<artifactId>junit-reporter-kpi-compare-jmeter-report-csv</artifactId>
<version>1.1</version>
<version>1.2</version>
</dependency>
</dependencies>

Expand Down Expand Up @@ -221,10 +221,26 @@ This tool is a java jar, so it's could be use as simple jar (look at [Release](h
java -jar junit-reporter-kpi-compare-jmeter-report-csv-&lt;version&gt;-jar-with-dependencies.jar -csvJMReportCurrent summary.csv -csvJMReportReference summary_ref.csv -kpiFile kpi.csv -junitFile junit-report.xml -exitReturnOnFail true
</pre>

## Tool installed with jmeter-plugins-manager
This tool could be installed with the jmeter-plugins-manager from jmeter.plugins.org.<br>
The tool name is : "vdn@github - junit-reporter-kpi-compare-jmeter-report-csv tool"

in JMETER_HOME\bin (Windows)
<pre>
junit-reporter-kpi-compare-jmeter-report-csv.cmd -csvJMReportCurrent summary.csv -csvJMReportReference summary_ref.csv -kpiFile kpi.csv -junitFile junit-report.xml -htmlOutFile result.html -csvOutFile result.csv
</pre>
or <br>
in JMETER_HOME/bin (Linux or MacOS)
<pre>
junit-reporter-kpi-compare-jmeter-report-csv.sh -csvJMReportCurrent summary.csv -csvJMReportReference summary_ref.csv -kpiFile kpi.csv -junitFile junit-report.xml -htmlOutFile result.html -csvOutFile result.csv
</pre>

## Link to other project
Usually this plugin is use with [jmeter-graph-tool-maven-plugin](https://github.com/vdaburon/jmeter-graph-tool-maven-plugin)

## Versions
version 1.2 add jmeter-plugins.org installer

version 1.1 export result in html, json or csv format

Version 1.0 initial version
Expand Down
14 changes: 11 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

<groupId>io.github.vdaburon</groupId>
<artifactId>junit-reporter-kpi-compare-jmeter-report-csv</artifactId>
<version>1.1</version>
<version>1.2</version>
<packaging>jar</packaging>
<name>Create a JUnit XML file with KPI rules and compare 2 JMeter CSV Report (current and reference)</name>
<description>Read KPI declarations in a file and apply the KPI assertion on 2 JMeter Report CSV files (current and reference) and generates a result file in JUnit XML format and other formats : html, csv and json.</description>
<description>Read KPI declarations in a file and apply the KPI assertion on 2 JMeter Report CSV files (current and reference) and generates a result file in JUnit XML format and other formats html, csv and json.</description>
<url>https://github.com/vdaburon/JUnitReportKpiCompareJMeterReportCsv</url>
<inceptionYear>2023</inceptionYear>

Expand Down Expand Up @@ -184,9 +184,17 @@
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>false </autoReleaseAfterClose>
<autoReleaseAfterClose>false</autoReleaseAfterClose>
</configuration>
</plugin>
</plugins>

<resources>
<resource>
<directory>src/main/resources</directory>
<!-- add version for the generated library in the script shell .cmd and .sh -->
<filtering>true</filtering>
</resource>
</resources>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package io.github.vdaburon.jmeter.utils.comparekpi;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.StandardCopyOption;

public class ToolInstaller {
public static void main(String[] argv) throws IOException {
writeOut("junit-reporter-kpi-compare-jmeter-report-csv.cmd", false);
writeOut("junit-reporter-kpi-compare-jmeter-report-csv.sh", true);
}

private static void writeOut(String resName, boolean executable) throws IOException {
resName = "/io/github/vdaburon/jmeter/utils/comparekpi/" + resName;
File self = new File(ToolInstaller.class.getProtectionDomain().getCodeSource().getLocation().getFile());
File src = new File(resName);
String home = self.getParentFile().getParentFile().getParent();
File dest = new File(home + File.separator + "bin" + File.separator + src.getName());

InputStream is = ToolInstaller.class.getResourceAsStream(resName);
Files.copy(is, dest.toPath(), StandardCopyOption.REPLACE_EXISTING);
dest.setExecutable(executable);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
@echo off

rem Licensed to the Apache Software Foundation (ASF) under one or more
rem contributor license agreements. See the NOTICE file distributed with
rem this work for additional information regarding copyright ownership.
rem The ASF licenses this file to You under the Apache License, Version 2.0
rem (the "License"); you may not use this file except in compliance with
rem the License. You may obtain a copy of the License at
rem
rem http://www.apache.org/licenses/LICENSE-2.0
rem
rem Unless required by applicable law or agreed to in writing, software
rem distributed under the License is distributed on an "AS IS" BASIS,
rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
rem See the License for the specific language governing permissions and
rem limitations under the License.

rem This tool read KPI declarations in a file and apply the KPI assertion on 2 JMeter Report CSV files (current and reference) and generates a result file in JUnit XML format and other formats html, csv and json.
rem Look README at https://github.com/vdaburon/JUnitReportKpiCompareJMeterReportCsv

setlocal

cd /D %~dp0

set CP=..\lib\ext\junit-reporter-kpi-compare-jmeter-report-csv-${version}-jar-with-dependencies.jar

java -jar %CP% %*
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/sh

## Licensed to the Apache Software Foundation (ASF) under one or more
## contributor license agreements. See the NOTICE file distributed with
## this work for additional information regarding copyright ownership.
## The ASF licenses this file to You under the Apache License, Version 2.0
## (the "License"); you may not use this file except in compliance with
## the License. You may obtain a copy of the License at
##
## http://www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
## See the License for the specific language governing permissions and
## limitations under the License.

## This tool Read KPI declarations in a file and apply the KPI assertion on 2 JMeter Report CSV files (current and reference) and generates a result file in JUnit XML format and other formats html, csv and json.
## Look README at https://github.com/vdaburon/JUnitReportKpiCompareJMeterReportCsv

cd `dirname $0`

CP=../lib/ext/junit-reporter-kpi-compare-jmeter-report-csv-${version}-jar-with-dependencies.jar

java -jar $CP $*

0 comments on commit a9289cf

Please sign in to comment.