Skip to content

test: provide code action cancellation tests - #777

Closed
dessina-devasia wants to merge 8 commits into
redhat-developer:mainfrom
dessina-devasia:code-action-cancel-test
Closed

dessina-devasia wants to merge 8 commits into
redhat-developer:mainfrom
dessina-devasia:code-action-cancel-test

Conversation

@dessina-devasia

@dessina-devasia dessina-devasia commented Jan 27, 2025 •

Copy link
Copy Markdown

This test emulates the language server and cancels the request.

This PR corresponds to the ticket OpenLiberty/liberty-tools-intellij#1072

@angelozerr

Copy link
Copy Markdown
Contributor

Thanks for your contribution but I'm not sure this test is relevant.

I think we should provide several tests which check that codeaction generates proper IJ QuickFixes (@SCWells72 have you some idea how to write this kind of tests?)

When we will have this kind of test we could write a test which emulates long timeout to compute code actions and the second codeactons call should cancel the first (you should never call cancel like you did).

@mrglavas

Copy link
Copy Markdown
Contributor

Thanks for your contribution but I'm not sure this test is relevant.

@angelozerr I was wondering that too. I thought we at least wanted a test which replicated the intermittent problem with missing quick fixes. @dessina-devasia Have a look at the trace I captured here: OpenLiberty/liberty-tools-intellij#891 (comment) for reference.

@dessina-devasia

dessina-devasia commented Jan 28, 2025 •

Copy link
Copy Markdown
Author

@dessina-devasia Have a look at the trace I captured here: OpenLiberty/liberty-tools-intellij#891 (comment) for reference.

sure @mrglavas

@dessina-devasia

Copy link
Copy Markdown
Author

@mrglavas @angelozerr I've updated the PR as per the comments. Could you please have a look? Thank you!

@angelozerr

angelozerr commented Jan 28, 2025 •

Copy link
Copy Markdown
Contributor

@dessina-devasia is the goal of this test should emulate the issue OpenLiberty/liberty-tools-intellij#891 (comment) ?

If yes , I am not sure that it is in the right direction:

  • tests doesn't fail (it should fail if it emulates the problem
  • if I have understood correctly the issue, the problem is that LSP4IJ doesn't provide an IJ Quickfixes when the first LSP request is canceled and the second LSP request works.

I think this kind of test can be hard to write it.

But I suggest that you start to write a test which checks some expected IJ Quickfixes according a given LSP codeAction request like I did for completion when I fixed an issue with your bootstrap.properties https://github.com/redhat-developer/lsp4ij/blob/main/src/test/java/com/redhat/devtools/lsp4ij/features/completion/BootstrapPropertiesCompletionTest.java

@dessina-devasia

Copy link
Copy Markdown
Author

Another PR has been raised with the above-mentioned approach. It is a draft PR and still in progress. I am facing an issue while retrieving code actions and will mark it as ready for review once the issue is resolved.

@angelozerr

Copy link
Copy Markdown
Contributor

@dessina-devasia can we close this PR (without merging it) ?

@dessina-devasia

dessina-devasia commented Feb 11, 2025 •

Copy link
Copy Markdown
Author

Sure @angelozerr, we can close this PR without merging, as we have raised another PR with different approach

@angelozerr angelozerr added the invalid This doesn't seem right label Feb 11, 2025
@angelozerr

Copy link
Copy Markdown
Contributor

Thanks @dessina-devasia for your answer. I close it.

@angelozerr angelozerr closed this Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

invalid This doesn't seem right

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants