PYTHON-NITRATE(1)

πŸ“¦ version 1.9.0, in epel 10, epel 9, fedora 43, fedora 44

✨ python-nitrate ✨

okay bestie, welcome to the python-nitrate manual page β€” this is the User Commands zone and it's lowkey iconic. let's get into it πŸ’…


πŸ’– NAME πŸ’–

python-nitrate β€” the Python API for the Nitrate test case management system. that's the whole vibe πŸ¦‹


🌸 DESCRIPTION 🌸

python-nitrate is a Python interface to the Nitrate test case management system. the package is giving three whole things, no cap:

  • a high-level Python module β€” it provides a natural object interface, so it just feels right
  • a low-level driver β€” this one lets you directly access Nitrate's xmlrpc API, raw and unfiltered
  • a command line interpreter β€” perfect for fast debugging and experimenting, like a lil playground

✨ FEATURES ✨

among the most essential python-nitrate features (the main character moments, fr fr):

  • Natural and concise Python interface
  • Custom level of caching & logging
  • Automated status coloring
  • Integrated test suite
  • Utility functions

the main motivation behind all of this was to hide unnecessary implementation details wherever possible, so that using the API is as concise as possible. periodt. πŸ’…

scripts that import python-nitrate can make use of several useful helper functions, including:

  • info() for logging to stderr
  • listed() which converts list into nice human readable form
  • color() for coloring
  • and of course log.{debug,info,warn,error} for logging

πŸŽ€ EXAMPLES πŸŽ€

initialize or create an object:

testcase = TestCase(1234)
testrun = TestRun(testplan=<plan>, summary=<summary>)

default iterators provided for all container objects:

for case in TestRun(1234):
    if case.automated:
        case.status = Status("RUNNING")
        case.update()

linking a case to a plan is as simple as adding an item to a set (the way that it just works 😭):

testplan.testcases.add(testcase)
testplan.update()

however, it's still possible to use the low-level driver when a specific feature is not implemented yet or not efficient enough:

inject = Nitrate()._server.TestCase.get(46490)

for a quick start you can get some inspiration in the examples directory 🫢

  • the 'matrix.py' script demonstrates how to easily display a matrix view of the test run results for a specific test plan
  • the 'create.py' script gives a broader overview covering object creation, attribute setting, adjusting logs and caching

🧚 INSTALLATION 🧚

install directly from Fedora/Copr repository using yum or dnf:

yum install python-nitrate

or use PIP (sudo required if not in a virtualenv):

pip install nitrate
note that for successfull pip installation several extra dependencies are necessary:
yum install gcc python-devel krb5-devel postgresql-devel

here's the list of required packages for Debian systems:

apt install gcc python-dev libkrb5-dev libpq-dev

πŸ¦‹ CONFIGURATION πŸ¦‹

to be able to contact the Nitrate server, a minimal user config file ~/.nitrate has to be provided in the user home directory:

[nitrate]
url = https://nitrate.server/xmlrpc/

🌈 TEST SUITE 🌈

the high-level interface has an integrated test suite, which can be easily run against a stage server instance. for this, a couple of objects needs to be prepared and already existing on the server so that we can check valid results. for detailed information about what data has to be prepared, see the module documentation πŸ‘‘



πŸ‘‘ SEE ALSO πŸ‘‘

manual pages covering command line interpreter and release notes:

nitrate
nitrate-notes

for more detailed and most up-to-date description of all available nitrate module features, see the Python online documentation:

pydoc nitrate

for area-specific details see respective module documentation:

nitrate.base ......... Nitrate class, search support
nitrate.cache ........ Persistent cache, multicall support
nitrate.config ....... Configuration, logging, coloring, caching
nitrate.containers ... Container classes implementation
nitrate.immutable .... Immutable Nitrate objects
nitrate.mutable ...... Mutable Nitrate objects
nitrate.teiid ........ Teiid support
nitrate.tests ........ Test suite
nitrate.utils ........ Utilities
nitrate.xmlrpc ....... XMLRPC driver

πŸ’œ AUTHORS πŸ’œ

high-level Python module squad: Petr Ε plΓ­chal, ZbyΕ‘ek MrΓ‘z, Martin Kyral, LukΓ‘Ε‘ Zachar, Filip Holec, AleΕ‘ Zelinka, Miroslav Vadkerti, LeoΕ‘ Pol, Iveta Wiedermann, Martin Frodl, Alexander Todorov, Robbie Harwood, Martin ZelenΓ½ and LumΓ­r Balhar.

low-level XMLRPC driver squad: Airald Hapairai, David Malcolm, Will Woods, Bill Peck, Chenxiong Qi, Tang Chaobin, Yuguang Wang and Xuqing Kuang.

hope, the library will save you time and bring some joy when writing scripts interacting with the Nitrate server. looking forward to your feedback, comments, suggestions and patches ;-) 🫢

Petr Ε plΓ­chal <psplicha@redhat.com>


Copyright (c) 2012 Red Hat, Inc. All rights reserved.

this library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.


and that's a wrap, bestie πŸŽ€ this whole page is from February 2012, source/version PYTHON-NITRATE(1) β€” literally iconic, still serving after all this time. mwah πŸ’‹ ✨

πŸ“¦ where this page comes from