dbbot-sql


Namedbbot-sql JSON
Version 0.3 PyPI version JSON
download
home_pagehttps://github.com/pbylicki/DbBot-SQLAlchemy
SummaryA tool for inserting Robot Framework test run results into SQL database using SQLAlchemy.
upload_time2023-04-27 18:40:18
maintainer
docs_urlNone
authorRobot Framework Developers, Pawel Bylicki
requires_python
licenseApache License 2.0
keywords robotframework testing testautomation atdd
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage No coveralls.
            DbBot-SQLAlchemy
================

.. image:: https://travis-ci.org/pbylicki/DbBot-SQLAlchemy.svg?branch=master
    :target: https://travis-ci.org/pbylicki/DbBot-SQLAlchemy

DbBot is a Python script to serialize `Robot Framework`_  output files into
a SQLite database. This way the future `Robot Framework`_ related tools and
plugins will have a unified storage for the test run results.

DbBot-SQLAlchemy is a fork of DbBot project that is using SQLAlchemy in order
to store test run results in any of the major supported database systems.

The goal is to support the following databases:

-  PostgreSQL
-  MySQL
-  Oracle
-  MS SQL
-  SQLite

Requirements
------------
DbBot-SQLAlchemy is tested on

-  `Python`__ 3.5+
-  `Robot Framework`_ 3.0+
-  `SQLAlchemy`_ 1.2+

It may (though it is not guaranteed) work with older versions of dependencies.

How it works
------------

The script takes one or more `output.xml` files as input, initializes the
database schema, and stores the respective results into a SQLite database
(`robot\_results.db` by default, can be changed by specifying SQLAlchemy
database URL with options `-b` or `--database`).
If database schema is already existing, it will insert the new
results into that database.

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

This tool is installed with pip with command:

::

    $ pip install dbbot-sqlalchemy

Alternatively you can download the `source distribution`__, extract it and
install using:

::

    $ python setup.py install

What is stored
--------------

Both the test data (names, content) and test statistics (how many did pass or
fail, possible errors occurred, how long it took to run, etc.) related to
suites and test cases are stored by default. However, keywords and related
data are not stored as it might take order of magnitude longer for massive
test runs. You can choose to store keywords and related data by using `-k` or
`--also-keywords` flag.

Usage examples
--------------

Typical usage with a single output.xml file:

::

    python -m dbbot.run atests/testdata/one_suite/test_output.xml

If the database does not already exist, it's created. Otherwise the test
results are just inserted into the existing database. Only new results are
inserted.

The default database is SQLite database named `robot_results.db`.

Additional options are:

+-------------------+---------------------------+--------------------------+
| Short format      | Long format               | Description              |
+===================+===========================+==========================+
| `-k`              | `--also-keywords`         | Parse also suites' and   |
|                   |                           | tests' keywords          |
+-------------------+---------------------------+--------------------------+
| `-v`              | `--verbose`               | Print output to the      |
|                   |                           | console.                 |
+-------------------+---------------------------+--------------------------+
| `-b DB_URL`       | `--database=DB_URL`       | SQLAlchemy database URL  |
|                   |                           | for test run results     |
+-------------------+---------------------------+--------------------------+
| `-d`              | `--dry-run`               | Do everything except     |
|                   |                           | store the results.       |
+-------------------+---------------------------+--------------------------+


Specifying custom database name:

::

    $ python -m dbbot.run  -b sqlite:///my_own_database.db atests/testdata/one_suite/test_output.xml
    $ python -m dbbot.run  -b postgresql://postgres:postgres@localhost:5432/postgres atests/testdata/one_suite/test_output.xml

Parsing test run results with keywords and related data included:

::

    python -m dbbot.run -k atests/testdata/one_suite/test_output.xml

Giving multiple test run result files at the same time:

::

    python -m dbbot.run atests/testdata/one_suite/test_output.xml atests/testdata/one_suite/output_latter.xml

Database
--------

You can inspect the created database using the `sqlite3`_ command-line tool:

.. code:: sqlite3

    $ sqlite3 robot_results.db

    sqlite> .tables
    arguments        suite_status     test_run_errors  tests
    keyword_status   suites           test_run_status
    keywords         tag_status       test_runs
    messages         tags             test_status

    sqlite> SELECT count(), tests.id, tests.name
            FROM tests, test_status
            WHERE tests.id == test_status.test_id AND
            test_status.status == "FAIL"
            GROUP BY tests.name;

Please note that when database is initialized, no indices are created by
DbBot. This is to avoid slowing down the inserts. You might want to add
indices to the database by hand to speed up certain queries in your own
scripts.

For information about the database schema, see `doc/robot_database.md`__.

Use case example: Most failing tests
------------------------------------

One of the common use cases for DbBot is to get a report of the most commonly
failing suites, tests and keywords. There's an example for this purpose in
`examples/FailBot/bin/failbot`.

Failbot is a Python script used to produce a summary web page of the failing
suites, tests and keywords, using the information stored in the DbBot
database. Please adjust (the barebone) HTML templates in
`examples/FailBot/templates` to your needs.

Writing your own scripts
------------------------

Please take a look at the modules in `examples/FailBot/failbot` as an example
on how to build on top of the classes provided by DbBot to satisfy your own
scripting needs.

License
-------

DbBot is released under the `Apache License, Version 2.0`__.

See LICENSE.TXT for details.

__ https://www.python.org/
__ https://pypi.python.org/pypi/dbbot-sqlalchemy
__ https://github.com/pbylicki/DbBot-SQLAlchemy/blob/master/doc/robot_database.md
__ http://www.tldrlegal.com/license/apache-license-2.0
.. _`Robot Framework`: http://www.robotframework.org
.. _`pip`: http://www.pip-installer.org
.. _`sqlite3`: https://www.sqlite.org/sqlite.html
.. _`SQLAlchemy`: http://www.sqlalchemy.org

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/pbylicki/DbBot-SQLAlchemy",
    "name": "dbbot-sql",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "robotframework testing testautomation atdd",
    "author": "Robot Framework Developers, Pawel Bylicki",
    "author_email": "robotframework@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/26/59/ff12d2e75802fb0dffdbf56391dfe3a800353fead5711d922fd6aa390e64/dbbot-sql-0.3.tar.gz",
    "platform": "any",
    "description": "DbBot-SQLAlchemy\n================\n\n.. image:: https://travis-ci.org/pbylicki/DbBot-SQLAlchemy.svg?branch=master\n    :target: https://travis-ci.org/pbylicki/DbBot-SQLAlchemy\n\nDbBot is a Python script to serialize `Robot Framework`_  output files into\na SQLite database. This way the future `Robot Framework`_ related tools and\nplugins will have a unified storage for the test run results.\n\nDbBot-SQLAlchemy is a fork of DbBot project that is using SQLAlchemy in order\nto store test run results in any of the major supported database systems.\n\nThe goal is to support the following databases:\n\n-  PostgreSQL\n-  MySQL\n-  Oracle\n-  MS SQL\n-  SQLite\n\nRequirements\n------------\nDbBot-SQLAlchemy is tested on\n\n-  `Python`__ 3.5+\n-  `Robot Framework`_ 3.0+\n-  `SQLAlchemy`_ 1.2+\n\nIt may (though it is not guaranteed) work with older versions of dependencies.\n\nHow it works\n------------\n\nThe script takes one or more `output.xml` files as input, initializes the\ndatabase schema, and stores the respective results into a SQLite database\n(`robot\\_results.db` by default, can be changed by specifying SQLAlchemy\ndatabase URL with options `-b` or `--database`).\nIf database schema is already existing, it will insert the new\nresults into that database.\n\nInstallation\n------------\n\nThis tool is installed with pip with command:\n\n::\n\n    $ pip install dbbot-sqlalchemy\n\nAlternatively you can download the `source distribution`__, extract it and\ninstall using:\n\n::\n\n    $ python setup.py install\n\nWhat is stored\n--------------\n\nBoth the test data (names, content) and test statistics (how many did pass or\nfail, possible errors occurred, how long it took to run, etc.) related to\nsuites and test cases are stored by default. However, keywords and related\ndata are not stored as it might take order of magnitude longer for massive\ntest runs. You can choose to store keywords and related data by using `-k` or\n`--also-keywords` flag.\n\nUsage examples\n--------------\n\nTypical usage with a single output.xml file:\n\n::\n\n    python -m dbbot.run atests/testdata/one_suite/test_output.xml\n\nIf the database does not already exist, it's created. Otherwise the test\nresults are just inserted into the existing database. Only new results are\ninserted.\n\nThe default database is SQLite database named `robot_results.db`.\n\nAdditional options are:\n\n+-------------------+---------------------------+--------------------------+\n| Short format      | Long format               | Description              |\n+===================+===========================+==========================+\n| `-k`              | `--also-keywords`         | Parse also suites' and   |\n|                   |                           | tests' keywords          |\n+-------------------+---------------------------+--------------------------+\n| `-v`              | `--verbose`               | Print output to the      |\n|                   |                           | console.                 |\n+-------------------+---------------------------+--------------------------+\n| `-b DB_URL`       | `--database=DB_URL`       | SQLAlchemy database URL  |\n|                   |                           | for test run results     |\n+-------------------+---------------------------+--------------------------+\n| `-d`              | `--dry-run`               | Do everything except     |\n|                   |                           | store the results.       |\n+-------------------+---------------------------+--------------------------+\n\n\nSpecifying custom database name:\n\n::\n\n    $ python -m dbbot.run  -b sqlite:///my_own_database.db atests/testdata/one_suite/test_output.xml\n    $ python -m dbbot.run  -b postgresql://postgres:postgres@localhost:5432/postgres atests/testdata/one_suite/test_output.xml\n\nParsing test run results with keywords and related data included:\n\n::\n\n    python -m dbbot.run -k atests/testdata/one_suite/test_output.xml\n\nGiving multiple test run result files at the same time:\n\n::\n\n    python -m dbbot.run atests/testdata/one_suite/test_output.xml atests/testdata/one_suite/output_latter.xml\n\nDatabase\n--------\n\nYou can inspect the created database using the `sqlite3`_ command-line tool:\n\n.. code:: sqlite3\n\n    $ sqlite3 robot_results.db\n\n    sqlite> .tables\n    arguments        suite_status     test_run_errors  tests\n    keyword_status   suites           test_run_status\n    keywords         tag_status       test_runs\n    messages         tags             test_status\n\n    sqlite> SELECT count(), tests.id, tests.name\n            FROM tests, test_status\n            WHERE tests.id == test_status.test_id AND\n            test_status.status == \"FAIL\"\n            GROUP BY tests.name;\n\nPlease note that when database is initialized, no indices are created by\nDbBot. This is to avoid slowing down the inserts. You might want to add\nindices to the database by hand to speed up certain queries in your own\nscripts.\n\nFor information about the database schema, see `doc/robot_database.md`__.\n\nUse case example: Most failing tests\n------------------------------------\n\nOne of the common use cases for DbBot is to get a report of the most commonly\nfailing suites, tests and keywords. There's an example for this purpose in\n`examples/FailBot/bin/failbot`.\n\nFailbot is a Python script used to produce a summary web page of the failing\nsuites, tests and keywords, using the information stored in the DbBot\ndatabase. Please adjust (the barebone) HTML templates in\n`examples/FailBot/templates` to your needs.\n\nWriting your own scripts\n------------------------\n\nPlease take a look at the modules in `examples/FailBot/failbot` as an example\non how to build on top of the classes provided by DbBot to satisfy your own\nscripting needs.\n\nLicense\n-------\n\nDbBot is released under the `Apache License, Version 2.0`__.\n\nSee LICENSE.TXT for details.\n\n__ https://www.python.org/\n__ https://pypi.python.org/pypi/dbbot-sqlalchemy\n__ https://github.com/pbylicki/DbBot-SQLAlchemy/blob/master/doc/robot_database.md\n__ http://www.tldrlegal.com/license/apache-license-2.0\n.. _`Robot Framework`: http://www.robotframework.org\n.. _`pip`: http://www.pip-installer.org\n.. _`sqlite3`: https://www.sqlite.org/sqlite.html\n.. _`SQLAlchemy`: http://www.sqlalchemy.org\n",
    "bugtrack_url": null,
    "license": "Apache License 2.0",
    "summary": "A tool for inserting Robot Framework test run results into SQL database using SQLAlchemy.",
    "version": "0.3",
    "split_keywords": [
        "robotframework",
        "testing",
        "testautomation",
        "atdd"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "11fb385c612a98edb7b5a7e0610ade770af5ad68766ca4303e9107bf42872f8d",
                "md5": "75983087b1993aaf09474ce5409ac706",
                "sha256": "72baad3a956505a7a502858676a16c4591f67941c1b083ee558a83da9c156c39"
            },
            "downloads": -1,
            "filename": "dbbot_sql-0.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "75983087b1993aaf09474ce5409ac706",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 16629,
            "upload_time": "2023-04-27T18:40:15",
            "upload_time_iso_8601": "2023-04-27T18:40:15.385426Z",
            "url": "https://files.pythonhosted.org/packages/11/fb/385c612a98edb7b5a7e0610ade770af5ad68766ca4303e9107bf42872f8d/dbbot_sql-0.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2659ff12d2e75802fb0dffdbf56391dfe3a800353fead5711d922fd6aa390e64",
                "md5": "4b54d81d0b18bb79ab1ffc7ff33c9f6f",
                "sha256": "fbf88e756c041a41d676042af3f3568605fa2c03fe1ecca92871e64a837da5b3"
            },
            "downloads": -1,
            "filename": "dbbot-sql-0.3.tar.gz",
            "has_sig": false,
            "md5_digest": "4b54d81d0b18bb79ab1ffc7ff33c9f6f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 14761,
            "upload_time": "2023-04-27T18:40:18",
            "upload_time_iso_8601": "2023-04-27T18:40:18.701216Z",
            "url": "https://files.pythonhosted.org/packages/26/59/ff12d2e75802fb0dffdbf56391dfe3a800353fead5711d922fd6aa390e64/dbbot-sql-0.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-04-27 18:40:18",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "pbylicki",
    "github_project": "DbBot-SQLAlchemy",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "dbbot-sql"
}
        
Elapsed time: 0.06199s