Skip to content

Add category filtering to test selection - #67

Closed
lezama wants to merge 2 commits into
trunkfrom
feat/category-filter
Closed

lezama wants to merge 2 commits into
trunkfrom
feat/category-filter

Conversation

@lezama

@lezama lezama commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

What

Rebase of #65 by sadiksha-23 onto trunk, plus one fix. Her commit is kept as is. Supersedes #65.

  • --category hooks,rest-api (repeatable or comma-separated) and run.categories in the config filter execution tests by category before the seeded, stratified limit selection. Explicit test_ids still win.
  • Dry-run output and result metadata list the categories that were applied.
  • New in this PR: an unknown category is always an error, even next to a valid one. Before, --category hooks,typo ran the hooks tests and said nothing about typo.

Why

Running one category is the normal way to iterate on a group of tests. The rebase was needed because #63 removed difficulty, which #65 still referenced in a test helper and a docstring.

Verification

  • ruff check python, mypy python, pytest python (243 passed)
  • Added a test for the mixed valid/unknown category case.

Score impact

None. Selection only, no scoring or dataset changes.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Y9YN1SAySnURv9mptSdetG

Sadiksha Lamsal and others added 2 commits September 7, 2026 14:30
`--category hooks,typo` used to run the hooks tests and say nothing about
`typo`. Selection now checks every requested category against the loaded
tests and raises naming the unknown ones, so the special-cased zero-tests
message in core.py is no longer reachable and goes away.

Result metadata records the categories that were applied: an empty list
when explicit test_ids won, instead of a filter that had no effect.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y9YN1SAySnURv9mptSdetG
@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Unlinked Accounts

The following contributors have not linked their GitHub and WordPress.org accounts: @Isadiksha0@gmail.com.

Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Unlinked contributors: Isadiksha0@gmail.com.

Co-authored-by: lezama <migueluy@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@lezama

lezama commented Oct 22, 2026

Copy link
Copy Markdown
Contributor Author

closing in favor of #65, same change :)

@lezama lezama closed this Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant