@@ -68,7 +68,9 @@ poetry self add poetry-plugin-shell
6868poetry shell
6969```
7070
71- ### Running tests
71+ ### Backend development
72+
73+ #### Running tests
7274
7375Certain tests require you to auth with the Google Cloud SDK and to install the
7476Firestore Emulator:
@@ -93,7 +95,7 @@ By default, this skips long tests, enable them by setting the `LONG_TESTS` varia
9395LONG_TESTS=1 make api-server-tests
9496```
9597
96- #### Test result generation
98+ ##### Test result generation
9799
98100Many tests are written using a
99101[ simple framework] ( https://github.com/google/osv.dev/blob/a4b682a32575cc3314a5ef83c8e91b70c60f7b77/osv/tests.py#L32 )
@@ -109,49 +111,63 @@ the environment variable `TESTS_GENERATE=1` and run the tests:
109111TESTS_GENERATE=1 make all-tests
110112```
111113
112- ### Linting and formatting
114+ #### Running a local API instance (maintainers only)
113115
114- To lint your code, run
116+ Running a local instance of the API server requires the path to application
117+ default credentials. This is required so that the ESP container has credentials
118+ to download API configuration.
115119
116120``` shell
117- make lint
121+ gcloud auth login --update-adc
122+ make run-api-server
118123```
119124
120- To format your code, run
125+ #### API E2E Snapshots
126+
127+ If you have made any changes to the API, please update the API query snapshots with
128+
121129``` shell
122- yapf -i < file> .py
130+ gcloud auth login --update-adc
131+ make update-api-snapshots
123132```
124133
125- ### Running local UI and API instances (maintainers only)
134+ and check the git diff to see if the API result changes are expected.
135+
136+ ### Frontend development
126137
127- #### UI
138+ #### Running a local UI instance (maintainers only)
128139
129140``` shell
130141gcloud auth login --update-adc
131142make run-website
132143```
133144
134- #### API
145+ #### Running a local UI instance
135146
136- Running a local instance of the API server requires the path to application
137- default credentials. The is required so that the ESP container has credentials
138- to download API configuration .
147+ For contributors without access to the GCP project, you can use the website emulator which does
148+ not require Google Cloud project access. This emulator uses a local datastore
149+ and loads data from a local directory .
139150
140151``` shell
141- gcloud auth login --update-adc
142- make run-api-server
152+ make run-website-emulator
143153```
144154
145- #### API E2E Snapshots
155+ You can add testcase records to ` gcp/website/testdata/osv/ ` to test odd cases.
156+ See [ gcp/website/testdata/osv/README.md] ( gcp/website/testdata/osv/README.md )
157+ for more information on the format of these records.
146158
147- If you have made any changes to the API, please update the API query snapshots with
159+ ### Linting and formatting
160+
161+ To lint your code, run
148162
149163``` shell
150- gcloud auth login --update-adc
151- make update-api-snapshots
164+ make lint
152165```
153166
154- and check the git diff to see if the API result changes are expected.
167+ To format your code, run
168+ ``` shell
169+ yapf -i < file> .py
170+ ```
155171
156172### Making commits
157173
0 commit comments