Skip to content

add test-plan to test jmeter test #8

add test-plan to test jmeter test

add test-plan to test jmeter test #8

Workflow file for this run

name: JMeter Test Pipeline
on:
pull_request:
branches:
- main
jobs:
jmeter-test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install JMeter
run: |
sudo apt update
sudo apt install -y jmeter
- name: Create results directory
run: mkdir -p ./tests
- name: Run JMeter tests
run: jmeter -n -t ./tests/test-plan.jmx -l ./tests/test-results.jtl -Duser.jmeter.save.saveservice.classname=true
- name: List files in tests directory
run: ls -R ./tests
- name: Check JMeter results
run: |
if [ -f ./tests/test-results.jtl ]; then
grep "Failure" ./tests/test-results.jtl || echo "No failures found in test results."
else
echo "Test results file not found."
exit 1
fi
- name: Upload JMeter report
uses: actions/upload-artifact@v3
with:
name: jmeter-report
path: ./tests/test-results.jtl