Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Robbie committed Aug 31, 2022
0 parents commit a824282
Show file tree
Hide file tree
Showing 6 changed files with 467 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/vendor
/composer.lock
.DS_Store
.idea
*.yml
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2016

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
72 changes: 72 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
slack-codeception-extension
=============================
This package provides an extension for Codeception to send test results to Slack channels and/or users.

Pre-requisites
-------------

- a pre-configured webhook from the Slack integration "Incoming Webhook"
(see https://api.slack.com/incoming-webhooks for more information)

Installation
-----------

Add the package `ngraf/slack-codeception-extension` to `composer.json` manually or type this in console:

composer require ngraf/slack-codeception-extension

Usage
-----
Enable and configure the extension in your `codeception.yaml`

**Basic** usage:

extensions:
enabled:
- Codeception\Extension\SlackExtension
config:
Codeception\Extension\SlackExtension:
webhook: https://hooks.slack.com/services/...
**Advanced** usage:

extensions:
enabled:
- Codeception\Extension\SlackExtension
config:
Codeception\Extension\SlackExtension:
webhook: https://hooks.slack.com/services/...
# possible notification strategies: always|successonly|failonly|failandrecover|statuschange
strategy: always
# If 'true' details about failed tests will be displayed. Default value: 'false'
extended: true
# Limit the size of error messages in extended mode. 0 = unlimited. Default value: 80
extendedMaxLength: 80
# Limit the amount of reported errors in extended mode. 0 = unlimited. Default value: 0
extendedMaxErrors: 10
# customize your message with additional prefix and/or suffix
messagePrefix: '*Smoke-Test*'
messageSuffix: <http://my-ci/my-job|Link>
messageSuffixOnFail: <!channel>
# optional config keys that will overwrite the default configuration of the webhook
channel: '#any-channel,@any-user'
channelOnFail: '#any-channel,@any-user'
username: CI
icon: :ghost:
Example
-----

![slack-example](slack-example.png)

Dependencies
-----
This package uses the package [maknz/slack](https://github.com/maknz/slack) to communicate with the Slack API.
25 changes: 25 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "ngraf/slack-codeception-extension",
"description": "This package provides an extension for Codeception to broadcast test results in Slack messenger ",
"keywords": [
"codeception",
"slack",
"extension"
],
"authors": [
{
"name": "Norbert Graf",
"email": "[email protected]",
"homepage": "https://github.com/ngraf",
"role": "Developer"
}
],
"autoload": {
"psr-4": {
"Codeception\\": "src"
}
},
"require": {
"alek13/slack": "^2.0"
}
}
Binary file added slack-example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit a824282

Please sign in to comment.