Skip to content

Commit 0ac146e

Browse files
authored
Merge pull request #149 from NHSDigital/nurse-journey-with-data
Expansion of existing performance test to run end to end
2 parents 72f7be0 + 6bbde90 commit 0ac146e

File tree

4 files changed

+5946
-0
lines changed

4 files changed

+5946
-0
lines changed
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
name: Performance tests
2+
3+
on:
4+
push:
5+
branches:
6+
- "performance-testing"
7+
8+
workflow_dispatch:
9+
inputs:
10+
urn:
11+
description: "URN - for a school in the QA environment. This session MUST HAVE A SESSION DATE FOR TODAY."
12+
required: true
13+
type: string
14+
duration:
15+
description: "Duration of nurse journey test, in seconds. This will include ramp-up."
16+
required: false
17+
type: number
18+
threads:
19+
description: "Threads to run. Equivalent to the number of nurses using the system."
20+
required: false
21+
type: number
22+
ramp_up:
23+
description: "Ramp-up time in seconds. Threads will be gradually started up over this time."
24+
required: false
25+
type: number
26+
vaccination_loop:
27+
description: "Vaccination loop. The number of vaccinations each nurse will perform before logging and back in again."
28+
required: false
29+
type: number
30+
input_file:
31+
description: "Input file name used for all steps."
32+
required: false
33+
type: string
34+
35+
# env:
36+
# JMETER_PLUGIN_INSTALL_LIST: "jpgc-udp,jpgc-graphs-basic,jpgc-dummy,bzm-random-csv"
37+
38+
jobs:
39+
nurse_journey_performance_test:
40+
runs-on: ubuntu-latest
41+
42+
if: ${{ github.event_name == 'workflow_dispatch' }}
43+
44+
env:
45+
jmeter_version: 5.6.3
46+
cmdrunner_version: 2.3
47+
jmeter_plugins_manager_version: 1.7.0
48+
jmeter_plugins: jpgc-udp,jpgc-graphs-basic,jpgc-dummy,bzm-random-csv
49+
# jmeter_home: ${{ github.workspace }}/jmeter-${{ env.jmeter_version }}
50+
51+
steps:
52+
- uses: actions/checkout@v4
53+
54+
- name: Install JMeter
55+
run: |
56+
curl -sSO https://archive.apache.org/dist/jmeter/binaries/apache-jmeter-${{ env.jmeter_version }}.tgz
57+
tar xzf apache-jmeter-${{ env.jmeter_version }}.tgz
58+
mv apache-jmeter-${{ env.jmeter_version }} jmeter
59+
curl -sSO --output-dir jmeter/lib https://repo1.maven.org/maven2/kg/apc/cmdrunner/${{ env.cmdrunner_version }}/cmdrunner-${{ env.cmdrunner_version }}.jar
60+
curl -LsS --output jmeter/lib/ext/jmeter-plugins-manager-${{ env.jmeter_plugins_manager_version }}.jar https://jmeter-plugins.org/get/
61+
java -cp jmeter/lib/ext/jmeter-plugins-manager-${{ env.jmeter_plugins_manager_version }}.jar org.jmeterplugins.repository.PluginManagerCMDInstaller
62+
chmod +x jmeter/bin/PluginsManagerCMD.sh
63+
64+
- name: Install JMeter plugins
65+
if: env.jmeter_plugins != ''
66+
run: |
67+
if [ -x "$(command -v parallel)" ]; then
68+
echo "Using GNU parallel to install plugins"
69+
parallel -d, -j 5 -n 1 jmeter/bin/PluginsManagerCMD.sh install {} ::: ${{ env.jmeter_plugins }}
70+
else
71+
echo "GNU parallel not found, installing plugins sequentially"
72+
IFS=',' read -ra PLUGINS <<< "${{ env.jmeter_plugins }}"
73+
for plugin in "${PLUGINS[@]}"; do
74+
jmeter/bin/PluginsManagerCMD.sh install $plugin
75+
done
76+
fi
77+
78+
- name: Set timestamp
79+
id: timestamp
80+
run: echo "timestamp=$(date '+%Y%m%d%H%M%S')" >> $GITHUB_ENV
81+
82+
- name: Run file import for new file
83+
run: |
84+
mkdir -p import-output
85+
import_output_dir=import-output
86+
echo "Placeholder step for file import"
87+
88+
- name: Run Consent Journey for imported records (2K records)
89+
run: |
90+
mkdir -p consent-output
91+
consent_output_dir=consent-output
92+
jmeter/bin/jmeter -n -t performance-tests/E2E/consent-journey.jmx \
93+
-l $consent_output_dir/samples.jtl \
94+
-j $consent_output_dir/jmeter.log \
95+
-e -o $consent_output_dir/consent-report \
96+
-JURN=${{inputs.urn}} \
97+
-JAuthToken=${{secrets.HTTP_AUTH_TOKEN_FOR_TESTS}} \
98+
-JInputFile=${{input_file}}
99+
100+
- name: Run nurse journey JMeter test
101+
run: |
102+
mkdir -p nurse-output
103+
nurse_output_dir=nurse-output
104+
# jmeter/bin/jmeter -n -t performance-tests/nurse-journey.jmx \
105+
# -l $nurse_output_dir/samples.jtl \
106+
# -j $nurse_output_dir/jmeter.log \
107+
# -e -o $nurse_output_dir/report \
108+
# -JSessionSlug=${{inputs.session_slug}} \
109+
# -JAuthToken=${{secrets.HTTP_AUTH_TOKEN_FOR_TESTS}} \
110+
# -JDuration=${{inputs.duration}} \
111+
# -JThreads=${{inputs.threads}} \
112+
# -JRampUp=${{inputs.ramp_up}} \
113+
# -JVaccinationLoop=${{inputs.vaccination_loop}}
114+
115+
- name: Upload consent journey JMeter output
116+
uses: actions/upload-artifact@v4
117+
with:
118+
name: jmeter-consent-journey-output-${{ env.timestamp }}
119+
path: consent-output
120+
if-no-files-found: error
121+
122+
# - name: Upload nurse journey JMeter output
123+
# uses: actions/upload-artifact@v4
124+
# with:
125+
# name: jmeter-nurse-journey-output-${{ env.timestamp }}
126+
# path: nurse-output
127+
# if-no-files-found: error

0 commit comments

Comments
 (0)