Skip to content
Latchkey

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.jtl

Workflow

.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 -n in CI.
  • JMeter exits 0 regardless of latency, so the gating logic must live in your own check step.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →