Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove matrix-bot-sdk usage in tests #15

Merged

Conversation

MadLittleMods
Copy link
Contributor

@MadLittleMods MadLittleMods commented Jun 9, 2022

Remove matrix-bot-sdk usage in tests because it didn't have timestamp massaging ?ts and it's not really necessary to rely on since we can just call the API directly 🤷. matrix-bot-sdk is also very annoying having to build rust crypto packages.

We're now using direct fetch requests against the Matrix API and lightweight client object.

npm run test

> [email protected] test
> npm run mocha -- test/e2e-tests.js --timeout 15000


> [email protected] mocha
> mocha "test/e2e-tests.js" "--timeout" "15000"

Config is using nodeEnv=test


  matrix-public-archive
server process.env.NODE_ENV test
    Test fixture homeservers
      √ Test federation between fixture homeservers (1864ms)
    Archive
      √ shows all events in a given day (1020ms)
      √ can render diverse messages (1193ms)
      - can render day back in time from room on remote homeserver we haven't backfilled from
      - will redirect to hour pagination when there are too many messages
      - will render a room with only a day of messages
      - will render a room with a sparse amount of messages (a few per day) with no contamination between days


  3 passing (4s)
  4 pending

Here is the interactive result at the end of the diverse messages test. Everything is working as expected and image is thumbnailing and full image in lightbox,

Tests not quite working yet because we moved to a static date back in time and we can't use the `/send/txnId?ts=123`
timestamp massaging from a normal client. Needs to be an application service.
@MadLittleMods MadLittleMods added the T-Task Refactoring, removal, replacement, enabling or disabling functionality, other engineering tasks. label Jun 9, 2022
@MadLittleMods MadLittleMods changed the title Draft: Remove matrix-bot-sdk usage in tests Remove matrix-bot-sdk usage in tests Jun 9, 2022
@MadLittleMods MadLittleMods marked this pull request as ready for review June 9, 2022 22:46
…the full lightbox version does

✅ Works:
http://localhost:11008//_matrix/media/r0/download/hs1/tefQeZhmVxoiBfuFQUKRzJxc

❌: `{"errcode":"M_NOT_FOUND","error":"Not found [b'hs1', b'tefQeZhmVxoiBfuFQUKRzJxc']"}`
http://localhost:11008//_matrix/media/r0/thumbnail/hs1/tefQeZhmVxoiBfuFQUKRzJxc?width=400&height=195&method=scale
@MadLittleMods MadLittleMods merged commit 9fc71a3 into main Jun 10, 2022
@MadLittleMods MadLittleMods deleted the madlittlemods/remove-matrix-bot-sdk-usage-in-tests branch April 26, 2023 09:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-Task Refactoring, removal, replacement, enabling or disabling functionality, other engineering tasks.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant