diff --git a/README.md b/README.md index 03bc64a..9d3bc00 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,36 @@ uv run pytest If all is well, you should see the test run in the Test Engine section of the Buildkite dashboard. +## 🏷️ Filtering Tests by Tags + +You can filter which tests to run based on execution tags using the `--tag-filters` option. + +First, mark your tests with execution tags: + +```python +import pytest + +@pytest.mark.execution_tag("color", "red") +def test_red_feature(): + assert True + +@pytest.mark.execution_tag("color", "blue") +def test_blue_feature(): + assert True +``` + +Then filter tests by tag using the `--tag-filters` option with `key:value` format: + +```sh +# Run only tests tagged with color:red +pytest --tag-filters "color:red" + +# Run only tests tagged with color:blue +pytest --tag-filters "color:blue" +``` + +**Note:** The `--tag-filters` option performs exact key:value matching. Only tests with the specified tag will be selected. + ## 🎢 Tracing Buildkite Test Engine has support for tracing potentially slow operations within your tests, and can collect span data of [four types](https://buildkite.com/docs/test-engine/importing-json#json-test-results-data-reference-span-objects): http, sql, sleep and annotations. This is documented as part of our public JSON API so anyone can instrument any code to send this data. diff --git a/pyproject.toml b/pyproject.toml index 0e4b4b1..c6076c3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "buildkite-test-collector" -version = "1.2.0" +version = "1.3.0" description = "Buildkite Test Engine collector" readme = "README.md" requires-python = ">=3.9" diff --git a/uv.lock b/uv.lock index a0c1b19..ba03aad 100644 --- a/uv.lock +++ b/uv.lock @@ -46,7 +46,7 @@ wheels = [ [[package]] name = "buildkite-test-collector" -version = "1.1.0" +version = "1.3.0" source = { editable = "." } dependencies = [ { name = "filelock" },