Temporary performance degradation

We are currently experiencing service degradation and working on resolving this. Thank you for your patience and understanding.

K6 K8S

Luca Bello Publisher

Platform:

Channel Revision Published Runs on
dev/edge 1 31 Mar 2026
Ubuntu 24.04
juju deploy k6-k8s --channel dev/edge

charms.k6_k8s.v0.k6_test

Charm library to transfer k6 tests.

Charms that need to push load tests to a k6 charm, should use the K6TestProvider class. Charms that run those tests and need to receive them, should use the K6TestRequirer class.


class K6TestRequirer

Helper class for the 'receiving' side of k6 tests.

Description

The K6TestRequirer object can be instantiated as follows in your charm:

def __init__(self, *args):
    ...
    self.k6_tests = K6TestRequirer(self)
    ...

The K6TestRequirer assumes that, in your charm metadata, you declare a relation as follows:

requires:
    receive-k6-tests:  # Relation name
        interface: k6_tests  # Relation interface

Methods

K6TestRequirer. __init__( self , charm: CharmBase )

K6TestRequirer. tests( self )

Get the k6 tests from all relations.

Returns

A dictionary mapping the app name to the tests it provides.

K6TestRequirer. environment( self )

Get the k6 tests from all relations.

Returns

A dictionary mapping the app name to the tests it provides.

class K6TestProvider

Helper class for the 'sending' side of k6 tests.

Description

The K6TestProvider object can be instantiated as follows in your charm:

def __init__(self, *args):
    ...
    environment: Dict[str, str] = {"SOME_ENDPOINT": "http://10.1.2.3:1234"}
    self.k6_tests = K6TestProvider(
        self,
        tests_folder="tests/load",
        environment=environment,
    )
    self.k6_tests.reconcile()
    ...

The K6TestProvider assumes that, in your charm metadata, you declare a relation as follows:

requires:
    send-k6-tests:  # Relation name
        interface: k6_tests  # Relation interface

Methods

K6TestProvider. __init__( self , charm: CharmBase )

K6TestProvider. k6_tests( self )

Description

Read the k6 tests from the folder specified in the constructor. None

K6TestProvider. reconcile( self )

Description

Re-generate the world state for the charm library. None