Skip to content

Commit

Permalink
Docs: Test database resources no longer change with every CAPI client…
Browse files Browse the repository at this point in the history
… update

Thanks to #25098, updating the CAPI client no
longer inevitably guarantees the need to regenerate the test database files.
  • Loading branch information
rtyley committed Jan 9, 2025
1 parent ac97384 commit 522ae31
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

- [ ] Tested locally, and on CODE if necessary
- [ ] Will not break dotcom-rendering
- [ ] Will not break our database – if updating CAPI, [updated and committed the database files](https://github.com/guardian/frontend/blob/main/docs/03-dev-howtos/15-updating-test-database.md)
- [ ] Any new [test `data/database`](https://github.com/guardian/frontend/blob/main/docs/03-dev-howtos/15-updating-test-database.md) files generated by tests are committed with this PR (the tests will fail in CI if you've forgotten to do this)
- [ ] Meets our accessibility [standards](https://github.com/guardian/recommendations/blob/e647ef695199ea3116ea20d827ef0f1364270a39/accessibility.md)
- [ ] [Tested with screen reader](https://github.com/guardian/accessibility/blob/main/people-and-technology/03-visual.md#screen-reader)
- [ ] [Navigable with keyboard](https://github.com/guardian/accessibility/blob/main/people-and-technology/02-physical.md#Keyboard)
Expand Down
5 changes: 3 additions & 2 deletions docs/03-dev-howtos/15-updating-test-database.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ In order to run integration tests without requiring a network connection, fronte
If you are making or updating an external HTTP request (such as a CAPI query) in your test, for example where you are using the `TestRequest` object, you will need to:
* Run all tests locally. This will make a network request and modify files in the local test database.
* Add and commit new and modified database files. These will have file names like: `data/database/014ed94831df96eeb792a6c22eda60432bb346c77dc6899328c6447faba6246c`
* Check the tests pass on TeamCity
* Check the tests pass in CI

## Troubleshooting
* When running your test locally you may get an HTTP error due to the vagaries of the network, try re-running the failing tests using `test-quick`.
* If you get many test failures locally, try removing any local `devOverrides` as they may interfere with the config expected by the tests.
* If you get an error on TeamCity such as `Data file has not been checked in` check you have committed files in the `/data/database` folder.
* If you get an error in CI such as [`Data file has not been checked in`](https://github.com/guardian/frontend/blob/ac973840ccbbbce33a956feb7ef0a3b612c50d71/common/test/recorder/HttpRecorder.scala#L43),
check you have committed files in the `/data/database` folder.

0 comments on commit 522ae31

Please sign in to comment.