{"id":12832,"library":"artillery-plugin-slack","title":"Artillery Slack Plugin","description":"The `artillery-plugin-slack` package provides a robust integration for Artillery.io, enabling users to send real-time test run notifications directly to a specified Slack channel. Currently at version 1.19.0 (last updated roughly 2 months ago), this plugin integrates seamlessly into Artillery's YAML test scripts. It publishes critical test summary information including whether a test run succeeded or failed, its total duration, the number of Virtual Users (VUs) completed, any encountered errors, and a direct link to the test run's view in Artillery Cloud if applicable. Developed and maintained by the Artillery team, its release cadence is tied to the main Artillery CLI, ensuring compatibility and continuous improvements. This plugin serves as a crucial component for CI/CD pipelines and monitoring setups, providing immediate feedback on performance test outcomes without needing to log into the Artillery dashboard.","status":"active","version":"1.19.0","language":"javascript","source_language":"en","source_url":null,"tags":["javascript"],"install":[{"cmd":"npm install artillery-plugin-slack","lang":"bash","label":"npm"},{"cmd":"yarn add artillery-plugin-slack","lang":"bash","label":"yarn"},{"cmd":"pnpm add artillery-plugin-slack","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"This is an Artillery plugin and requires the Artillery CLI to function. It is configured within Artillery's test scripts rather than being directly imported in user code.","package":"artillery","optional":false}],"imports":[{"note":"Artillery plugins are enabled and configured within the `config.plugins` section of an Artillery YAML test script. There are no direct JavaScript/TypeScript import statements for using this plugin's functionality in a runtime script. The `webhookUrl` is mandatory for sending notifications.","wrong":"import { Slack } from 'artillery-plugin-slack'; // Incorrect: Plugins are configured, not imported in JS/TS","symbol":"Slack Plugin Configuration","correct":"plugins:\n  slack:\n    webhookUrl: 'https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX'"},{"note":"The `artillery-plugin-slack` plugin is activated implicitly when an Artillery test script containing its configuration is executed via the `artillery` CLI. It doesn't expose exportable symbols for direct programmatic use.","wrong":"node my-test.js // Incorrect: Artillery tests are run via the Artillery CLI, typically with a YAML file.","symbol":"Artillery Test Script (main execution)","correct":"artillery run my-test.yml"},{"note":"To enable debug logging for the Slack plugin and troubleshoot issues, set the `DEBUG` environment variable to `plugin:slack` before running your Artillery test. This applies specifically to the internal workings of the plugin itself.","wrong":"console.log('Debugging Slack plugin'); // Not effective for internal plugin logging","symbol":"Debugging","correct":"DEBUG=plugin:slack artillery run my-test.yml"}],"quickstart":{"code":"config:\n  target: \"https://api.example.com\"\n  phases:\n    - duration: 60\n      arrivalRate: 5\n      name: \"Warm up\"\n    - duration: 120\n      arrivalRate: 10\n      name: \"Peak load\"\n  plugins:\n    slack:\n      webhookUrl: \"${process.env.SLACK_WEBHOOK_URL ?? ''}\"\n      # Optional: custom messages for success/failure\n      # message:\n      #   success: \"Artillery test '{{ testName }}' completed successfully!\"\n      #   failure: \"Artillery test '{{ testName }}' *FAILED* with {{ errorCount }} errors.\"\nscenarios:\n  - name: \"Homepage Load\"\n    flow:\n      - get:\n          url: \"/\"\n          match: \"Homepage\"\n      - post:\n          url: \"/login\"\n          json:\n            username: \"testuser\"\n            password: \"password\"\n          capture:\n            json: \"$.token\"\n            as: \"authToken\"\n      - get:\n          url: \"/dashboard\"\n          headers:\n            Authorization: \"Bearer {{ authToken }}\"\n","lang":"yaml","description":"This Artillery YAML configuration demonstrates how to enable the `slack` plugin and provides a basic load test scenario. The Slack webhook URL is loaded from an environment variable for security, and two load phases are defined for a typical test workflow."},"warnings":[{"fix":"Ensure your Slack App is up-to-date with Slack's latest API requirements. Always use the latest stable version of `artillery-plugin-slack` and Artillery. Consult the Artillery and Slack documentation for migration guides related to API changes.","message":"The Slack API frequently deprecates older methods and requires migration to newer approaches (e.g., conversations API, changes to file uploads, discontinuing legacy custom bots). While the plugin itself aims to stay updated, older versions of the plugin or misconfigured Slack apps may cease to function without warning due to Slack API changes.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Check Artillery's main changelog and plugin release notes for specific fixes related to distributed testing status reporting. Ensure you are running a recent version of Artillery and `artillery-plugin-slack`. It has been noted that some fixes were introduced in Artillery CLI v2.0.24 and v2.0.12 concerning Slack plugin reporting.","message":"In certain distributed testing scenarios (e.g., `artillery run-fargate`), the Slack plugin might incorrectly report a 'failed' test run even if Artillery Cloud dashboard shows 'Succeeded'. This discrepancy can lead to false alarms in CI/CD pipelines.","severity":"gotcha","affected_versions":"<=1.19.0"},{"fix":"Double-check that the `webhookUrl` in your Artillery configuration is correct, active, and has the necessary permissions in your Slack workspace. It's recommended to store this URL in an environment variable (`${process.env.SLACK_WEBHOOK_URL}`) for security and easier management.","message":"An invalid or expired Slack `webhookUrl` will silently prevent notifications from being sent. Artillery will report that the plugin was configured, but no messages will appear in Slack.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Verify that `artillery-plugin-slack` is installed correctly, either globally (`npm install -g artillery-plugin-slack`) or as a local dev dependency (`npm install --save-dev artillery-plugin-slack`). Ensure the plugin name `slack` is correctly nested under `plugins:` in your YAML configuration.","message":"If the `artillery-plugin-slack` package is not correctly installed or if the plugin name is misspelled in the Artillery configuration, Artillery will fail to load the plugin without providing a clear 'plugin not found' error during the initial validation step, often leading to no Slack messages being sent.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"Upgrade to the latest versions of Artillery CLI and `artillery-plugin-slack`. This issue has received attention and fixes in recent Artillery releases. Verify the Artillery Cloud dashboard for the definitive test status.","cause":"Discrepancy in exit code handling or status reporting between Artillery CLI/Fargate execution and the Slack plugin's interpretation.","error":"Slack plugin reports \"Artillery test run failed\" message while Artillery Cloud dashboard shows \"Succeeded\" status"},{"fix":"Ensure `webhookUrl` is correctly configured in your Artillery YAML. Validate the webhook URL in Slack settings and confirm network connectivity from where Artillery is executed. Enable `DEBUG=plugin:slack` to check for specific errors during plugin execution.","cause":"Incorrect or expired Slack Webhook URL, missing `webhookUrl` configuration, or network issues preventing communication with Slack.","error":"No Slack notifications are received after an Artillery test run completes."},{"fix":"Install the plugin globally (`npm install -g artillery-plugin-slack`) if Artillery is installed globally, or as a local dev dependency (`npm install --save-dev artillery-plugin-slack`) if Artillery is installed locally within your project. Ensure the installation path is accessible.","cause":"The `artillery-plugin-slack` npm package is not installed or not discoverable in the current environment where Artillery is being run.","error":"Error: Cannot find module 'artillery-plugin-slack'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null}