Skip to content

Commit

Permalink
Change version 1.5 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 7, 2023
1 parent cb04667 commit f26df35
Show file tree
Hide file tree
Showing 5 changed files with 109 additions and 3 deletions.
20 changes: 18 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ The maven groupId, artifactId and version, this plugin is in the **Maven Central
```xml
<groupId>io.github.vdaburon</groupId>
<artifactId>junit-reporter-kpi-from-jmeter-report-csv</artifactId>
<version>1.4</version>
<version>1.5</version>
```
Just include the plugin in your `pom.xml` and execute `mvn verify` <br>
or individual launch `mvn -DjmeterReportFile=synthesis.csv -DkpiFile=kpi.csv -DjunitFile=jmeter-junit-plugin-jmreport.xml exec:java@create_junit-report-kpi-from-jmeter-report`
Expand All @@ -142,7 +142,7 @@ or individual launch `mvn -DjmeterReportFile=synthesis.csv -DkpiFile=kpi.csv -Dj
<dependency>
<groupId>io.github.vdaburon</groupId>
<artifactId>junit-reporter-kpi-from-jmeter-report-csv</artifactId>
<version>1.4</version>
<version>1.5</version>
</dependency>
</dependencies>

Expand Down Expand Up @@ -186,10 +186,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-from-jmeter-report-csv-&lt;version&gt;-jar-with-dependencies.jar -csvJMReport summary.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-from-jmeter-report-csv tool"

in JMETER_HOME\bin (Windows)
<pre>
junit-reporter-kpi-from-jmeter-report-csv.cmd -csvJMReport summary.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-from-jmeter-report-csv.sh -csvJMReport summary.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.5 add jmeter-plugins.org installer

version 1.4 export result in html, json or csv format

Version 1.3 change Fail Message when Equality
Expand Down
14 changes: 13 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>io.github.vdaburon</groupId>
<artifactId>junit-reporter-kpi-from-jmeter-report-csv</artifactId>
<version>1.4</version>
<version>1.5</version>
<packaging>jar</packaging>
<name>Create a JUnit XML file with KPI rules from JMeter CSV Report</name>
<description>A tool that creates a JUnit XML file with KPI rules from JMeter CSV Report, export result in html, csv or json format</description>
Expand Down Expand Up @@ -173,6 +173,10 @@
</executions>
</plugin>
<plugin>
<!-- deploy jar in maven central or stagging only : mvn clean deploy
if autoReleaseAfterClose == true then release in maven central;
if autoReleaseAfterClose == false then release in stagging only not maven central
-->
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.13</version>
Expand All @@ -184,5 +188,13 @@
</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.reportkpi;

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-from-jmeter-report-csv.cmd", false);
writeOut("junit-reporter-kpi-from-jmeter-report-csv.sh", true);
}

private static void writeOut(String resName, boolean executable) throws IOException {
resName = "/io/github/vdaburon/jmeter/utils/reportkpi/" + 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 a JMeter Report CSV file and generates a result file in JUnit XML format and others formats Html, Json and Csv.
rem Look README at https://github.com/vdaburon/JUnitReportKpiJMeterReportCsv

setlocal

cd /D %~dp0

set CP=..\lib\ext\junit-reporter-kpi-from-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 a JMeter Report CSV file and generates a result file in JUnit XML format and others formats Html, Json and Csv.
## Look README at https://github.com/vdaburon/JUnitReportKpiJMeterReportCsv

cd `dirname $0`

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

java -jar $CP $*

0 comments on commit f26df35

Please sign in to comment.