Home

Awesome

System tests for our Matrix software

These tests will be used as a specification what we'll implement next in hghs and will eventually be system tests for our software:

Install test software

git clone git@github.com:heusalagroup/hghs-test.git hghs-test
cd hghs-test
git submodule update --init --recursive
npm install

Start up containers (test subjects)

Select one of the servers for testing.

WARNING! Our docker configurations are not secure enough to be deployed in the public. These are intended to be used for local temporary testing only.

HgHs server

docker-compose up

Our hghs is far from fully functioning Matrix server and probably will never be. It is under test driven development.

Synapse server

docker-compose -f docker-compose.synapse.yml up

When started for the first time, you must create a user for testing:

docker exec -it hghs-test-synapse register_new_matrix_user http://localhost:8008 -c /data/homeserver.yaml --no-admin -u app -p p4sSw0rd123
docker exec -it hghs-test-synapse register_new_matrix_user http://localhost:8008 -c /data/homeserver.yaml --no-admin -u app2 -p p4sSw0rd456

Dendrite server

docker-compose -f docker-compose.dendrite.yml up

When started for the first time, you must create a user for testing:

docker exec -it hghs-test-dendrite /usr/bin/create-account -config /etc/dendrite/dendrite.yaml -username app -password p4sSw0rd123
docker exec -it hghs-test-dendrite /usr/bin/create-account -config /etc/dendrite/dendrite.yaml -username app2 -password p4sSw0rd456

Conduit

docker-compose -f docker-compose.conduit.yml up

Once started, you must manually create test users. Apparently, there is no command line interface to do it. Because of this, I have not tested if Conduit works.

Other servers

You can run the test suite against any Matrix server.

Just start the server running at http://localhost:8008 with a user app and password p4sSw0rd123.

You can also change these settings using following environment variables:

Environment variableDefault value
MATRIX_HS_URLhttp://localhost:8008
MATRIX_HS_USERNAMEapp
MATRIX_HS_USER_ID@app:localhost
MATRIX_HS_PASSWORDp4sSw0rd123
MATRIX_HS_USERNAME_2app2
MATRIX_HS_USER_IDE_2@app2:localhost
MATRIX_HS_PASSWORD_2p4sSw0rd456

Run system tests

npm test

Troubleshooting

connect ECONNREFUSED 127.0.0.1:8008

The backend is not running at port 8008. Is docker services up?