Skip to content

Commit f566298

Browse files
NRL-1876 Update instructions for setting permissions for public mode perf tests
1 parent 28f6cb2 commit f566298

2 files changed

Lines changed: 25 additions & 0 deletions

File tree

scripts/manage_permissions.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
#!/usr/bin/env python
2+
"""
3+
Manage organisation pointer type permissions for NRLF apps in a given environment ENV
4+
"""
25

36
import json
47
import os

tests/performance/README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ make ENV=perftest USE_SHARED_RESOURCES=true apply
4545

4646
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.
4747

48+
##### Internal permissions
49+
4850
```sh
4951
assume nhsd-nrlf-mgmt
5052

@@ -59,6 +61,26 @@ make init TF_WORKSPACE_NAME=perftest-1 ENV=perftest
5961
make ENV=perftest USE_SHARED_RESOURCES=true apply
6062
```
6163

64+
This will set up permissions for the `K6PerformanceTest` organisation, which is used for internal testing.
65+
66+
##### Public permissions
67+
68+
To set additional permissions for public testing, you will need to update the permissions for the default app (currently: `X26-NRL-6981ad7d-cff4-4613-93d0-df60e5e2fc52`) which you can do using [./scripts/manage_permissions.py](./scripts/manage_permissions.py).
69+
70+
You can find the pointer types each ODS code will need permissions for in [tests/performance/seed_data_constants.py](tests/performance/seed_data_constants.py) under `*_POINTERS_CUSTODIAN_DISTRIBUTIONS`. These are used to seed the test data.
71+
72+
For example: while running perf tests, the following failure occurred:
73+
74+
```sh
75+
WARN[0484] {"issue":[{"severity":"error","code":"forbidden","details":{"coding":[{"system":"https://fhir.nhs.uk/CodeSystem/Spine-ErrorOrWarningCode","code":"ACCESS DENIED","display":"Access has been denied to process this request"}]},"diagnostics":"Your organisation 'TD2L9A' does not have permission to access this resource. Contact the onboarding team."}],"resourceType":"OperationOutcome"} source=console
76+
```
77+
78+
To resolve this, we can give the organisation `TD2L9A` permission to access the pointer type `824321000000109` on the default app:
79+
80+
```sh
81+
ENV=perftest poetry run python ./scripts/manage_permissions.py set_perms X26-NRL-6981ad7d-cff4-4613-93d0-df60e5e2fc52 TD2L9A http://snomed.info/sct\|824321000000109
82+
```
83+
6284
### Prepare to run tests
6385

6486
Prepare input files

0 commit comments

Comments
 (0)