Skip to main content

Dump testcases results to xunit file; submit files to Polarion Importers

Project description

build status coverage report

Capabilities of the dump2polarion library

  • generating XML files for XUnit, Testcase and Requirements Importers

  • submitting XML files to Importers

  • verifying that the import was successfull

  • saving the import log files

  • reading Test Cases data from SVN repository with checked out Polarion project

The library supports all features of the Importers (even iterations). The export to XML files can be customized per project - lookup method, what results will be included in the XUnit (e.g. only PASSed tests), etc.

Both Python 2 and 3 are supported.

The library doesn’t use the legacy webservices API, all the operations are performed using Polarion Importers.

polarion_dumper.py script

Script for importing tests results recorded in the CSV, SQLite, junit-report.xml (generated by pytest) or Ostriz JSON input file to Polarion using the XUnit Importer.

Can be also used for submit of pre-generated XUnit, Test Case or Requirement XML files to corresponding Polarion Importer.

By default the script waits until the Importer finishes the import job and then checks the success of the operation.

Usage

polarion_dumper.py -i {input_file}

By default the input data are submitted to Polarion. You can disable this bahavior with -n option. In this case the XML file used for submission will be saved to disk. Default file location is the current directory (can be overriden with -o option).

When output file is specified with -o PATH, the XML file used for results submission will be saved to disk. If PATH is a directory, resulting file name will be generated - PATH/FILE_TYPE-TESTRUN_ID-TIMESTAMP.xml.

When the input file is a XML file in a format supported by one of the Polarion Importers (e.g. saved earlier with -o FILE -n), it is submitted to Polarion.

Configuration

You need to set the following environment variables (the same are used for pylarion):

export POLARION_USERNAME=kerberos_username
export POLARION_PASSWORD=kerberos_password

Or you can specify credentials on command line with --user kerberos_username --password kerberos_password. Or you can specify credentials in dump2polarion.yaml file.

The default user config file is ~/.config/dump2polarion.yaml. You can also specify the config file on command line with -c config_file.yaml.

Install

To install the package to your virtualenv, run

pip install dump2polarion

or install it from cloned directory

pip install -e .

Package on PyPI <https://pypi-hypernode.com/pypi/dump2polarion>

Requirements

Requirements are listed in requirements.txt.

CSV format for XUnit

There needs to be a row with field names - it is present by default when exported from Polarion.

Fields are ID; Title; Test Case ID (optional but recommended); Verdict; Comment (optional); Time (optional); stdout (optional); stderr (optional) + any other field you want. Order of the fields and case doesn’t matter.

The “Verdict” field and any optional fields must be added manually. Valid values for “verdict” are “passed”, “failed”, “skipped”, “waiting” or empty. It’s case insensitive.

There can be any content before the row with field names and the test results.

SQLite format for XUnit

You can convert the CSV file exported out of Polarion using the csv2sqlite.py script:

csv2sqlite.py -i {input_file.csv} -o {output_file.sqlite3}

How to submit the XML file manually

polarion_dumper.py -i input.xml --user {user} --password {password}

or

curl -k -u {user}:{password} -X POST -F file=@./output.xml {importer_url}

More info

For CFME QE specific instructions see <https://mojo.redhat.com/docs/DOC-1098563>

For info about XUnit Importer see <https://mojo.redhat.com/docs/DOC-1073077>

For info about Test Case Importer see <https://mojo.redhat.com/docs/DOC-1075945>

For info about Requirements Importer see <https://mojo.redhat.com/docs/DOC-1163149>

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dump2polarion-0.25.tar.gz (60.1 kB view details)

Uploaded Source

Built Distribution

dump2polarion-0.25-py2.py3-none-any.whl (35.3 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file dump2polarion-0.25.tar.gz.

File metadata

  • Download URL: dump2polarion-0.25.tar.gz
  • Upload date:
  • Size: 60.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.3

File hashes

Hashes for dump2polarion-0.25.tar.gz
Algorithm Hash digest
SHA256 ba44aa0d0cc9f977c696f33667cb0c076b36dca66db667a216a224ffe4622f93
MD5 d6bc87be699795d2268638e8c716fb66
BLAKE2b-256 674d8e858e914459f8b9ef7c67f3e3ffa29788c0ca5d9657f8b3820696f55120

See more details on using hashes here.

File details

Details for the file dump2polarion-0.25-py2.py3-none-any.whl.

File metadata

  • Download URL: dump2polarion-0.25-py2.py3-none-any.whl
  • Upload date:
  • Size: 35.3 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.3

File hashes

Hashes for dump2polarion-0.25-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 0203409bb35d983aba7022afe10be3f32553fc7e0935494dc1d4ecf59f66b192
MD5 acd3548789834f06ad42c439e4eccedc
BLAKE2b-256 c8c051f6dad3d2527c2d0a58f3618cce48fa434c8e23238017bca5679a26cb46

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page