Add more comprehensive tests#521
Conversation
Bumps [ssb-room](https://github.com/staltz/ssb-room) from 1.2.2 to 1.3.0. - [Release notes](https://github.com/staltz/ssb-room/releases) - [Commits](staltz/ssb-room@v1.2.2...1.3.0) Signed-off-by: dependabot[bot] <support@github.com>
Bumps [ssb-query](https://github.com/dominictarr/ssb-query) from 2.4.3 to 2.4.5. - [Release notes](https://github.com/dominictarr/ssb-query/releases) - [Commits](ssbc/ssb-query@v2.4.3...v2.4.5) Signed-off-by: dependabot[bot] <support@github.com>
Bumps [ssb-ooo](https://github.com/dominictarr/ssb-ooo) from 1.3.2 to 1.3.3. - [Release notes](https://github.com/dominictarr/ssb-ooo/releases) - [Commits](https://github.com/dominictarr/ssb-ooo/commits) Signed-off-by: dependabot[bot] <support@github.com>
Bumps [ssb-blobs](https://github.com/ssbc/ssb-blobs) from 1.2.2 to 1.2.3. - [Release notes](https://github.com/ssbc/ssb-blobs/releases) - [Commits](https://github.com/ssbc/ssb-blobs/commits/v1.2.3) Signed-off-by: dependabot[bot] <support@github.com>
Bumps [ssb-invite](https://github.com/ssbc/ssb-invite) from 2.1.4 to 2.1.6. - [Release notes](https://github.com/ssbc/ssb-invite/releases) - [Commits](https://github.com/ssbc/ssb-invite/commits/v2.1.6) Signed-off-by: dependabot[bot] <support@github.com>
Bumps [ssb-meme](https://github.com/ssbc/ssb-meme) from 1.0.4 to 1.1.0. - [Release notes](https://github.com/ssbc/ssb-meme/releases) - [Commits](ssbc/ssb-meme@v1.0.4...v1.1.0) Signed-off-by: dependabot[bot] <support@github.com>
Bumps [ssb-conn](https://github.com/staltz/ssb-conn) from 0.17.0 to 0.19.1. - [Release notes](https://github.com/staltz/ssb-conn/releases) - [Commits](ssbc/ssb-conn@v0.17.0...v0.19.1) Signed-off-by: dependabot[bot] <support@github.com>
Bumps [ssb-friends](https://github.com/ssbc/ssb-friends) from 4.1.4 to 4.3.0. - [Release notes](https://github.com/ssbc/ssb-friends/releases) - [Commits](ssbc/ssb-friends@v4.1.4...v4.3.0) Signed-off-by: dependabot[bot] <support@github.com>
Bumps [ssb-search](https://github.com/ssbc/ssb-search) from 1.2.1 to 1.3.0. - [Release notes](https://github.com/ssbc/ssb-search/releases) - [Commits](ssbc/ssb-search@v1.2.1...v1.3.0) Signed-off-by: dependabot[bot] <support@github.com>
Bumps [ssb-backlinks](https://github.com/ssbc/ssb-backlinks) from 1.0.0 to 2.1.1. - [Release notes](https://github.com/ssbc/ssb-backlinks/releases) - [Commits](https://github.com/ssbc/ssb-backlinks/commits/v2.1.1) Signed-off-by: dependabot[bot] <support@github.com>
Bumps [ssb-db](https://github.com/ssbc/ssb-db) from 19.4.0 to 20.3.0. - [Release notes](https://github.com/ssbc/ssb-db/releases) - [Commits](ssbc/ssb-db@v19.4.0...v20.3.0) Signed-off-by: dependabot[bot] <support@github.com>
Problem: I've been worried about merging these version bump pull requests since we don't have many tests, and I *really* don't want to merge any catostrophic breaking changes anywhere. Solution: Add some tests that are more comprehensive, starting by creating a temporary SSB database and keypair and then editing the profile, previewing a message, publishing a message, etc., until we have a handful of small functions actually being tested. This won't ensure that everything works forever, and it *really* doesn't test replication, but it should help increase our confidence that test success means that fewer things are broken.
…om-1.3.0' into add-more-tests
…ery-2.4.5' into add-more-tests
…o-1.3.3' into add-more-tests
…obs-1.2.3' into add-more-tests
…vite-2.1.6' into add-more-tests
…me-1.1.0' into add-more-tests
…nn-0.19.1' into add-more-tests
…iends-4.3.0' into add-more-tests
…arch-1.3.0' into add-more-tests
…cklinks-2.1.1' into add-more-tests
|
@black-puppydog for your pleasure I've pulled all of the dep PRs into this one, for a few reasons:
|
…-20.3.0' into add-more-tests-ssb-db
cb9d11c to
26fa020
Compare
Problem: Our tests seem to have been disabled in various places, which means that type errors, typos, and other small problems were introduced. Solution: Remove the comments and fix the underlying problems without disabling the linters.
|
oh man, don't worry about my convenience. I was just amused by the timing of it :P |
|
I think this one is good to go now! |
|
So, I built this and it runs. But my brain is too tired rn to really grok this. From what I see there, you do handle tests in the env, and don't just post willy-nilly into whatever ssb feed is handled on the machine already 👍. but... how does this work if I'm running e.g. patchwork? I'll have to stop that, right? It's 2am here... I'm going to bed. 😛 |
| ) | ||
| : connect({ remote }); | ||
|
|
||
| originalConnect |
There was a problem hiding this comment.
This is the bit meant to keep it from connecting to Patchwork/etc -- usually it does:
- try connection to existing server
- success: keep the connection
- fail: make a new one
- success: connect to it
- fail: crash the server
This change automatically fails the "try connection to existing server" step during tests, which means that it tries to make a new server. If it can make a new server then we know that Patchwork/etc aren't running on that port, and we can run the tests. If it can't make a new server, then Patchwork is probably running and we want to crash loudly.
|
Added a comment to explain that, but go to bed! Talk to you tomorrow dude. |
Problem: With the new ssb-db@20 we have to explicitly add ssb-private1 to ensure that we can see private messages. Solution: Add ssb-private1 as a plugin.
Bumps [@types/koa__router](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/koa__router) from 8.0.2 to 8.0.3. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/koa__router) Signed-off-by: dependabot[bot] <support@github.com>
Bumps [@types/mkdirp](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mkdirp) from 1.0.0 to 1.0.1. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/mkdirp) Signed-off-by: dependabot[bot] <support@github.com>
Bumps [husky](https://github.com/typicode/husky) from 3.1.0 to 4.3.0. - [Release notes](https://github.com/typicode/husky/releases) - [Commits](typicode/husky@v3.1.0...v4.3.0) Signed-off-by: dependabot[bot] <support@github.com>
Bumps [@types/yargs](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/yargs) from 15.0.4 to 15.0.10. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/yargs) Signed-off-by: dependabot[bot] <support@github.com>
|
In case you ever want to test against actual feed content, ssb-fixtures might be of interest. Staltz made it for performance benchmarks but a smaller dataset of say, 15 feeds and a couple hundred messages would also make for good test content. |
|
That's a great idea @cryptix, thanks! Are there any tests that come to mind? I can imagine the fixtures being useful for a human browsing around, because you can tell when stuff "looks right", but I [pre-coffee] can't think of tests that I'd be able to write with them. Clarification: I'm sure there are tests to write with them, I just need help knowing what to test. 😆 |
|
Hmmm... Your decision how wild to go with this but I'd use the fixtures to actually check that a thread is rendered (parse the generated html and use css selectors to check the content. In python there is beautifulsoup for this. I must believe npm has something similar) Another thing that was a bit daunting in the blobs/preview work was testing that a reply actually ends up on a thread still. This could be done on an empty db but fixtures gives you a nice starting ground. Other areas that come to mind |
|
Oh, are the fixtures static? If so, that'd be easy to say "make sure that thread X has 10 comments, including this text". I'll poke at it the next time I've got some time. 🚀 Any thoughts on this PR? I'm excited to get the dep PRs merged and then release the new version of Oasis. |
…koa__router-8.0.3' into add-more-tests
…mkdirp-1.0.1' into add-more-tests
…4.3.0' into add-more-tests
…yargs-15.0.10' into add-more-tests
|
(Trying to close all the dependency PRs in this branch. 🙏 ) |
Yup. The repo contains a generated that should be deterministic but you also don’t need to run it again once you are fine with it, I think. I’m not sure it contains nested replies but those could be created by oasis itself. |
|
Been a couple days so I'm going to self-merge. |
|
sorry @christianbundy for dropping out here. been a crazy worky week so far. |
Problem: I've been worried about merging these version bump pull
requests since we don't have many tests, and I really don't want to
merge any catostrophic breaking changes anywhere.
Solution: Add some tests that are more comprehensive, starting by
creating a temporary SSB database and keypair and then editing the
profile, previewing a message, publishing a message, etc., until we have
a handful of small functions actually being tested. This won't ensure
that everything works forever, and it really doesn't test replication,
but it should help increase our confidence that test success means that
fewer things are broken.