vscode-catch2-test-adapter icon indicating copy to clipboard operation
vscode-catch2-test-adapter copied to clipboard

Label merging is broken after adding current working directory in the advanced executables configuration

Open rafalborczuch opened this issue 1 year ago • 0 comments

Checklist

  • [x] The issue is about this extension and NOT about a fork.
  • [x] Checked the ALL the SUPPORT document.
  • [x] The latest version of the extension was used.
  • [x] It is not related to remote-vscode or I checked the following issue
  • [x] Imagine yourself into my position and think how hard to debug the issue without insufficient information. I understand that you have privacy concerns and I expect you to understand that this extension is developed for free. Thanks.

Describe the bug

Label merging stops working after adding cwd property to the advanced executables configuration. The cwd path exists on the filesystem and tests have the correct cwd set when running/debugging. I use a multi-root workspace.

To Reproduce

The following config correctly merges the labels in the tree view. Note that the cwd property is commented.

"testMate.cpp.test.advancedExecutables": [
    {
        "pattern": "${command:cmake.activeFolderName}/bin/linux/${command:cmake.buildType}/**/*{test,Test,TEST}*",
        // "cwd": "${relDirpath}/ctest_cwds/${filename}",
        "gtest": {
            "testGrouping": {
                "groupByExecutable": {
                    "label": "${absDirpath[-4:-3]}",
                    "description": "${relDirpath}",
                    "mergeByLabel": true,
                    "groupByExecutable": {
                        "label": "${filename}",
                        "description": "${workspaceName}",
                        "groupByTags": {
                            "tags": [],
                            "tagFormat": "${tag}"
                        }
                    },
                }
            }
        }
    }
],

producing the following tree view in the Test Explorer:

projectA
    executable1
        TestClassA
            testA1
            tetsA2
        TestClassB
            testB1
            tetsB2
    executable2
        TestClassC
            testC1
            tetsC2
        TestClassD
            testD1
            tetsD2

After uncommenting the cwd line:

"testMate.cpp.test.advancedExecutables": [
    {
        "pattern": "${command:cmake.activeFolderName}/bin/linux/${command:cmake.buildType}/**/*{test,Test,TEST}*",
        "cwd": "${relDirpath}/ctest_cwds/${filename}",
        "gtest": {
            "testGrouping": {
                "groupByExecutable": {
                    "label": "${absDirpath[-4:-3]}",
                    "description": "${relDirpath}",
                    "mergeByLabel": true,
                    "groupByExecutable": {
                        "label": "${filename}",
                        "description": "${workspaceName}",
                        "groupByTags": {
                            "tags": [],
                            "tagFormat": "${tag}"
                        }
                    },
                }
            }
        }
    }
],

tree view in the Test Explorer doesn't merge 1st level label:

projectA
    executable1
        TestClassA
            testA1
            tetsA2
        TestClassB
            testB1
            tetsB2
projectA
    executable2
        TestClassC
            testC1
            tetsC2
        TestClassD
            testD1
            tetsD2

Each executable has its own 1st level node (projectA in the example).

Desktop

  • Extension Version: v4.9.0
  • VS Code Version: 1.85.2
  • Catch2 / Google Test / DOCTest Version: Google Test 1.6
  • OS Type and Version: Windows 11 23H2
  • Using remote-ssh/docker/wsl?: Using remote dev container (CentOS 7) with WSL 2 (Ubuntu 22.04)

rafalborczuch avatar Feb 22 '24 21:02 rafalborczuch