Skip to content

Commit

Permalink
chore: enable e2e tests (#2)
Browse files Browse the repository at this point in the history
<!--
Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.
-->
  • Loading branch information
EstebanBorai authored Nov 20, 2023
1 parent 2887fa4 commit b8e178c
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 12 deletions.
33 changes: 23 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,29 @@ jobs:
- name: Unit Tests
run: cargo test -p matrix

# - name: Install Just
# uses: extractions/setup-just@v1
- name: Create a copy of `.env.example`
run: cp ./.env.example ./.env

# - name: Generate Configuration
# run: just gen_synapse_conf
- name: Generate Synapse Configuration
run: |
docker run -i --rm -v ./docker/synapse:/data \
--env-file .env \
matrixdotorg/synapse:v1.96.1 generate
# - name: Prepare Data for Tests
# run: docker compose up -d
- name: Use Test Homeserver
run: |
sudo cp -f ./crates/test/fixtures/synapse/homeserver.yaml ./docker/synapse/homeserver.yaml
# - name: E2E Tests
# env:
# COMMUNE_SYNAPSE_HOST: 'http://0.0.0.0:8008'
# run: cargo test -p test -- --test-threads=1
- name: E2E Tests
run: |
docker compose up -d
sleep 10
cargo test -p test -- --test-threads=1
- name: Print Logs
if: always()
run: |
docker-compose logs --no-color --tail=1000 synapse > synapse.log
cat ./synapse.log
docker compose down
docker ps
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ database:
- user: synapse_user
- password: secretpassword
- database: synapse
- host: synapse_database
- host: localhost
- port: 5432
- cp_min: 5
- cp_max: 10
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ services:
env_file:
- .env
restart: always
network_mode: 'host'
depends_on:
- synapse_database

Expand Down
2 changes: 1 addition & 1 deletion fixtures/synapse/homeserver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ database:
user: synapse_user
password: secretpassword
database: synapse
host: synapse_database
host: localhost
port: 5432
cp_min: 5
cp_max: 10
Expand Down

0 comments on commit b8e178c

Please sign in to comment.