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

UI test to check for relevant completion options in bootstrap.properties and server.env #1205

Merged
merged 11 commits into from
Jan 13, 2025

Conversation

anusreelakshmi934
Copy link
Contributor

@anusreelakshmi934 anusreelakshmi934 commented Jan 1, 2025

Fixes #852

testCompletionValuesInServerEnv Video

serverEnv.mov

testCompletionValuesInBootstrapProperties Video

Bootstrap.mov

Copy link
Contributor

@mrglavas mrglavas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anusreelakshmi934 I noticed testCompletionValuesInServerEnv() and testCompletionValuesInBootstrapProperties() are mostly copies of each other. We're always trying to reduce and avoid code duplication to make the plugin and tests easier to maintain.

@TrevCraw Wondering what your thoughts are on whether this is sufficient coverage since you opened this issue.

@TrevCraw
Copy link
Contributor

TrevCraw commented Jan 8, 2025

Based on this file - https://github.com/OpenLiberty/liberty-language-server/blob/main/liberty-ls/src/main/java/io/openliberty/tools/langserver/utils/ServerPropertyValues.java#L27 - it looks like LCLS returns a List of Strings for the default completion items for each property key. Therefore, I think it is safe to assume each key should behave the same regarding the filtering applied by LSP4IJ to order the completion items. Testing one property key in each file should be sufficient.

@anusreelakshmi934
Copy link
Contributor Author

Based on this file - https://github.com/OpenLiberty/liberty-language-server/blob/main/liberty-ls/src/main/java/io/openliberty/tools/langserver/utils/ServerPropertyValues.java#L27 - it looks like LCLS returns a List of Strings for the default completion items for each property key. Therefore, I think it is safe to assume each key should behave the same regarding the filtering applied by LSP4IJ to order the completion items. Testing one property key in each file should be sufficient.

So @TrevCraw Is it okay to have two methods since testCompletionValuesInServerEnv() and testCompletionValuesInBootstrapProperties() are mostly copies of each other as pointed out my @mrglavas .

@TrevCraw
Copy link
Contributor

TrevCraw commented Jan 9, 2025

So @TrevCraw Is it okay to have two methods since testCompletionValuesInServerEnv() and testCompletionValuesInBootstrapProperties() are mostly copies of each other as pointed out my @mrglavas .

I would suggest following the recommendation from @mrglavas to avoid code duplication to make these tests easier to maintain.

Copy link
Contributor

@dessina-devasia dessina-devasia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

Copy link
Contributor

@mrglavas mrglavas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thanks for refactoring to reuse code. This will also make it easier to contribute additional completion tests should we want to expand the coverage in the future.

@anusreelakshmi934 anusreelakshmi934 merged commit 672fbcb into OpenLiberty:main Jan 13, 2025
2 of 3 checks passed
@anusreelakshmi934 anusreelakshmi934 deleted the UITest-Issue852 branch January 14, 2025 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create UI test to check for relevant completion options in bootstrap.properties and server.env
4 participants