matepek / vscode-catch2-test-adapter

Catch2, Google Test and doctest Adapter for the VSCode
https://marketplace.visualstudio.com/items?itemName=matepek.vscode-catch2-test-adapter
MIT License
210 stars 52 forks source link

Test disappear from test explorer UI when changing status #447

Open jhuels opened 2 months ago

jhuels commented 2 months ago

Checklist

Describe the bug

When a test changes status it sometimes disappears from the test explorer UI. I notice this more when going from fail -> pass, but sometimes get this when going from fail/success -> not run.

This can also happen to groupings of tests.

To Reproduce

  1. Create a failing test
  2. Update to make the test pass
  3. Re-run by clicking Run in the test explorer UI
  4. Test disappears from the tree, all other tests from that grouping remain

Screenshots (optional)

Desktop

Name: C++ TestMate Id: matepek.vscode-catch2-test-adapter Description: Run GoogleTest, Catch2 and DOCtest tests from VSCode Version: 4.12.0 Publisher: Mate Pek VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=matepek.vscode-catch2-test-adapter

Regression bug?

I don't think so, I've noticed this for a long time.

**Log** (optional but recommended) ```js [2024-09-17 18:07:44.785] [INFO] proc starting /home/jhuels/path/to/test [ '--gtest_color=no', '--gtest_filter=TestSuite.TestName', '--gtest_also_run_disabled_tests' ] /home/jhuels/path/to/test [2024-09-17 18:07:44.792] [INFO] proc started 214564 /home/jhuels/path/to/test { shared: { workspaceFolder: { uri: f { scheme: 'file', authority: '', path: '/home/jhuels/path/to/code', query: '', fragment: '', _formatted: 'file:///home/jhuels/path/to/code', _fsPath: '/home/jhuels/path/to/code' }, name: 'project_name', index: 0 }, log: { _logger: { configSection: 'testMate.cpp.log', workspaceFolder: undefined, outputChannelName: 'C++ TestMate', inspectOptions: [Object], includeLocation: false, targets: [Array], nextInspectOptions: undefined, configChangeSubscription: [Object] } }, testController: { controller: { items: [Object], label: [Getter/Setter], refreshHandler: [Getter/Setter], id: [Getter], relatedCodeProvider: [Getter/Setter], createRunProfile: [Function: createRunProfile], createTestItem: [Function: createTestItem], createTestRun: [Function: createTestRun], invalidateTestResults: [Function: invalidateTestResults], resolveHandler: [Getter/Setter], dispose: [Function: dispose] }, testItem2test: WeakMap { } }, executeTask: [Function (anonymous)], sendRetireEvent: [Function: d], varToValue: [ { resolve: /\$\{workspaceFolder(?:\[(?:(-?[0-9]+)|(-?[0-9]+)?:(-?[0-9]+)?)\])?\}/, rule: [Function: rule] }, { resolve: /\$\{workspaceDirectory(?:\[(?:(-?[0-9]+)|(-?[0-9]+)?:(-?[0-9]+)?)\])?\}/, rule: [Function: rule] }, { resolve: '${workspaceName}', rule: 'project_name' }, { resolve: /\$\{assert(?::([^}]+))?\}/, rule: [Function: rule] }, { resolve: '${osPathSep}', rule: '/' }, { resolve: '${osPathEnvSep}', rule: ':' }, { resolve: /\$\{config:([^}]+)\}/, rule: [Function: rule] }, { resolve: /\$\{command:([^}]+)\}/, rule: [AsyncFunction: rule] } ], rngSeed: null, execWatchTimeout: 10000, _execRunningTimeout: 600000, execParsingTimeout: 5000, isNoThrow: false, enabledTestListCaching: false, enabledStrictPattern: null, googleTestTreatGMockWarningAs: 'nothing', googleTestGMockVerbose: 'default', hideUninterestingOutput: true, _execRunningTimeoutChangeEmitter: n { z: 0, f: undefined, g: undefined, j: undefined, w: undefined, q: [Function (anonymous)], u: undefined }, _cancellationTokenSource: O { f: R { a: false, b: null }, g: undefined }, cancellationToken: R { a: false, b: null }, onDidChangeExecRunningTimeout: [Function (anonymous)], taskPool: { _maxTaskCount: 1, _runningTaskCount: 1, _waitingTasks: [] }, buildProcessChecker: { _log: { _logger: [Object] }, _checkIntervalMillis: 2000, _defaultPattern: /(^|[/\\])(bazel|cmake|make|ninja|cl|c\+\+|ld|clang|clang\+\+|gcc|g\+\+|link|icc|armcc|armclang)(-[^/\\]+)?(\.exe)?$/, _lastChecked: 1726596463056, _finishedP: Promise { undefined }, _finishedResolver: [Function (anonymous)], _timerId: undefined } }, name: 'Debug - ${baseFilename}', description: undefined, varToValue: [ { resolve: '${filename}', rule: 'panel_tests' }, { resolve: '${relDirpath}', rule: 'build-gcc-debug/bin' }, { resolve: /\$\{filename(?:\[(?:(-?[0-9]+)|(-?[0-9]+)?:(-?[0-9]+)?)\])?\}/, rule: [Function: rule] }, { resolve: /\$\{relPath(?:\[(?:(-?[0-9]+)|(-?[0-9]+)?:(-?[0-9]+)?)\])?\}/, rule: [Function: rule] }, { resolve: /\$\{absPath(?:\[(?:(-?[0-9]+)|(-?[0-9]+)?:(-?[0-9]+)?)\])?\}/, rule: [Function: rule] }, { resolve: /\$\{relDirpath(?:\[(?:(-?[0-9]+)|(-?[0-9]+)?:(-?[0-9]+)?)\])?\}/, rule: [Function: rule] }, { resolve: /\$\{absDirpath(?:\[(?:(-?[0-9]+)|(-?[0-9]+)?:(-?[0-9]+)?)\])?\}/, rule: [Function: rule] }, { resolve: '${extFilename}', rule: '' }, { resolve: '${baseFilename}', rule: 'panel_tests' }, { resolve: /\$\{workspaceFolder(?:\[(?:(-?[0-9]+)|(-?[0-9]+)?:(-?[0-9]+)?)\])?\}/, rule: [Function: rule] }, { resolve: /\$\{workspaceDirectory(?:\[(?:(-?[0-9]+)|(-?[0-9]+)?:(-?[0-9]+)?)\])?\}/, rule: [Function: rule] }, { resolve: '${workspaceName}', rule: 'project_name' }, { resolve: /\$\{assert(?::([^}]+))?\}/, rule: [Function: rule] }, { resolve: '${osPathSep}', rule: '/' }, { resolve: '${osPathEnvSep}', rule: ':' }, { resolve: /\$\{config:([^}]+)\}/, rule: [Function: rule] }, { resolve: /\$\{command:([^}]+)\}/, rule: [AsyncFunction: rule] }, { resolve: /\$\{cwd(?:\[(?:(-?[0-9]+)|(-?[0-9]+)?:(-?[0-9]+)?)\])?\}/, rule: [Function: rule] } ], path: '/home/jhuels/path/to/test', options: { cwd: '/home/jhuels/path/to/code/build-gcc-debug/bin', env: { } }, _frameworkSpecific: { testGrouping: undefined }, markAsSkipped: false, executableCloning: false, debugConfigData: undefined, runTask: { before: [], beforeEach: [], after: [], afterEach: [] }, spawner: s {}, resolvedSourceFileMap: {}, log: { _logger: { configSection: 'testMate.cpp.log', workspaceFolder: undefined, outputChannelName: 'C++ TestMate', inspectOptions: { depth: 3 }, includeLocation: false, targets: [ [c] ], nextInspectOptions: undefined, configChangeSubscription: { dispose: [Function (anonymous)] } } }, workspaceFolder: { uri: f { scheme: 'file', authority: '', path: '/home/jhuels/path/to/code', query: '', fragment: '', _formatted: 'file:///home/jhuels/path/to/code', _fsPath: '/home/jhuels/path/to/code' }, name: 'project_name', index: 0 }, workspacePath: '/home/jhuels/path/to/code', testController: { controller: { items: { size: [Getter], forEach: [Function: forEach], replace: [Function: replace], add: [Function: add], delete: [Function: delete], get: [Function: get], toJSON: [Function: toJSON], [Symbol(Symbol.iterator)]: [Function: [Symbol.iterator]] }, label: [Getter/Setter], refreshHandler: [Getter/Setter], id: [Getter], relatedCodeProvider: [Getter/Setter], createRunProfile: [Function: createRunProfile], createTestItem: [Function: createTestItem], createTestRun: [Function: createTestRun], invalidateTestResults: [Function: invalidateTestResults], resolveHandler: [Getter/Setter], dispose: [Function: dispose] }, testItem2test: WeakMap { } }, cancellationToken: R { a: false, b: null }, taskPool: { _maxTaskCount: 1, _runningTaskCount: 1, _waitingTasks: [] }, executeTask: [Function (anonymous)], parallelizationPool: { _maxTaskCount: 1, _runningTaskCount: 1, _waitingTasks: [] }, optionsHash: '5104f6' } [ '--gtest_color=no', '--gtest_filter=TestSuite.TestName', '--gtest_also_run_disabled_tests' ]; [2024-09-17 18:07:44.973] [INFO] TestCase not found in children TestSuite.TestName [2024-09-17 18:07:44.973] [INFO] testGrouping { testId: 'TestName', resolvedFile: undefined, tags: [ 'TestSuite' ], testGrouping: { groupByExecutable: { label: 'Debug - ${baseFilename}', description: undefined, groupByTags: { tags: [], tagFormat: '${tag}' } } } } [2024-09-17 18:07:44.975] [INFO] Test TestSuite.TestName has started. [2024-09-17 18:07:44.979] [INFO] Test TestSuite.TestName has stopped. [2024-09-17 18:07:45.002] [INFO] proc close: /home/jhuels/path/to/test [ 0, null ] [2024-09-17 18:07:45.003] [INFO] proc finished: /home/jhuels/path/to/test [2024-09-17 18:07:45.003] [ERROR] reloading-error: [Error: spawn ETXTBSY at ChildProcess.spawn (node:internal/child_process:421:11) at Object.spawn (node:child_process:799:9) at e.spawn (/home/jhuels/.vscode/extensions/matepek.vscode-catch2-test-adapter-4.12.0/out/dist/main.js:2:390694) at s.spawn (/home/jhuels/.vscode/extensions/matepek.vscode-catch2-test-adapter-4.12.0/out/dist/main.js:2:301622) at f._reloadChildren (/home/jhuels/.vscode/extensions/matepek.vscode-catch2-test-adapter-4.12.0/out/dist/main.js:2:366258) at async /home/jhuels/.vscode/extensions/matepek.vscode-catch2-test-adapter-4.12.0/out/dist/main.js:2:331596 at async e.ConfigOfExecGroup._recursiveHandleRunnable (/home/jhuels/.vscode/extensions/matepek.vscode-catch2-test-adapter-4.12.0/out/dist/main.js:2:280257)] { errno: -26, code: 'ETXTBSY', syscall: 'spawn' } [2024-09-17 18:07:45.056] [INFO] Checking running build related processes /(^|[/\\])(bazel|cmake|make|ninja|cl|c\+\+|ld|clang|clang\+\+|gcc|g\+\+|link|icc|armcc|armclang)(-[^/\\]+)?(\.exe)?$/ [2024-09-17 18:07:45.078] [INFO] Not found running build related process [2024-09-17 18:07:47.079] [INFO] Checking running build related processes /(^|[/\\])(bazel|cmake|make|ninja|cl|c\+\+|ld|clang|clang\+\+|gcc|g\+\+|link|icc|armcc|armclang)(-[^/\\]+)?(\.exe)?$/ [2024-09-17 18:07:47.107] [INFO] Not found running build related process [2024-09-17 18:07:47.107] [INFO] refresh timed out: /home/jhuels/path/to/test ```

I might forget to mention that PLEASE attach an EXTENSIVE log. A lot of times reportes just select what they think it is important and those logs sometime not sufficient.

Sorry these tests are in an export controlled system so I have to manually redact them. If you need more please let me know.

matepek commented 1 month ago

Hello, I was not able to reproduce with setting:

    "testMate.cpp.test.advancedExecutables": [
        {
            "pattern":"./build/gtest1.exe",
            "testGrouping": {
                "testId": "TestName",
                "tags": [ "TestSuite" ],
                "testGrouping": {
                  "groupByExecutable": {
                    "label": "Debug - ${baseFilename}",
                    "groupByTags": { "tags": [], "tagFormat": "${tag}" }
                  }
                }
              }
        },