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

Sentry consent question won't stop showing up #189

Closed juxeii closed 4 years ago

juxeii commented 4 years ago

Checklist

Describe the bug A notification is shown about sentry.io. No matter what you click here(accept or decline) it will show up again on every project start.

Screenshots (optional) Notification

matepek commented 4 years ago

Hey, Well it works for me. Could you attach the logs? Not just a piece you think it is relevant but the whole from the start until the end. Just reproduce the issue don't have to run tests, etc... You can mask your personal data if you wish but won't be there much interesting.

juxeii commented 4 years ago

Here is the for the first startup:

[2020-05-06 05:31:08.623] [INFO] {
  uri: h {
    scheme: 'file',
    authority: '',
    path: '/var/fpwork/reiss/gnb/cplane',
    query: '',
    fragment: '',
    _formatted: 'file:///var/fpwork/reiss/gnb/cplane',
    _fsPath: '/var/fpwork/reiss/gnb/cplane'
  },
  name: 'cplane',
  index: 0
} linux v12.4.0 {
  node: '12.4.0',
  v8: '7.4.288.27-node.18',
  uv: '1.29.1',
  zlib: '1.2.11',
  brotli: '1.0.7',
  ares: '1.15.0',
  modules: '72',
  nghttp2: '1.38.0',
  napi: '4',
  llhttp: '1.1.3',
  http_parser: '2.8.0',
  openssl: '1.1.1b',
  cldr: '35.1',
  icu: '64.2',
  tz: '2019a',
  unicode: '12.1'
} 1.44.2
[2020-05-06 05:31:08.629] [INFO] sentry.io is false
[2020-05-06 05:31:08.638] [INFO] load called
[2020-05-06 05:31:08.639] [INFO] load started
[2020-05-06 05:31:08.640] [INFO] `test.advancedExecutables` is not defined. trying to use `test.executables`
[2020-05-06 05:31:08.641] [INFO] pattern /var/fpwork/reiss/gnb/cplane/build/bin/*UT /var/fpwork/reiss/gnb/cplane {
  isAbsolute: true,
  absPattern: '/var/fpwork/reiss/gnb/cplane/build/bin/*UT',
  isPartOfWs: true,
  relativeToWsPosix: 'build/bin/*UT'
}
[2020-05-06 05:31:08.641] [INFO] Absolute path is used for workspace directory. This is unnecessary, but it should work.
[2020-05-06 05:31:09.054] [INFO] load finished 0
[2020-05-06 05:31:10.352] [INFO] Sentry consent Sure! I love this extension and happy to help.

And after restart:

[2020-05-06 05:32:42.358] [INFO] {
  uri: h {
    scheme: 'file',
    authority: '',
    path: '/var/fpwork/reiss/gnb/cplane',
    query: '',
    fragment: '',
    _formatted: 'file:///var/fpwork/reiss/gnb/cplane',
    _fsPath: '/var/fpwork/reiss/gnb/cplane'
  },
  name: 'cplane',
  index: 0
} linux v12.4.0 {
  node: '12.4.0',
  v8: '7.4.288.27-node.18',
  uv: '1.29.1',
  zlib: '1.2.11',
  brotli: '1.0.7',
  ares: '1.15.0',
  modules: '72',
  nghttp2: '1.38.0',
  napi: '4',
  llhttp: '1.1.3',
  http_parser: '2.8.0',
  openssl: '1.1.1b',
  cldr: '35.1',
  icu: '64.2',
  tz: '2019a',
  unicode: '12.1'
} 1.44.2
[2020-05-06 05:32:42.367] [INFO] sentry.io is false
[2020-05-06 05:32:42.380] [INFO] load called
[2020-05-06 05:32:42.381] [INFO] load started
[2020-05-06 05:32:42.382] [INFO] `test.advancedExecutables` is not defined. trying to use `test.executables`
[2020-05-06 05:32:42.384] [INFO] pattern /var/fpwork/reiss/gnb/cplane/build/bin/*UT /var/fpwork/reiss/gnb/cplane {
  isAbsolute: true,
  absPattern: '/var/fpwork/reiss/gnb/cplane/build/bin/*UT',
  isPartOfWs: true,
  relativeToWsPosix: 'build/bin/*UT'
}
[2020-05-06 05:32:42.384] [INFO] Absolute path is used for workspace directory. This is unnecessary, but it should work.
[2020-05-06 05:32:42.760] [INFO] load finished 0
[2020-05-06 05:32:43.861] [INFO] Sentry consent Sure! I love this extension and happy to help.

Do you need other logs? How can I change the log level of the extension?

matepek commented 4 years ago

You cannot change the log level.

That is the end of the log? The code tries to set the setting and if there is an error it should log it.

Hm..

In your user's settings.json (not the one inside the .vscode) you should have "testMate.cpp.log.logSentry": "enable". Can you see that?

matepek commented 4 years ago

Okay, I have an idea what caused the problem. I screwed up the migration of this special variable. Do you have a variable in workspace settings.json catch2TestExplorer.logSentry?

juxeii commented 4 years ago

In user settings.json there are these two entries:

"testMate.cpp.log.userId": "00755c2ff1937ebb49bf9393ac6507d8b7f2c81d", "testMate.cpp.log.logSentry": "enable"

Both are "greyed" out saying This setting cannot be applied in this window. It will be applied when you open local window.

matepek commented 4 years ago

No catch2TestExplorer?

Nothing in the workspace or workspaceFolder settings.json?

matepek commented 4 years ago

Have to ask: Are you familiar with this multi level vscode settings strucutre?

juxeii commented 4 years ago

In workspace folder I have "testMate.cpp.test.executables": "/var/fpwork/reiss/gnb/cplane/build/bin/*UT" I remember that some 2 days ago(or so) I had an entry with catch2TestExplorer for the executables pattern, but that had yellow squiggles and vsc replaced it with the above entry to make setting.json clean again.

juxeii commented 4 years ago

Yes, I know the hirarchy. What entries do you want?

matepek commented 4 years ago

I searched for the error.

Do you use vscode remote?

juxeii commented 4 years ago

Yes.

matepek commented 4 years ago

Well that's a quite important piece of information. I will add this to the issue template. :)

Okay, I see whats the problem here. Hold on..

juxeii commented 4 years ago

May I ask two more questions: 1) Are variable substitutions supported in executables pattern? E.g. ${env:UT}/somePath/tests 2) We have quite a big code base. If I open the extension on the left, it will start search for executables. This takes some minutes. Would it be possible to configure that this will be done automatically after vscode startup?

EDIT: Too bad github removed private messages :(

matepek commented 4 years ago

Your issue will be fixed in 3.0.2 Thanks for reporting it. (release is done)

Sure, happy to help.

I thought about creating a gitter account might be useful for somebody, but I'm not sure. This extension has so small user base :)

juxeii commented 4 years ago

1) Ok, will try os_env instead of env 2) You are right that if I am very specific with the pattern then there is a speedup. But usually I need all tests in the project. And we have lots of them. It would be really helpful if the extension would scan for tests after startup(maybe even create some cache mechanism). Because sometimes I miss to open the extension in the beginning. But right at that point I would need to execute some tests, so I have to wait some minutes before the executables are scanned. Such on optional feature would be greate("Search for executables on startup").

matepek commented 4 years ago

Well test list caching feature actually exists: testMate.cpp.discovery.testListCaching Let me know the performance of that.

juxeii commented 4 years ago

Ok, will test that. Btw: notification problem is fixed, many thx for the fast fix :D

juxeii commented 4 years ago

I think that caching improves the loading time. Still, an automatic load would be great.

matepek commented 4 years ago

I found an option.. working on that.

matepek commented 4 years ago

2 options.. lol One is even better than the other

matepek commented 4 years ago

Check the last section of the support page.

matepek commented 4 years ago

I also figured out how to run the tests automatically at startup. Description is at support page.

juxeii commented 4 years ago

I added

{
            "label": "Activate Test Explorer",
            "command": "${command:test-explorer.reload}", // For running use "${command:test-explorer.run-all}"
            "problemMatcher": [],
            "runOptions": {
                "runOn": "folderOpen" // This will cause the trigger. Have to run manually once!
            }
        }

totasks.json but after startup I get

Executing task: ${command:test-explorer.reload}  <

The terminal shell path "${command:test-explorer.reload}" does not exist

Terminal will be reused by tasks, press any key to close it.
matepek commented 4 years ago

Can you run it manually? Is that work?

juxeii commented 4 years ago

Same output when I run it manually. But it is strange that when I open the extension some minutes after startup, all tests are immedeatly loaded anyway. That is exactly what I wanted and i could live with this warning ;)

matepek commented 4 years ago

Using remote right? I have some ideas. Maybe the remote need more time to process all the load events. Or maybe it is fast because of the caching? Is it slow again if you remove the task? In the first case it is probably vscode or vscode remote related issue.

matepek commented 4 years ago

There is another way I will release it later but won’t publish officially because this is the nice way. But if you need for workaround we can try that too

juxeii commented 4 years ago

I disabled caching but it works as expected. After some time when I open the extension all tests are loaded straight away. The warning is still there and I cannot even understand how that could possibly work...but it does :)

juxeii commented 4 years ago

Could it be a problem that I use https://github.com/hbenl/vscode-test-explorer? I have a different task defined with something like ${command:extension.commandvariable.selectedText So I tried to add extension after command but that did not help.

matepek commented 4 years ago

Test Explorer is the UI part of of my extension. No, I suspect its a vscode/vscode-remote issue. It should be reported. Meanwhile you can hide the error with this:

        {
            "label": "Load TestMate",
            "command": "${command:test-explorer.reload}",
            "problemMatcher": [],
            "runOptions": {
                "runOn": "folderOpen"
            },
            "presentation": {
                "echo": true,
                "reveal": "never",
                "focus": false,
                "panel": "shared",
                "showReuseMessage": true,
                "clear": false
            }
        }
juxeii commented 4 years ago

See solution here: https://github.com/microsoft/vscode/issues/97119

matepek commented 4 years ago

Nice, thanks. Updated the doc.