Skip to content

Releases: grafana/xk6-python

v0.1.2

16 Dec 17:45

Choose a tag to compare

xk6-python v0.1.2 is here 🎉!

This is a minor maintenance release with dependency updates and security improvements.

Improvements

  • Fixed dependency issues
  • Added Python to dev container setup
  • Security: Updated module golang.org/x/crypto to v0.45.0
  • Updated dependency typing_extensions to v4.15.0
  • Updated dependency sphinx-autodoc-typehints to v2.5.0
  • Updated dependency myst-parser to v4.0.1
  • Updated go.starlark.net digest to be02852
  • Pinned dependencies for better stability

v0.1.1

25 Nov 06:59
e929900

Choose a tag to compare

xk6-python v0.1.1 is here 🎉!

This is a minor maintenance release.

Improvements

  • k6 updated to v1.4.2
  • Go updated to 1.24.0
  • golangci-lint updated to v2.1.6
  • Added dev container configuration
  • Migrated to shared extension workflows from grafana/xk6

v0.1.0

17 Sep 17:15

Choose a tag to compare

xk6-python v0.1.0 is here 🎉!

This is the initial release.

Status

xk6-python is currently in Proof of Concept status, but can already be used to run real k6 tests written in Python.

Check the documentation for available modules.

Usage

  1. Download the archive for your operating system and extract the k6 executable from it: Windows, Mac, Linux

  2. Create a k6 test script in python (script.py). The following example can be a good starting point:

    load("check", "check")
    load("requests", "get")
    load("time", "sleep")
    
    options = {
        "vus": 5,
        "duration": "5s",
        "thresholds": {
            "checks": ["rate>=0.99"],
        },
    }
    
    def default(_):
        resp = get("https://httpbin.test.k6.io/get")
    
        check(resp, {
            "is status 200": lambda r: r.status_code == 200,
        })
    
        sleep(0.5)
  3. Run the script with the k6 executable extracted from the release:

    ./k6 run script.py
  4. Read the documentation about the available APIs.


Happy   hacking!