Skip to main content

No project description provided

Project description

What is that?

This is a pytest plugin for reporting tests results to Xray Server . Xray comes in two flavours Xray Server and Xray Cloud which are significantly different. They have incompatible APIs.

This plugin works with Xray Server. If you want to work with Xray Cloud, use pytest-typhoon-xray

If you are interested in improving the plugin, read [API documentation for Xray Server] (https://docs.getxray.app/display/XRAY/REST+API)

Plugin installation

To install this library for use please enter the following command:

$ pip install pytest_xray_server

To use this plugin

To start using the plugin, add it to the list pytest_plugins in conftest.py.

pytest_plugins = ["pytest_xray_server"]

And configure URL to your xray instance in pytest.ini:

[pytest]
xray_base_url = https://xray.example.com/rest/

In test cases use markers to associate a test function with a test key and test execution id:

import pytest

@pytest.mark.xray(test_key="PRDS-12345", test_exec_key="PRDS-12121")
def test_my_function():
    assert True == True

Enable the plugin by passing the extra options to the command line when invoking the pytest runner:

$ pytest . --jira-xray

It is important that the environment variables XRAY_API_CLIENT_ID and XRAY_API_CLIENT_SECRET are set for pytest_xray_server to successfully post results to the Xray API.

export XRAY_API_CLIENT_ID=user.name
export XRAY_API_CLIENT_SECRET=password

Maintenance notes

Please make sure that any new releases of the library use an incremented version number from the last. The following guidance is used to properly version bump this library {major}.{minor}.{patch}.

Major versions are increased for any new overall library features or general API breaking changes.

Minor versions are increased for any new features added or implementation changes to existing APIs.

Patch versions are increased for any bug fixes and non-breaking changes.

To automatically bump versions, best to install bump2version, then enter either of the following on the command line:

$ bump2version major

or

$ bump2version minor

or

$ bump2version patch

These commands automatically commits and tags a new version. Make sure to push tags to the server with

$ git push && git push --tags

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

pytest_xray_server-1.0.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pytest_xray_server-1.0-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file pytest_xray_server-1.0.tar.gz.

File metadata

  • Download URL: pytest_xray_server-1.0.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.22.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6

File hashes

Hashes for pytest_xray_server-1.0.tar.gz
Algorithm Hash digest
SHA256 261a5c1ee64e12b3df7bcdbc18b95794ca6c1a72dd935a2f741ba591a2c91e3e
MD5 47f3ef84c1ad153ce85bce12f1fe7d3a
BLAKE2b-256 552726ebbe87a1c017289b8af3d3838c9e77f7ea1368a8b6eb6afe2b780224ea

See more details on using hashes here.

File details

Details for the file pytest_xray_server-1.0-py3-none-any.whl.

File metadata

  • Download URL: pytest_xray_server-1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.22.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6

File hashes

Hashes for pytest_xray_server-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 03856b4d10808802cebd4b101a46ff88c1bb07ecc42e69e84c0dfa4cea36ef77
MD5 f0851c30e1449666d5b0332028f1de5e
BLAKE2b-256 21c0e58bcdaa409af66777c946aa11dec285a57116da48d113464238a16aa8da

See more details on using hashes here.

Supported by

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