Commit Graph

163 Commits

Author SHA1 Message Date
gnuxie 48c0fec134 Remove acceptInvitesFromSpace.
https://github.com/the-draupnir-project/Draupnir/issues/433.
Sucks balls, mare.
2024-05-22 16:15:58 +01:00
gnuxie a4833bcf3a Fix unban command.
https://github.com/the-draupnir-project/Draupnir/issues/401.
2024-05-06 16:40:03 +01:00
gnuxie 0049dfd367 Update for MPS ProtectedRoomsManager. 2024-05-02 15:57:44 +01:00
gnuxie 2bbca6d27a Update for MPS's PowerLevelMirror. 2024-05-02 15:57:44 +01:00
gnuxie 80ccb64330 Implement RoomStateBackingStore with BetterSqlite. 2024-04-06 20:03:38 +01:00
gnuxie 6957b3e404 Fix eslint (i don't think this was ever working :/) 2024-04-06 20:03:37 +01:00
gnuxie 326d95df67 fix listUnstarted appservice integration test. 2024-04-06 20:03:37 +01:00
gnuxie ad01b09773 Fix appservice provisioning. 2024-04-06 20:03:37 +01:00
gnuxie 0b658fb5d0 fix roomsTests.ts 2024-04-06 20:03:37 +01:00
gnuxie 9a47ec3204 fix redactCommandTest. 2024-04-06 20:03:37 +01:00
gnuxie 02d9712e12 remove standardConsequenceTest
superseded with capability providers in MPS.
We forgot to remove the test.
2024-04-06 20:03:37 +01:00
gnuxie 704e9b94c3 remove roomMembersTest
this is superseded by `SetMembership` from MPS.
we forgot to remove the test.
2024-04-06 20:03:37 +01:00
gnuxie ae93e9c8d4 remove protectionSettingsTest
they now belong in MPS.
2024-04-06 20:03:37 +01:00
gnuxie 0613447e07 Remove banListTest
farewell old friend.
2024-04-06 20:03:37 +01:00
gnuxie 565df8b362 Delete protectedRoomsConfigTest.ts
We just don't have a way to test this right now without changing
a bunch of code. Which we would basically want to do to rewrite
the testing harness anyhow, so it's not worth it right now.
2024-04-06 20:03:37 +01:00
gnuxie c438eca08c Fix commandUtils
Alright, they're not using the safe emitter, but neither are the
consumers.
2024-04-06 20:03:37 +01:00
gnuxie 1d0c57cea8 fix throttleQueueTest 2024-04-06 20:03:37 +01:00
gnuxie c9db033043 fix utilsTest.ts 2024-04-06 20:03:37 +01:00
gnuxie 979bef6013 Revert "Attempt make draupnirFactory accessible to integration tests"
This reverts commit 68ca69882bd7627414951aef11985408fd29dec8.
2024-04-06 20:03:37 +01:00
gnuxie 6d52137501 Attempt make draupnirFactory accessible to integration tests
But this won't work as we'd have to mess about a lot with
the clientsinroommap
2024-04-06 20:03:37 +01:00
gnuxie 6ff8c52aca Remove detectFederationLagTest
idk this one might come back some time but we don't have the protection
and associated command anymore.
2024-04-06 20:03:37 +01:00
gnuxie c3cfad93e7 Fix shutdown room command test. 2024-04-06 20:03:37 +01:00
gnuxie 40ffa2a114 Fix hijack room command test. 2024-04-06 20:03:37 +01:00
gnuxie 692bc298e1 Add 'done' from mocha test context to draupnir test context. 2024-04-06 20:03:37 +01:00
gnuxie 0cb0beecb0 Tidy up helloTest slightly. 2024-04-06 20:03:37 +01:00
gnuxie 96428d617d Fix CommandReaderTest.ts. 2024-04-06 20:03:37 +01:00
gnuxie c1bfcf610e Begin moving from ConsequenceProvider to CapabilityProviderSet.
We gotta sort out the glue and the renderering yet.
2024-04-06 20:03:36 +01:00
gnuxie 8044a78fa6 Fix reportPollerTest (it works!) 2024-04-06 20:03:36 +01:00
gnuxie 2198c34b55 Chore: please typescript in abuseReportTest. 2024-04-06 20:03:36 +01:00
gnuxie 28d220142e Chore: Delete random crap that was accidentally comitted sometime 2024-04-06 20:03:36 +01:00
gnuxie 380f4b1a77 Update for ClientsInRoomsMap rework (MPS). 2024-04-06 20:03:36 +01:00
gnuxie c1215ab045 Create a test/tsconfig.json.
We then run this as part of the build step, then run tsc with the
original project file to get the side effect of emitting the source
files. Since the `test/tsconfig.json` has `noEmit: true`.
2024-04-06 20:03:36 +01:00
gnuxie 0dc7c84afd Fix BanPropagationProtectionTest (it works!)
However, it does hang because something is sat on the event loop,
i can't find out what yet.
2024-04-06 20:03:36 +01:00
gnuxie dba3aefca3 Fix acceptInviteFromSpaceTest. (it works!) 2024-04-06 20:03:36 +01:00
gnuxie e17ebe1ff0 Fix abuseReportTest (it works!). 2024-04-06 20:03:36 +01:00
gnuxie d718967a7c Fix hello test (it works).
Ok so this is pretty shit, i hate the integration test suite now.

The reason why we return the test functions with `as any` in the
hello test is because we had to remove `Record<string, any>` from
mocha's test context interface, otherwise the interface would
have been completely useless. Maybe there is a ts setting though
to not infer any from `this` at all? and just ignore those properties.

The tsconfig.json situation is a bit weird, i don't understand why
it's in this situation. However, it seems like we can try to
https://github.com/jaredpalmer/tsdx/issues/84#issuecomment-489690504
use this workaround so that ts language features work in the test
directory.

I think we should focus on doing as little effort as possible getting
these tests into working condition. If something is too complicated,
it will need removing. If we need to make additional tests,
this entire integration tests directory should be moved
to a legacy-integration directory and we can start afresh.

We should also ideally not integration tests as much as possible
and try to reuse the unit helpers from MPS.
This is even going to be critical later on.
2024-04-06 20:03:36 +01:00
gnuxie cc97c8550e Naively fix appservice integration tests. 2024-04-06 20:03:36 +01:00
gnuxie 3eb3bae085 Instantiate web apis in an appropriate place. 2024-04-06 20:03:36 +01:00
gnuxie 0c2d391ff4 Fix inverted boolean logic in CommandReader.
We couldn't read room references.
2024-04-06 20:03:35 +01:00
gnuxie ac4c447637 Start client in manual launch script.
Not doing this would just cause draupnir to exit.
2024-04-06 20:03:35 +01:00
gnuxie c6f198303d Start fixes to dev environment 2024-04-06 20:03:35 +01:00
gnuxie 6d28ac81b0 Remove the RuleServer.
It was never used and we don't test it.
We can't really support it.
2024-04-06 20:03:32 +01:00
Gnuxie bef21850e8 Use --forbid-only flag in integration test suite. (#97)
Yes this has happened again, at least we know how to fix it now.
2023-09-07 14:13:26 +01:00
gnuxie 73601687a8 Add UnbanPropagation BanPropagationProtection.
https://github.com/Gnuxie/Draupnir/pull/93/
2023-09-05 19:53:02 +01:00
Gnuxie 0a7305b8fa A simple script for testing room membership query. (#81)
https://github.com/Gnuxie/Draupnir/issues/80
2023-08-29 13:56:33 +01:00
Aminda Suomalainen e4c02b96cd Add pre-commit configuration (#34)
* add .pre-commit-config.yaml

Signed-off-by: Aminda Suomalainen <suomalainen+git@mikaela.info>

* .editorconfig: decrease indent size for text

* .pre-commit-config.yaml: remove prettier

Signed-off-by: Aminda Suomalainen <suomalainen+git@mikaela.info>

* .editorconfig consistency.

* .pre-commit-config.yaml: restore sample hooks

* .editorconfig: disable indent_size for LICENSE & NOTICE

* pre-commit run --all-files

* tsconfig.json: tabs to spaces

* .pre-commit-config.yaml: update editorconfig-checker to 2.7.2

* .editorconfig: disable indent_size for markdown

* mjolnir-entrypoint.sh: retab

* .editorconfig: also exclude json from indent checking

* test/nginx.conf: retab

* test/integration/commands/redactCommandTest.ts: remove leading space

* retab or remove leading whitespaces for the rest of the files

* src/appservice/datastore.ts remove newlines

* test/integration/commands/roomTest.ts: remove leading space.

---------

Signed-off-by: Aminda Suomalainen <suomalainen+git@mikaela.info>
Co-authored-by: gnuxie <Gnuxie@protonmail.com>
2023-08-29 13:38:00 +01:00
Gnuxie 56ddbdf96c Failure to ban a single member should not stop other bans being applied. (#79)
Fixes https://github.com/Gnuxie/Draupnir/issues/74.
2023-08-28 16:38:24 +01:00
Gnuxie c11fb6ef06 Fix an issue where protected rooms could not be removed. (#65)
This was introduced in https://github.com/Gnuxie/Draupnir/pull/54/ (and therefore 1.83.0). Essentially we forgot to remove the room from the protected rooms set, when the remove command was used.

Ontop of this something to note is that during testing it is clear that the protected rooms set is loaded when configuring mjolnir, not when starting it. This is problematic as it means setup code in `fixtures.ts` does not actually wipe the protected rooms set.
2023-07-04 17:19:03 +01:00
Gnuxie c16c5d29e1 Integration tests convenience nginx should listen to ipv6 too. 2023-05-13 15:21:21 +01:00
Gnuxie 99e6f168ca Appservice convenience (#47)
Canonicalise the existence of the "admin room" for managing the appservice and Draupnir instances

* Add utilities for managing users in the admin room

* Merge the appservice admin room and access control list.

The majority of admins will need to use the draupnir admin commands
to manage the list.

* Utility methods for creating generic rules in PolicyLists.

* Commands for managing appservice users.
2023-05-03 16:31:28 +01:00