2022-06-10 17:52:12 -06:00
# Testing
## Setup
If you haven't setup `matrix-public-archive` yet, see the [_Setup_ section in the root `README.md` ](../README.md#setup )
Sorry, this isn't automated yet when you run the tests 🙇
2022-06-09 19:44:57 -06:00
```sh
2022-02-23 20:25:05 -07:00
$ docker pull matrixdotorg/synapse:latest
$ docker build -t matrix-public-archive-test-homeserver -f test/dockerfiles/Synapse.Dockerfile test/dockerfiles/
2022-06-10 17:52:12 -06:00
$ docker-compose --project-name matrix_public_archive_test -f test/docker-compose.yml up -d --no-recreate
2022-02-22 19:25:24 -07:00
```
2022-06-10 17:52:12 -06:00
## Running the tests
2022-06-09 19:44:57 -06:00
```sh
2022-06-10 17:52:12 -06:00
$ npm run test
```
Or if you want to keep `matrix-public-archive` server running after the tests run and explore the output from the interactive URL's printed on the screen, use:
```sh
$ npm run test-interactive
2022-02-22 19:25:24 -07:00
```
2022-02-23 20:25:05 -07:00
2022-06-10 17:52:12 -06:00
### Developer utility
2022-06-09 19:44:57 -06:00
```sh
2022-02-23 20:25:05 -07:00
$ docker ps --all | grep test_hs
2022-06-09 19:44:57 -06:00
$ docker logs -f --tail 10 matrix_public_archive_test_hs1_1
$ docker logs -f --tail 10 matrix_public_archive_test_hs2_1
2022-02-23 20:25:05 -07:00
2022-06-09 19:44:57 -06:00
$ docker stop matrix_public_archive_test_hs1_1 matrix_public_archive_test_hs2_1
$ docker rm matrix_public_archive_test_hs1_1 matrix_public_archive_test_hs2_1
2022-02-23 20:25:05 -07:00
```