Skip to content
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

Ctest Label Filter No Longer Available (1.14.29) #3146

Closed
sjg10 opened this issue Apr 27, 2023 · 4 comments
Closed

Ctest Label Filter No Longer Available (1.14.29) #3146

sjg10 opened this issue Apr 27, 2023 · 4 comments
Assignees
Labels
bug a bug in the product Feature: ctest
Projects
Milestone

Comments

@sjg10
Copy link

sjg10 commented Apr 27, 2023

Brief Issue Summary

Before the Test Explorer #3032 I would set my ctestArgs as follows:

    "cmake.ctestArgs": [
        "-L",
        "UnitTest"
    ]

This would ensure that only my tests labelled as UnitTest would be executed by "Run Ctest".

The TestExplorer runs all tests and does not seem to have a setting for filtering by label. Instead the arguments are passed to each test, so for a test we expect to filter TestExplorer attempts the following:

[proc] Executing command: /usr/bin/ctest -j10 -C Debug -T test --output-on-failure -L UnitTest -R ^ExampleIntegrationTest$
[ctest] Cannot find file: /home/.../build/DartConfiguration.tcl
[ctest]    Site: 
[ctest]    Build name: (empty)
[ctest] Test project /home/.../build
[ctest] Cannot find file: /home/.../build/DartConfiguration.tcl
[ctest] No tests were found!!!
[ctest] CTest finished with return code 0

This test is filtered but then appears as a failure in TestExplorer. Ideally there should be a way to configure TestExplorer to respect filter labels, or it should at least not mark this test as having failed.

CMake Tools Diagnostics

No response

Debug Log

No response

Additional Information

No response

@gcampbell-msft gcampbell-msft added bug a bug in the product Feature: ctest labels Apr 27, 2023
@gcampbell-msft gcampbell-msft added this to Triage in 1.15 via automation Apr 27, 2023
@gcampbell-msft gcampbell-msft added this to the 1.15 milestone Apr 27, 2023
@gcampbell-msft
Copy link
Collaborator

@sjg10 Thanks for letting us know! We will mark them for our next release and get them on our backlog!

@Sturla22
Copy link

I have a similar problem with the test explorer ignoring filters in CMakePresets.json
This means I cannot use my process of using the CMake: Run Tests command to run the tests I'm currently working on. I also tried adding my filter to the filter window in test explorer, but CMake: Run Tests ignores it and runs all tests.

@khlebnikov
Copy link
Contributor

I have a very similar problem, but perhaps a bit more involved. My label filter is set in settings.json to:

    "cmake.ctestArgs": [
        "-L",
        "^${command:cmake.buildTargetName}$"
    ],

This way, I can select a particular test target to build (plus we have meta-targets that contain certain subsets of our thousands of tests) and run CTest on it without needing to remember updating multiple places in the workflow. Please consider this scenario when making changes as well.

@benmcmorran benmcmorran moved this from Triage to To do in 1.15 May 22, 2023
@gcampbell-msft
Copy link
Collaborator

#3243 Should enable this again. Please open another issue if this does not resolve your issue! Thanks @xisui-MSFT!

1.15 automation moved this from To do to Done Aug 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug a bug in the product Feature: ctest
Projects
No open projects
1.15
Done
Development

No branches or pull requests

5 participants