How to Run JMeter in CI in Non-GUI Mode
JMeter is meant to run headless in CI with -n; the GUI is for building plans, never for load generation.
Run jmeter -n -t plan.jmx -l results.jtl. JMeter itself does not fail on slow responses, so add a check step (or JMeterPluginsCMD) that reads the JTL and exits non-zero when a budget is exceeded.
Steps
- Run the plan headless with
-n -t plan.jmx -l results.jtl. - Generate the HTML report with
-e -o report. - Evaluate the JTL for pass/fail (a script or JMeterPluginsCMD).
Terminal
Terminal
jmeter -n -t plan.jmx -l results.jtl -e -o report
# Fail if any sample errored (JTL column 8 is 'success')
awk -F',' 'NR>1 && $8=="false"{f++} END{exit f>0?1:0}' results.jtlWorkflow
.github/workflows/ci.yml
jobs:
jmeter:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
jmeter -n -t plan.jmx -l results.jtl -e -o report
- uses: actions/upload-artifact@v4
with:
name: jmeter-report
path: report/Gotchas
- The GUI mode warns "Don't use GUI mode for load testing"; always pass
-nin CI. - JMeter exits 0 regardless of latency, so the gating logic must live in your own check step.
Related guides
How to Run Gatling Load Tests in CIRun a Gatling simulation in CI with the Maven or Gradle plugin, using assertions in the simulation so a faile…
How to Export Load Test Results as JSON and JUnitExport load test results in CI as a JSON summary and a JUnit XML report so the run surfaces in the test tab a…