diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ca96e08..f4d8e4e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,26 +4,26 @@ jobs: runs-on: ubuntu-latest name: JMeter Test Execution steps: - - name: Checkout - uses: actions/checkout@v3 + - name: Checkout + uses: actions/checkout@v3 - - name: Create reports directory - run: mkdir reports + - name: Create reports directory + run: mkdir reports + + - name: Run JMeter Tests + uses: ./ + with: + test-plan-path: ./TestPlans/S01_SimpleExample/S01_SimpleExample.jmx + args: "-e -o ./reports/html/" - - name: Run JMeter Tests - uses: ./ - with: - test-plan-path: ./TestPlans/S01_SimpleExample/S01_SimpleExample.jmx - args: "-e -o ./reports/html/" - - - name: Upload Results - uses: actions/upload-artifact@v3 - with: - name: jmeter-results - path: result.jtl + - name: Upload Results + uses: actions/upload-artifact@v3 + with: + name: jmeter-results + path: result.jtl - - name: Upload Html Reports - uses: actions/upload-artifact@v3 - with: - name: jmeter-reports - path: reports + - name: Upload HTML Reports + uses: actions/upload-artifact@v3 + with: + name: jmeter-reports + path: reports diff --git a/Dockerfile b/Dockerfile index c1995a9..500c0c7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,7 +10,7 @@ ENV JMETER_BIN "${JMETER_HOME}/bin" ENV PATH "$PATH:$JMETER_BIN" ENV JMETER_CMD_RUNNER_VERSION "2.3" ENV JMETER_PLUGIN_MANAGER_VERSION "1.9" -ENV JMETER_PLUGIN_INSTALL_LIST "jpgc-udp,jpgc-graphs-basic,jpgc-graphs-additional,jpgc-graphs-dist,jpgc-functions" +ENV JMETER_PLUGIN_INSTALL_LIST "jpgc-udp,jpgc-graphs-basic" COPY entrypoint.sh /entrypoint.sh COPY jmeter-plugin-install.sh /jmeter-plugin-install.sh diff --git a/README.md b/README.md index 7e4dfbe..c09fc55 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# About PerfAction +# 🚀 PerfAction [![](https://img.shields.io/badge/dev.to-Actions%20Hackathon-blue)](https://dev.to/qainsights/perfaction-run-jmeter-performance-tests-191) [![saythanks](https://img.shields.io/badge/say-thanks-1EAEDB.svg)](https://saythanks.io/to/catch.nkn%40gmail.com) @@ -8,13 +8,14 @@ This GitHub Action helps to automate performance testing using [Apache JMeter](https://jmeter.apache.org/) and its [plugins](https://jmeter-plugins.org/). -PerfAction also featured in LoadTestWorld 2021 conference. +PerfAction also featured in `LoadTestWorld 2021` conference. ![PerfAction for JMeter](./assets/Banner.jpg) -# How to use this GitHub Action? +# 🤔 How to use this GitHub Action? ## Prerequisites + Following are the prerequisites for this GitHub Action: * `test-plan-path` @@ -25,12 +26,13 @@ Following are the prerequisites for this GitHub Action: * Additional arguments you can pass it to your test plan execution * `test-results` * Optional - * If you want your result to have a different extension than jtl such as .csv , default value result.jtl -## Usage + * If you want your result to have a different extension than jtl such as `.csv` default value `result.jtl`. -### Example #1 with no arguments +## 👇 Usage -``` +### Example #1 with no arguments + +```yaml - name: JMeter Test uses: QAInsights/PerfAction@v3.2 with: @@ -45,7 +47,7 @@ Following are the prerequisites for this GitHub Action: ### Example #2 with arguments -``` +```yaml - name: JMeter Test uses: QAInsights/PerfAction@v3.2 with: @@ -60,9 +62,9 @@ Following are the prerequisites for this GitHub Action: ``` ### Example #3 with arguments to Generate HTML Reports -make sure you create directory with the name where you want html report to be saved. +Please make sure that you create a directory where you want to generate HTML report. -``` +```yaml - name: Create reports directory run: mkdir reports @@ -83,10 +85,9 @@ make sure you create directory with the name where you want html report to be sa with: name: jmeter-html-reports path: reports - ``` -## Download JMeter Test Results +## 📥 Download JMeter Test Results By default, this GitHub Action will log the performance statistics under `result.jtl`. After the execution, it will be uploaded to the GitHub artifacts. diff --git a/action.yml b/action.yml index 303c0a1..280ddf2 100644 --- a/action.yml +++ b/action.yml @@ -10,7 +10,7 @@ branding: inputs: test-plan-path: required: true - description: jmeter test plan to execute + description: JMeter test plan to execute results-file: required: false description: Where to store the results e.g., result.csv diff --git a/jmeter-plugin-install.sh b/jmeter-plugin-install.sh index 2e8e7b3..9a4c8de 100644 --- a/jmeter-plugin-install.sh +++ b/jmeter-plugin-install.sh @@ -1,22 +1,22 @@ #!/bin/sh -echo ${JMETER_HOME} -echo ${JMETER_CMD_RUNNER_VERSION} -echo ${JMETER_PLUGIN_MANAGER_VERSION} -echo ${JMETER_PLUGIN_INSTALL_LIST} +# Author: NaveenKumar Namachivayam +# Website: www.qainsights.com +# Purpose: Install JMeter Plugins + +# Download CMDRunner echo "Downloading CMDRunner" curl -L http://search.maven.org/remotecontent?filepath=kg/apc/cmdrunner/${JMETER_CMD_RUNNER_VERSION}/cmdrunner-${JMETER_CMD_RUNNER_VERSION}.jar --output ${JMETER_HOME}/lib/cmdrunner-${JMETER_CMD_RUNNER_VERSION}.jar +# Download Plugin Manager echo "Downloading Plugin Manager" curl -L https://jmeter-plugins.org/get/ --output ${JMETER_HOME}/lib/ext/jmeter-plugins-manager-${JMETER_PLUGIN_MANAGER_VERSION}.jar +# Install Plugin Manager java -cp /opt/apache/apache-jmeter-${JMETER_VERSION}/lib/ext/jmeter-plugins-manager-${JMETER_PLUGIN_MANAGER_VERSION}.jar org.jmeterplugins.repository.PluginManagerCMDInstaller +# Install JMeter plugins cd /opt/apache/apache-jmeter-${JMETER_VERSION}/bin/ java -jar ${JMETER_HOME}/lib/cmdrunner-${JMETER_CMD_RUNNER_VERSION}.jar --tool org.jmeterplugins.repository.PluginManagerCMD install ${JMETER_PLUGIN_INSTALL_LIST} -chmod a+x ${JMETER_HOME}/bin/*.sh - -pwd - -ls -l ${JMETER_HOME}/bin/*.sh - +# Set execute permissions for JMeter shell scripts +chmod a+x ${JMETER_HOME}/bin/*.sh \ No newline at end of file