-
Notifications
You must be signed in to change notification settings - Fork 12
Add --tag-filters option to filter tests using execution_tag marker
#83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
nprizal
wants to merge
4
commits into
main
Choose a base branch
from
te-5135-add-custom-option-to-filter-tests-by-execution-tag-in-pytest
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add --tag-filters option to filter tests using execution_tag marker
#83
nprizal
wants to merge
4
commits into
main
from
te-5135-add-custom-option-to-filter-tests-by-execution-tag-in-pytest
+206
−1
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
af0becc to
07121b3
Compare
07121b3 to
bf552fa
Compare
nprizal
commented
Jan 22, 2026
| if plugin: | ||
| api = API(os.environ) | ||
| numprocesses = config.getoption("numprocesses") | ||
| numprocesses = config.getoption("numprocesses", None) |
Contributor
Author
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One of the tests I added failed in CI because numprocesses option doesn't exists in the subprocess environment. I added None as default to prevent error being raised when evaluation that option.
--tag-filters option to filter tests using execution_tag marker--tag-filters option to filter tests using execution_tag marker
gchan
added a commit
to buildkite/test-engine-client
that referenced
this pull request
Jan 23, 2026
Add a new --tag-filters CLI flag that allows filtering tests by execution tags. This is useful for selectively running subsets of tests. Currently only Pytest is supported via markers [1]. When specified, the tag filter is passed to pytest via the -m flag (e.g., pytest -m "test_execution"). We will replace the default marker filter with a custom filter option implemented in the Python test collector [2] Changes: - Add --tag-filters flag and BUILDKITE_TEST_ENGINE_TAG_FILTERS env var - Add TagFilters field to Config struct - Update Pytest runner to use -m flag when tag filters are specified. (This will be replaced with a custom filter) - Add test coverage for marker-based filtering for pytest Example usage: bktec run --tag-filters "slow" BUILDKITE_TEST_ENGINE_TAG_FILTERS="not integration" bktec run [1] https://docs.pytest.org/en/7.1.x/example/markers.html [2] buildkite/test-collector-python#83
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Test Engine Tags can be applied to a test using
@pytest.mark.execution_tag(“key”, “value”). However, pytest built-in-moption doesn’t support filtering tests using marker arguments. It can filter tests that have anyexecution_tagmarkers, but it can't filter tests that haveexecution_tagmarker with specifickeyandvalue.This PR adds new custom options
--tag-filtersto filter tests based onexecution_tag'skey&value.Then to filter tests with execution tag