{ "info": { "author": "Unic AG - Robert Erdin, Mathias Petermann, Nicolas Baer", "author_email": "cloud@unic.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Operating System :: MacOS", "Operating System :: POSIX", "Operating System :: Unix", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "periskop - Slack Bot Integration Tests\n======================================\n\nperiskop is an integration testing tool for slack bots. An increasing\ndiverse set of use-cases are implemented with chat bots e.g. ChatOps,\nService Desk, etc. With periskop we can implement and run integration\ntests using a simple yaml file.\n\nHere's a quick example of the power of periskop:\n\n::\n\n test_name: chatops_diskspace\n bot_name: mrrobot\n timeout: 60\n slack:\n channel: \"#periskop-test\"\n as_user: periskop-user\n text: \"!diskspace mymachine /var\"\n expect:\n regex: true\n attachments:\n text: |\n .*{u'failures': 0, u'skipped': 1, u'ok': 3, u'unreachable': 0, u'changed': 1}.*\n\nThis test ``chatops_diskspace`` executes the command\n``!diskspace mymachine /var`` in the channel ``#periskop-test`` as user\n``periskop-user`` and checks for the result in an attachment. The result\nis a string with regular expression matching.\n\nGetting Started\n---------------\n\nInstall periskop:\n\n::\n\n pip install periskop\n\nCheck for successfull installation.\n\n::\n\n periskop --help\n\nCreate a config file ``config.yml`` with the necessary information to\nrun tests:\n\n::\n\n slack_token: abcd-efgh-...-...\n as_user: myusername\n bot_name: mybotname\n channel: \"#periskop\"\n\nMake sure that the slack token is a valid API Tester token. We need this\nkind of token, because bots can't talk to other bots :).\n\nCreate your first test ``firsttest.yml``:\n\n::\n\n test_name: chatops_diskspace\n bot_name: mrrobot\n timeout: 60\n slack:\n text: \"!diskspace mymachine /var\"\n expect:\n regex: true\n attachments:\n text: |\n .*{u'failures': 0, u'skipped': 1, u'ok': 3, u'unreachable': 0, u'changed': 1}.*\n\nList all tests:\n\n::\n\n periskop list\n\nRun the test:\n\n::\n\n periskop run firsttest\n\nTest Implementation\n-------------------\n\nSlack Input\n~~~~~~~~~~~\n\nIn the examples above we specified the following simple slack command:\n\n::\n\n slack:\n text: \"!diskspace mymachine /var\"\n\nWe can not only specify text but use the full set of arguments defined\nhere: `Slack PostMessage\nAPI `__\n\nTest Condition\n~~~~~~~~~~~~~~\n\nWe can test either for a full text match or for regex. The test allows\nfor specification of the complete `message event\ntype `__. Instead of checking for\nthe attachment you may as well check for the text:\n\n::\n\n expect:\n regex: true\n text: |\n .*ok.*\n\nRegEx\n^^^^^\n\n::\n\n test_name: chatops_diskspace\n bot_name: mrrobot\n timeout: 60\n slack:\n channel: \"#periskop\"\n as_user: periskop-user\n text: \"!diskspace mymachine /var\"\n expect:\n regex: true\n attachments:\n text: |\n .*{u'failures': 0, u'skipped': 1, u'ok': 3, u'unreachable': 0, u'changed': 1}.*\n\nFull match\n^^^^^^^^^^\n\n::\n\n test_name: status command\n bot_name: mrrobot\n timeout: 300\n slack:\n channel: \"#periskop\"\n as_user: periskop-user\n text: \"!status mymachine\"\n expect:\n attachments:\n text: |\n ``` | SUCCESS => {\\n \"changed\": false, \\n \"ping\": \"pong\"\\n}```\n text: \"@mrrobot: Here is your status for `` host(s):\"`\n\nSetup Development Environment\n-----------------------------\n\n::\n\n git clone https://github.com/unic/periskop.git\n python setup.py develop\n\nPyPi\n~~~~\n\nIf you want to update the PyPi package, make sure you have a valid\n``~/.pypirc`` configuration:\n\n::\n\n [distutils]\n index-servers =\n pypi\n pypitest\n\n [pypi]\n repository=https://pypi.python.org/pypi\n username=your_username\n password=your_password\n\n [pypitest]\n repository=https://testpypi.python.org/pypi\n username=your_username\n password=your_password\n\nThen execute\n\n::\n\n pip install pypandoc\n brew install pandoc\n python setup.py register -r pypi", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/unic/periskop", "keywords": null, "license": "Apache License 2.0", "maintainer": null, "maintainer_email": null, "name": "periskop", "package_url": "https://pypi.org/project/periskop/", "platform": "any", "project_url": "https://pypi.org/project/periskop/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/unic/periskop" }, "release_url": "https://pypi.org/project/periskop/1.0.0/", "requires_dist": null, "requires_python": null, "summary": "Integration testing for ChatOps via Slack", "version": "1.0.0" }, "last_serial": 2609672, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "49cefc8499a9face8cf18e692dae18bd", "sha256": "ddcbc837018869758aee5a5875faf127d129668132c1611359929925a086f1b3" }, "downloads": -1, "filename": "periskop-1.0.0.tar.gz", "has_sig": false, "md5_digest": "49cefc8499a9face8cf18e692dae18bd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6282, "upload_time": "2017-01-31T16:58:50", "url": "https://files.pythonhosted.org/packages/96/98/c2a8dcf0805ab1835fbecfaed3caedb7c6076339f56e0558c1e67e33ace6/periskop-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "49cefc8499a9face8cf18e692dae18bd", "sha256": "ddcbc837018869758aee5a5875faf127d129668132c1611359929925a086f1b3" }, "downloads": -1, "filename": "periskop-1.0.0.tar.gz", "has_sig": false, "md5_digest": "49cefc8499a9face8cf18e692dae18bd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6282, "upload_time": "2017-01-31T16:58:50", "url": "https://files.pythonhosted.org/packages/96/98/c2a8dcf0805ab1835fbecfaed3caedb7c6076339f56e0558c1e67e33ace6/periskop-1.0.0.tar.gz" } ] }