Skip to main content

Avocado Mail Notification for Jobs

Project description

The Mail result plugin enables you to receive email notifications for job start and completion events within the Avocado testing framework.

Installation

To install the Mail results plugin from pip, use:

$ pip install avocado-framework-plugin-result-mail

Configuration

To use the Mail Result plugin, you need to configure it in the Avocado settings file.

(avocado.conf located /etc/avocado/ if not present you can create the file) Below is an configuration example:

[plugins.mail]

# The email address to which job notification emails will be sent.
recipient = avocado@local.com

# The subject header for the job notification emails.
header = [AVOCADO JOB NOTIFICATION]

# The email address from which the job notification emails will be sent.
sender = avocado@local.com

# The SMTP server address for sending the emails.
server = smtp.gmail.com

# The SMTP server port for sending the emails.
port = 587

# The application-specific password for the sender email address.
password = abcd efgh ijkl mnop

# The detail level of the email content.
# Set to false for a summary with essential details
# or true for detailed information about each failed test.
verbose = false

Usage

Once configured, the Mail result plugin will automatically send email notifications for job start and completion events based on the specified settings.

Obtaining an App Password for Gmail

Please follow these steps to generate an App Password:

Create & use app passwords

Important: To create an app password, you need 2-Step Verification on your Google Account.

  1. Go to your Google Account.

  2. Select Security.

  3. Under “How you sign in to Google,” select 2-Step Verification.

  4. At the bottom of the page, select App passwords.

  5. Enter a name that helps you remember where you’ll use the app password.

  6. Select Generate.

  7. To enter the app password, follow the instructions on your screen.

  8. The app password is the 16-character code that generates on your device.

  9. Select Done.

Enter the App Password inside of the avocado configuration file.

Remember to keep this App Password secure and don’t share it with anyone. If you suspect it has been compromised, you can always revoke it and generate a new one.

Example Plugin Outputs

Verbose True

Job Notification - Job abca44fb69558024b0af74a5654ab282f00f1253
===============================================================

Job Total Time: 24.03 Seconds
Job Finished At: 2024-06-25 16:31:58

Results
-------

- PASS: 6
- ERROR: 0
- FAIL: 1
- SKIP: 0
- WARN: 0
- INTERRUPT: 0
- CANCEL: 0

Test Summary
------------

Name: selftests/safeloader.sh
Status: FAIL
Fail Reason:
Actual Time Start: 1719325898.06546
Actual Time End: 1719325902.474006
ID: static-checks-4-selftests/safeloader.sh
Log Directory: /home/hlynden/avocado/job-results/job-2024-06-25T16.31-abca44f/test-results/static-checks-4-selftests_safeloader.sh
Log File: /home/hlynden/avocado/job-results/job-2024-06-25T16.31-abca44f/test-results/static-checks-4-selftests_safeloader.sh/debug.log
Time Elapsed: 4.410571283999161 seconds
Time Start: 22630.607959844
Time End: 22635.018531128
Tags: {}
Whiteboard:
Verbose False

Job Notification - Job 83da84014a9cbe7a89bea398eb1608dc04743897
===============================================================

Job Total Time: 24.03 Seconds
Job Finished At: 2024-06-25 16:31:58

Results
-------

- PASS: 6
- ERROR: 0
- FAIL: 1
- SKIP: 0
- WARN: 0
- INTERRUPT: 0
- CANCEL: 0

Test Summary
------------

Name: selftests/safeloader.sh
Fail Reason:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

avocado_framework_plugin_result_mail-111.0.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file avocado_framework_plugin_result_mail-111.0.tar.gz.

File metadata

File hashes

Hashes for avocado_framework_plugin_result_mail-111.0.tar.gz
Algorithm Hash digest
SHA256 56cb30f95dffd7552bb802d0fe00800d448fdfb766d3a9401133f71e4f1fbca0
MD5 4a4b04442423b77bf4e73de70b725a09
BLAKE2b-256 432d07bcc472c482e84df15dbb2097bb6ee071fb29d912ed36d1bbde0fe0a611

See more details on using hashes here.

Provenance

The following attestation bundles were made for avocado_framework_plugin_result_mail-111.0.tar.gz:

Publisher: release.yml on avocado-framework/avocado

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file avocado_framework_plugin_result_mail-111.0-py3-none-any.whl.

File metadata

File hashes

Hashes for avocado_framework_plugin_result_mail-111.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3768d67a588e89c1da2ddf8bc38135fd42559a38f243d1aaa899173745135d36
MD5 ef0e88a9f4b99e4051bdb523a4fdd012
BLAKE2b-256 6ced25a63769bec457d4bbc1df8b78977bc7493b3de594778d39c61a2c509114

See more details on using hashes here.

Provenance

The following attestation bundles were made for avocado_framework_plugin_result_mail-111.0-py3-none-any.whl:

Publisher: release.yml on avocado-framework/avocado

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page