@@ -22,7 +22,35 @@ LPA related functions.
22
22
23
23
## Running the API locally
24
24
25
- ### Set up
25
+ To run the API locally you should have aws-vault installed and have an account that has access to assume
26
+ the operator role in sirius dev.
27
+
28
+ - Run full setup script from the make file:
29
+ ```
30
+ make setup
31
+ ```
32
+ or if you want pact as well:
33
+ ```
34
+ make setup-all
35
+ ```
36
+ - Test the setup
37
+
38
+ ```
39
+ curl -X GET http://localhost:4343/v1/healthcheck
40
+ curl -X GET http://localhost:4343/v1/lpa-online-tool/lpas/A39721583862
41
+ curl -X GET http://localhost:4343/v1/use-an-lpa/lpas/700000000013
42
+ ```
43
+
44
+ That should be all you need to set it up locally.
45
+
46
+ -----------------------------------
47
+
48
+ ## Manual setup
49
+
50
+ #### Set up local development environment outside of docker
51
+
52
+ If you wish to develop against this environment and don't want to be dealing with docker containers then there
53
+ is a bit more of an in depth set up process required.
26
54
27
55
1 . Create a virtual environment
28
56
``` bash
@@ -48,30 +76,19 @@ LPA related functions.
48
76
pip3 install -r lambda_functions/v1/requirements/dev-requirements.txt
49
77
` ` `
50
78
51
-
52
-
53
- # ### Running flask app locally, aka the quick way
79
+ 1. Remove the codeartifact login
80
+ ` ` ` bash
81
+ rm ~ /.pypirc
82
+ ` ` `
83
+ # ### Running flask app locally
54
84
55
85
1. ` cd lambda_functions/v1/functions/lpa/app`
56
86
1. ` flask run`
57
87
1. Endpoints should be available on ` http://localhost:5000`
58
88
59
- # ### Running everything in Docker
60
-
61
- 1. Get your AWS credentials
62
- ` ` ` bash
63
- cd docs/support_scripts/aws
64
-
65
- aws-vault exec identity -- go run ./getcreds.go
66
- ` ` `
67
- 1. Copy & paste the output to set your AWS details as env vars
68
- * This is because we are using custom packages hosted in AWS CodeArtifact and we need to log in to be able to pip install them
69
- 1. In the root folder: ` make everything` (you can also use ` make just_api` if you are not interested in Pact)
70
- 1. Endpoints should be available on ` http://0.0.0.0:4343`
71
-
72
89
# # Unit Tests
73
90
74
- 1. [Set up local environment](# Set up )
91
+ 1. [Set up local environment](# set-up-local-development-environment-outside-of-docker )
75
92
76
93
1. Run the tests command-line style
77
94
` ` ` bash
@@ -84,12 +101,12 @@ LPA related functions.
84
101
` ` `
85
102
1. Run the tests in PyCharm
86
103
87
- * Go to PyCharm > Preferences > Tools > Python Integrated Tools
104
+ * Go to PyCharm > Preferences > Tools > Python Integrated Tools
88
105
* Set the Default Test Runner to ' pytest'
89
106
* Right click on the tests folder (or single file) > ' Run pytest in tests'
90
107
91
108
# # Integration Tests
92
- 1. [Set up local environment](# Set up )
109
+ 1. [Set up local environment](# set-up-local-development-environment-outside-of-docker )
93
110
94
111
1. Setup the tests:
95
112
- In ` integration_tests/v1/conftest.py` , check that the url you are pointing to is correct.
@@ -101,8 +118,6 @@ LPA related functions.
101
118
aws-vault exec identity -- python -m pytest -n2 --dist=loadfile --html=report.html --self-contained-html
102
119
` ` `
103
120
104
-
105
-
106
121
# # PACT
107
122
108
123
To run pact locally, the easiest way to interact with it is to use the client tools.
@@ -135,7 +150,7 @@ http://localhost:9292/pacticipants/lpa_data/versions/x12345/tags/v1
135
150
136
151
You can check it has worked here:
137
152
138
- ` http://localhost:9292/matrix/provider/OPG%20Data /consumer/Complete%20the%20deputy%20report `
153
+ ` http://localhost:9292/matrix/provider/lpa_data_sirius /consumer/lpa_data `
139
154
140
155
Run the secret creation against mock
141
156
0 commit comments