1App::Yath::Plugin::NotiUfsye(r3)Contributed Perl DocumenAtpapt:i:oYnath::Plugin::Notify(3)
2
3
4
6 App::Yath::Plugin::Notify - Plugin to send email and/or slack
7 notifications
8
10 This plugin is used for sending email and/or slack notifications from
11 yath.
12
14 IN A TEST
15 #!/usr/bin/perl
16 use Test2::V0;
17 # HARNESS-META owner author@example.com
18 # HARNESS-META slack #slack_channel
19 # HARNESS-META slack #slack_user
20
21 You can use the "# HARNESS-META owner EMAIL_ADDRESS" to specify an
22 "owner" email address. You can use the "# HARNESS-META slack
23 USER/CHANNEL" to specify a slack user or channel that owns the test.
24
25 RUNNING WITH NOTIFICATIONS ENABLED
26 $ yath test -pNotify ...
27
28 Also of note, most of the time you can just specify the notification
29 options you want and the plugin will load as needed as long as
30 "--no-scan-plugins" was not specified.
31
32 EMAIL
33
34 $ yath test --notify-email-owner --notify-email-from user@example.com --notify-email-fail fixer@example.com
35
36 SLACK
37
38 A slack hooks url is always needed for slack to work.
39
40 $ yath test --notify-slack-url https://hooks.slack.com/... --notify-slack-fail '#foo' --notify-slack-owner
41
43 COMMAND OPTIONS
44 Notification Options
45
46 --notify-email foo@example.com
47 --no-notify-email
48 Email the test results to the specified email address(es)
49
50 Can be specified multiple times
51
52 --notify-email-fail foo@example.com
53 --no-notify-email-fail
54 Email failing results to the specified email address(es)
55
56 Can be specified multiple times
57
58 --notify-email-from foo@example.com
59 --no-notify-email-from
60 If any email is sent, this is who it will be from
61
62 --notify-email-owner
63 --no-notify-email-owner
64 Email the owner of broken tests files upon failure. Add `# HARNESS-
65 META-OWNER foo@example.com` to the top of a test file to give it an
66 owner
67
68 --notify-no-batch-email
69 --no-notify-no-batch-email
70 Usually owner failures are sent as a single batch at the end of
71 testing. Toggle this to send failures as they happen.
72
73 --notify-no-batch-slack
74 --no-notify-no-batch-slack
75 Usually owner failures are sent as a single batch at the end of
76 testing. Toggle this to send failures as they happen.
77
78 --notify-slack '#foo'
79 --notify-slack '@bar'
80 --no-notify-slack
81 Send results to a slack channel and/or user
82
83 Can be specified multiple times
84
85 --notify-slack-fail '#foo'
86 --notify-slack-fail '@bar'
87 --no-notify-slack-fail
88 Send failing results to a slack channel and/or user
89
90 Can be specified multiple times
91
92 --notify-slack-owner
93 --no-notify-slack-owner
94 Send slack notifications to the slack channels/users listed in test
95 meta-data when tests fail.
96
97 --notify-slack-url https://hooks.slack.com/...
98 --no-notify-slack-url
99 Specify an API endpoint for slack webhook integrations
100
101 --notify-text ARG
102 --notify-text=ARG
103 --message ARG
104 --message=ARG
105 --msg ARG
106 --msg=ARG
107 --no-notify-text
108 Add a custom text snippet to email/slack notifications
109
110 --notify-text-module ARG
111 --notify-text-module=ARG
112 --message_module ARG
113 --message_module=ARG
114 --no-notify-text-module
115 Use the specified module to generate messages for emails and/or
116 slack.
117
119 The source code repository for Test2-Harness can be found at
120 http://github.com/Test-More/Test2-Harness/.
121
123 Chad Granum <exodist@cpan.org>
124
126 Chad Granum <exodist@cpan.org>
127
129 Copyright 2020 Chad Granum <exodist7@gmail.com>.
130
131 This program is free software; you can redistribute it and/or modify it
132 under the same terms as Perl itself.
133
134 See http://dev.perl.org/licenses/
135
136
137
138perl v5.34.1 2022-07-11 App::Yath::Plugin::Notify(3)