Using kolena-client
Testing on Kolena is conducted using the
kolena-client
Python package. You use the client to create and run tests from your infrastructure that can be explored in our web platform.The first step to start testing with Kolena is to install
kolena-client
. From the developer page (</>
) on Kolena, generate an API token and set the KOLENA_TOKEN
environment variable:export KOLENA_TOKEN="********"
Client builds can be installed with any Python package manager such as
pip
and poetry
:pip
poetry
pip3 install --extra-index-url "https://$KOLENA_TOKEN@gateway.kolena.cloud/repositories" kolena-client
- 1.Configure the
kolena
repository in Poetry:poetry config repositories.kolena https://gateway.kolena.cloud/repositoriespoetry config http-basic.kolena "$KOLENA_TOKEN" "" - 2.Add the
kolena
source to your project by adding this block to yourpyproject.toml
:[[tool.poetry.source]]name = "kolena"url = "https://gateway.kolena.cloud/repositories"secondary = true - 3.Install:poetry add kolena-client
Poetry overhauled its credential handling in 1.2 to fix various issues with private repositories. Consider updating your Poetry installation to the latest stable release.
Before using the
kolena-client
to create or run tests, initialize a client session:import os
import kolena
kolena.initialize(os.environ["KOLENA_TOKEN"], verbose=True)
By default, sessions have static scope and persist until the interpreter is exited.
Additional logging can be configured by specifying
initialize(..., verbose=True)
. All logging events are emitted as Python standard library logging
events from the "kolena"
logger as well as to stdout/stderr directly.kolena-client
is compatible with all active Python versions.Python Version | Compatible Client Versions |
---|---|
3.10 | All Versions |
3.9 | All Versions |
3.8 | All Versions |
3.7 | All Versions |
≥0.22, ≤0.46 |
Last modified 3mo ago