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

Test explorer creates a test case each time a keystroke is registered #2530

Open
hjbolide opened this issue Apr 22, 2024 · 6 comments
Open
Labels
bug Something isn't working test-runner

Comments

@hjbolide
Copy link

Environment

VsCodium: v1.88.1
Calva: 2.0.446

Issue

Test explorer creates a test case each time a keystroke is registered, ended up having a lot of test cases with cut up names. Not sure if it's related, the gutter icons are all over the place.
Reloading the namespace or whole repl doesn't help.

Screenshots

Screenshot 2024-04-22 at 9 31 27 PM

Screenshot 2024-04-22 at 9 40 08 PM

Has anyone run into this issue before and have a workaround?

Thanks.

@PEZ
Copy link
Collaborator

PEZ commented Apr 22, 2024

Oh, wow. That's really weird. And awful. Is there a way you can create a reproduction project? It needn't be a super minimal repro to begin with. We can try to shrink it together.

@PEZ PEZ added test-runner bug Something isn't working labels Apr 22, 2024
@hjbolide
Copy link
Author

hjbolide commented Apr 22, 2024

I'll work on it some time today and share the repo link here.

Thank you PEZ.

@hjbolide
Copy link
Author

Hi PEZ:

Please find the minimal clojure project I have set up: https://github.com/hjbolide/minimal-clj.

What I noticed also during this is: test explorer only updates whenever things are added to the file, new paste, new typed in characters, deletion doesn't seem to update the test explorer at all.

Here's another couple of screenshots:

Screenshot 2024-04-23 at 12 44 23 PM
Screenshot 2024-04-23 at 12 44 32 PM

Thank you for your time.

@PEZ
Copy link
Collaborator

PEZ commented Apr 23, 2024

Hi, thanks for the project. To make it a repro project, please add instructions to it of how to reproduce the problem. I'm not a test explorer user so it needs to be a bit detailed.

@hjbolide
Copy link
Author

Oh I'm sorry, let me add the detailed steps:

Steps to reproduce

  • Turn on "Use Test Explorer" in Calva settings:
    Screenshot 2024-04-23 at 4 46 31 PM

  • Add the following block to settings.json:

"calva.replConnectSequences": [{
  "name": "repl",
  "projectType": "Leiningen",
  "menuSelections": {
    "leinAlias": null,
    "leinProfiles": []
  }
}],
  • Checkout repo: https://github.com/hjbolide/minimal-clj

  • Open project using VsCodium File -> Open Folder

  • Start a project REPL (Jack-in), and select repl as project type

  • Navigate to namespace minclj.domain.auth-test

  • Switch view to Test Explorer:
    Screenshot 2024-04-23 at 5 10 52 PM

  • Make change to test case test-platform-admin-truthy-value by deleting a few characters

  • Notice the Test Explorer tree having more and more test cases:
    Screenshot 2024-04-23 at 5 13 04 PM

@PEZ
Copy link
Collaborator

PEZ commented Apr 27, 2024

I can reproduce this easily with any project. It seems we do not implement clojure-lsp testTree as we should. @ericdallo where can I read about how to implement it properly? The problem here is that we get notifications for the new deftest symbol, but we don't get anything about the old one, so I am guessing we should listen on something more than just this:

    client.client.onNotification('clojure/textDocument/testTree', (tree: defs.TestTreeParams) => {
      params.testTreeHandler(tree);
    });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working test-runner
Projects
None yet
Development

No branches or pull requests

2 participants