Search…
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.

Installation

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. 1.
    Configure the kolena repository in Poetry:
    poetry config repositories.kolena https://gateway.kolena.cloud/repositories
    poetry config http-basic.kolena "$KOLENA_TOKEN" ""
  2. 2.
    Add the kolena source to your project by adding this block to your pyproject.toml:
    [[tool.poetry.source]]
    name = "kolena"
    url = "https://gateway.kolena.cloud/repositories"
    secondary = true
  3. 3.
    Install:
    poetry add kolena-client

Initialization

Before using the kolena-client to create or run tests, initialize a client session:
import os
import kolena
kolena.initialize(os.environ["KOLENA_TOKEN"])
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.
Copy link
On this page
Installation
Initialization