App::Yath::Plugin::Notify - Plugin to send email and/or slack notifications
This plugin is used for sending email and/or slack notifications from yath.
#!/usr/bin/perl use Test2::V0; # HARNESS-META owner author@example.com # HARNESS-META slack #slack_channel # HARNESS-META slack #slack_user
You can use the # HARNESS-META owner EMAIL_ADDRESS to specify an "owner" email address. You can use the # HARNESS-META slack USER/CHANNEL to specify a slack user or channel that owns the test.
# HARNESS-META owner EMAIL_ADDRESS
# HARNESS-META slack USER/CHANNEL
$ yath test -pNotify ...
Also of note, most of the time you can just specify the notification options you want and the plugin will load as needed as long as --no-scan-plugins was not specified.
--no-scan-plugins
$ yath test --notify-email-owner --notify-email-from user@example.com --notify-email-fail fixer@example.com
A slack hooks url is always needed for slack to work.
$ yath test --notify-slack-url https://hooks.slack.com/... --notify-slack-fail '#foo' --notify-slack-owner
Email the test results to the specified email address(es)
Can be specified multiple times
Email failing results to the specified email address(es)
If any email is sent, this is who it will be from
Email the owner of broken tests files upon failure. Add `# HARNESS-META-OWNER foo@example.com` to the top of a test file to give it an owner
Usually owner failures are sent as a single batch at the end of testing. Toggle this to send failures as they happen.
Send results to a slack channel and/or user
Send failing results to a slack channel and/or user
Send slack notifications to the slack channels/users listed in test meta-data when tests fail.
Specify an API endpoint for slack webhook integrations
Add a custom text snippet to email/slack notifications
Use the specified module to generate messages for emails and/or slack.
The source code repository for Test2-Harness can be found at http://github.com/Test-More/Test2-Harness/.
Copyright 2020 Chad Granum <exodist7@gmail.com>.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See http://dev.perl.org/licenses/
To install Test2::Harness, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test2::Harness
CPAN shell
perl -MCPAN -e shell install Test2::Harness
For more information on module installation, please visit the detailed CPAN module installation guide.