-
Notifications
You must be signed in to change notification settings - Fork 206
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
Support site-specific tests #1331
Comments
Yes! We definitely need this! 👍
So the data that will be used is that from |
Yes, it would use the normal startup sequence. |
We may also want to exclude site tests from the full Zotonic test suite, so you can run the Zotonic tests (when doing Zotonic dev work) separately from your site’s tests. |
With |
Indeed, by naming the tests this way they are automatically excluded, that's the idea at least. |
I'm adding a new notification for when a site is fully started and ready to go, so we can do:
|
@arjan doesn't that await need some extra code, as I would assume it just does a kind of subscribe once, which would then be triggered for any site. Maybe add a |
On a related note: I would like to change the site start sequence from a simple supervisor to a state machine, so we can better handle crashes, on-demand site starting etc. Each site would then have a single supervised state machine, which manages the site's supervisor |
Yeah let's move the state machine thing to a different issue because we already had quite some talk about it in the past. I added a new notification at the end of |
I'll create a PR shortly. |
Wow the site startup is one big hairy mess :'( |
Waiting for the |
This is done, thanks @arjan! 😄 |
It would be nice to have a way to create test cases for everything related to your site. For instance, testing the installation of the site and its domain model, whether all modules are started and configured correctly, whether ACL rules are set up properly, et cetera.
My proposal is to create a test runner
z_sitetests:run(sitename).
which does the following:
z_installer
now starts the site and installs everything that's configured)eunit
that conform to the pattern:sitename_*_sitetest.erl
Initially this will only work inside the Zotonic shell but later we can make it externally callable in order to connect it with a CI system.
Naming the tests
*_sitetest
helps in preventing conflicts with our current Zotonic-wide tests.The text was updated successfully, but these errors were encountered: