|
1 | 1 | # Performance Testing |
2 | 2 |
|
3 | | -<!-- TODO: make this proper --> |
4 | | - |
5 | 3 | some high level context short |
6 | 4 |
|
7 | 5 | ## Run perf tests |
8 | 6 |
|
| 7 | +### Prep the environment |
| 8 | + |
| 9 | +Perf tests are generally conducted in the perftest env. There's a selection of tables in the perftest env representing different pointer volume scenarios e.g. perftest-baseline vs perftest-1million (todo: update with real names!). |
| 10 | + |
| 11 | +To reset this table to the expected state for perftests, restore the table from a backup. |
| 12 | + |
| 13 | +In the steps below, make sure the table name is the table your environment is pointing at. You might need to redeploy NRLF lambdas to point at the desired table. |
| 14 | + |
| 15 | +### Prepare to run tests |
| 16 | + |
| 17 | +#### Pull certs for env |
| 18 | + |
9 | 19 | ```sh |
10 | 20 | assume management |
11 | | -make truststore-pull-all ENV=<env> # e.g. perftest |
| 21 | +make truststore-pull-all ENV=perftest |
| 22 | +``` |
| 23 | + |
| 24 | +#### Generate permissions |
| 25 | + |
| 26 | +You will need to generate pointer permissions the first time performance tests are run in an environment e.g. if the perftest environment is destroyed & recreated. |
| 27 | + |
| 28 | +```sh |
| 29 | +make generate permissions # makes a bunch of json permission files |
| 30 | +make build # will take all permissions & create nrlf_permissions.zip file |
| 31 | + |
| 32 | +# apply this new permissions zip file to your environment |
12 | 33 | cd ./terraform/infrastructure |
13 | | -tf workspace select # perftest-1 or active stack |
14 | | -cd ../../ # project root |
15 | | -assume |
16 | | -make perftest-prepare PERFTEST_TABLE_NAME=<pointer table name> |
| 34 | +assume test # needed? |
| 35 | +make init TF_WORKSPACE_NAME=perftest-1 ENV=perftest |
| 36 | +tf apply |
| 37 | +``` |
| 38 | + |
| 39 | +#### Generate input files |
17 | 40 |
|
18 | | -make perftest-consumer ENV_TYPE=<env> # e.g. perftest |
| 41 | +```sh |
| 42 | +# creates 2 csv files and a json file |
| 43 | +make perftest-prepare PERFTEST_TABLE_NAME=perftest-baseline |
19 | 44 | ``` |
20 | 45 |
|
21 | | -<!-- Mention relevant input files + any environment prep needed e.g. restoring tables from backup --> |
| 46 | +### Run tests |
| 47 | + |
| 48 | +```sh |
| 49 | +make perftest-consumer ENV_TYPE=perftest PERFTEST_HOST=perftest-1.perftest.record-locator.national.nhs.uk |
| 50 | +make perftest-producer ENV_TYPE=perftest PERFTEST_HOST=perftest-1.perftest.record-locator.national.nhs.uk |
| 51 | +``` |
0 commit comments