Skip to content

Suggest using run_single_test.py when test is passed to run_project_tests.py --only#15625

Open
bonzini wants to merge 1 commit intomesonbuild:masterfrom
bonzini:project-tests-only-choices-revert
Open

Suggest using run_single_test.py when test is passed to run_project_tests.py --only#15625
bonzini wants to merge 1 commit intomesonbuild:masterfrom
bonzini:project-tests-only-choices-revert

Conversation

@bonzini
Copy link
Contributor

@bonzini bonzini commented Mar 16, 2026

This reverts commit 7f2dd41. Prior to commit 7f2dd41, it was possible to run a single test with

./run_project_tests.sh --only='common/1 trivial'

while it is not possible afterwards.

Suggest a replacement, and remove the category/name case from the help message.

@bonzini bonzini requested a review from jpakkane as a code owner March 16, 2026 07:48
@bonzini bonzini added this to the 1.11 milestone Mar 16, 2026
@bonzini
Copy link
Contributor Author

bonzini commented Mar 16, 2026

@dcbaker alternatively, the error could point to ./run_single_test.py?

@dcbaker
Copy link
Member

dcbaker commented Mar 17, 2026

I would very much prefer that it points to single tests. The number of times that I wrote "failing" and had to wait for it to do all of the sanity checking before it finally said "that isn't a category" is infuriating.

And, that honestly seems more like a bug that you could do --only=common/1 trivial

Detect the case where a single test is being requested, and direct
the user to run_single_test.py.  This used to work until commit
7f2dd41 ("run_project_tests: Add choices to the --only argument").

Example:

    $ ./run_project_tests.py --only='framework'
    ...
    run_project_tests.py: error: argument --only: invalid argument 'framework' for --only; must be one of ...

    $ ./run_project_tests.py --only='framework/7 gnome'
    ...
    run_project_tests.py: error: argument --only: invalid argument 'framework/7 gnome' for --only; must be one of ...

but then:

    $ ./run_project_tests.py --only='frameworks/7 gnome'
    ...
    run_project_tests.py: error: argument --only: use ./run_single_test.py 'test cases/frameworks/7 gnome' to run a single test

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
@bonzini bonzini force-pushed the project-tests-only-choices-revert branch from f0ad0bd to 2fd847d Compare March 17, 2026 09:22
@bonzini bonzini changed the title Revert "run_project_tests: Add choices to the --only argument" Suggest using run_single_test.py when test is passed to run_project_tests.py --only Mar 17, 2026
@bonzini
Copy link
Contributor Author

bonzini commented Mar 17, 2026

And, that honestly seems more like a bug that you could do --only=common/1 trivial

Well, it was in the help message hence my first instinct to revert. But yes, it's possible to print a better message via ArgumentTypeError so let's do it instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants