Reports
Get suite results and summaries in Slack, Microsoft Teams or email, and choose who hears about what.
Cofactor sends the result of each suite run to a Slack channel, a Microsoft Teams channel or an email list. You choose where. A failed run comes with a verdict. Reports and alerts are on every plan.
Send suite results to a channel
-
Connect Slack. An organization admin connects Slack. See Slack. For Microsoft Teams, add the Cofactor app to the channel. For email, there is nothing to connect.
-
Add a destination. Open Suites, then Alerts, and select New alert. Under Applies to, pick All suites. Under Destination, pick Email, Slack or Microsoft Teams, then pick the channel or enter the addresses. Choose When, then select Save alert.
- Failures only sends only when a run has failures. This is the default.
- Every run sends for every run.
Every suite run in your organization sends its result to these destinations, whether it ran by hand or on a schedule. A list holds up to 10 destinations. If a suite or schedule lists the same Slack channel, Teams channel or email addresses, that destination still gets one alert per run.
-
Or use the CLI. An organization has one suite completion alert. Put every channel on it.
alert editreplaces the channels, so pass the current ones again when you add one.bashcofactor alert create --name "Suite failures" \ --slack "#qa-alerts" --email qa@example.com --when failure cofactor alert list
For a private Slack channel, invite the Cofactor app to it first.
-
To send the results of one suite or one scheduled run somewhere else, make an alert with Applies to set to One suite or One schedule. See Suites and schedules.
What a report says
A report shows the pass and fail counts, the failed tests and a link to the run. Slack and email mark each failed test as new or still failing. Email also says how long a test has been failing, for example "Failing for 3 runs since Nov 24".
After a failed run, Slack and email also carry the triage verdict, its headline, and the number of failures, findings and newly failing tests. See Triage.
When a run has tests that did not pass, Slack and email wait for triage before they send, up to 20 minutes. If triage is not done by then, they send the failed tests without a summary. A Slack channel set to On success & failure can show a live card while the suite runs, and Cofactor adds the triage summary to that card when triage finishes.
Microsoft Teams cards send at once. They show the pass rate, the counts and the failed tests, and they carry no triage summary.
Get your own alerts
Open Suites, then Alerts, and select New alert. Under Send to, pick Me (runs I start). Turn on Email, Slack DM or both, then select Save alert. Slack direct messages need a linked Slack account. The alert shows in the Me (runs I start) list on the same page.
Check it worked
Run a suite that has a failing test, then read the delivery record. Each send shows as completed, pending, or failed with the error.
cofactor alert list cofactor alert deliveries <alert id>
If a Slack alert did not arrive, check that Slack is still connected and the Cofactor app is in the channel.
Go deeper
- Triage explains the verdict in a report.
- Issues covers the bugs a failed run files.
- Suites and schedules covers schedules and their alerts.
- Reference: Slack
Pause an alert, filter alerts and alerts for your own suites.
To pause, resume or remove an alert, run cofactor alert pause <alert id>, cofactor alert resume <alert id> or cofactor alert delete <alert id>.
To make an alert fire only when a condition holds, add --filter "field:operator:value". For a suite completion alert the fields are test_suite.status (completed or completed_with_errors), test_suite.failed_workflows and test_suite.triggered_by.reason. The operators are equals, not_equals, contains, starts_with, ends_with, matches and in.
cofactor alert edit <alert id> --slack "#qa-alerts" --when failure \ --filter "test_suite.status:equals:completed_with_errors"
Each area of an external suite can have its own alerts and its own triage setting. See cofactor test-suite area settings.