Skip to content

Conversation

@Exirel
Copy link
Contributor

@Exirel Exirel commented May 16, 2021

Description

After discussing #2065 it appears that "how to test a plugin" isn't well documented, so here is a PR for that.

I think there are more that can be written, in particular about factories and how to use them.

I also added a convenient method to clear backend.message_sent, so you don't have to do it manually. It's useful when you have a bunch of automated messages, or when you don't want to write more than one test method for different yet very similar use cases (for example: trigger by a regular user vs admin vs owner).

Checklist

  • I have read CONTRIBUTING.md
  • I can and do license this contribution under the EFLv2
  • No issues are reported by make qa (runs make quality and make test)
  • I have tested the functionality of the things this change touches

@Exirel Exirel added this to the 7.1.0 milestone May 16, 2021
@Exirel Exirel requested a review from dgw May 16, 2021 16:12
Copy link
Member

@dgw dgw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love these additions! Did my usual thing, on mobile though (so not a great view of indentation or line length). Adjust suggestions as needed to wrap properly, etc.

@Exirel
Copy link
Contributor Author

Exirel commented May 16, 2021

I love these additions! Did my usual thing

Thanks! Will fix that tomorrow.

Copy link
Member

@dgw dgw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that it? Are we done after just these two last nitpicks, or is Exi going to dump another 500 lines on me in a few days? 😁

Exirel and others added 2 commits May 21, 2021 22:45
@Exirel Exirel force-pushed the docs-plugin-tests branch from e8fa6b3 to 9f1525e Compare May 21, 2021 20:46
@Exirel
Copy link
Contributor Author

Exirel commented May 21, 2021

Is that it?

Yeah. I feel like I could write documentation for the Trigger factory, but I realized that it's almost an internal tool made to test some very specific part of Sopel's code. So I think I won't add (at least for now) a full-length explanation about it, and just leave the reader with the current docstrings, and having to look at our test suite.

That's good enough for me!

@Exirel Exirel marked this pull request as ready for review May 21, 2021 20:51
Copy link
Member

@dgw dgw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@dgw dgw merged commit 2d47406 into sopel-irc:master May 23, 2021
@Exirel Exirel deleted the docs-plugin-tests branch December 31, 2021 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants