Better explain how to get the project and tests to run at this point (#19)

This commit is contained in:
Eric Eastwood 2022-06-10 18:52:12 -05:00 committed by GitHub
parent 1bd5ecff32
commit cead1796b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 57 additions and 3 deletions

View File

@ -26,7 +26,41 @@ the messages from a Matrix homeserver.
Re-using Hydrogen gets us pretty and native(to Element) looking styles and keeps Re-using Hydrogen gets us pretty and native(to Element) looking styles and keeps
the maintenance burden of supporting more event types in Hydrogen. the maintenance burden of supporting more event types in Hydrogen.
## Prerequisites ## Setup
### Prerequisites
- Node.js v16 - Node.js v16
- We only need v16 because it includes [`require('crypto').webcrypto.subtle`](https://nodejs.org/docs/latest-v16.x/api/webcrypto.html#cryptosubtle) for [Matrix encryption (olm) which can't be disabled in Hydrogen](https://github.com/vector-im/hydrogen-web/issues/579) yet. - We only need v16 because it includes [`require('crypto').webcrypto.subtle`](https://nodejs.org/docs/latest-v16.x/api/webcrypto.html#cryptosubtle) for [Matrix encryption (olm) which can't be disabled in Hydrogen](https://github.com/vector-im/hydrogen-web/issues/579) yet.
### Get the app running
```sh
# We need to use a draft branch of Hydrogen to get the custom changes needed for
# `matrix-public-archive` to run. Hopefully soon, we can get all of the custom
# changes mainlined so this isn't necessary.
$ git clone git@github.com:vector-im/hydrogen-web.git
$ cd hydrogen-web
$ git checkout madlittlemods/matrix-public-archive-scratch-changes
$ yarn install
$ yarn build:sdk
$ cd target/ && npm link && cd ..
$ cd ..
# Now clone and install the `matrix-public-archive` project
$ git clone git@github.com:matrix-org/matrix-public-archive.git
$ cd matrix-public-archive
$ npm install
$ npm link hydrogen-view-sdk
# If you just want to run the tests,you can skip to the "Running tests" section at this point
$ cp config/config.default.json config/config.user-overrides.json
# Edit config/config.user-overrides.json so that it points to your homeserver
# and has an access token
# Now we can finally start the app
$ npm start-dev
```
## Running tests
See the [testing readme](./test/README.md).

View File

@ -1,12 +1,32 @@
# 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 🙇
```sh ```sh
$ docker pull matrixdotorg/synapse:latest $ docker pull matrixdotorg/synapse:latest
$ docker build -t matrix-public-archive-test-homeserver -f test/dockerfiles/Synapse.Dockerfile test/dockerfiles/ $ docker build -t matrix-public-archive-test-homeserver -f test/dockerfiles/Synapse.Dockerfile test/dockerfiles/
```
```sh
$ docker-compose --project-name matrix_public_archive_test -f test/docker-compose.yml up -d --no-recreate $ docker-compose --project-name matrix_public_archive_test -f test/docker-compose.yml up -d --no-recreate
``` ```
## Running the tests
```sh
$ 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
```
### Developer utility
```sh ```sh
$ docker ps --all | grep test_hs $ docker ps --all | grep test_hs
$ docker logs -f --tail 10 matrix_public_archive_test_hs1_1 $ docker logs -f --tail 10 matrix_public_archive_test_hs1_1