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: Improve test coverage of Language Server component #61

Merged
merged 20 commits into from
Jul 7, 2020

Conversation

michalbali256
Copy link
Contributor

No description provided.

}
return result;
std::lock_guard<std::mutex> lock(q_mtx_);
return !requests_.empty();
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a note, I did exactly this in the past and for some reason it was breaking the server... As long as it works now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you have any idea under what conditions it used to break? Because I am pretty sure these two implementations are equivalent.

"name": "WSL-Clang-Release-ASAN",
"generator": "Ninja",
"configurationType": "Release",
"buildRoot": "${projectDir}\\out\\build\\${name}",
Copy link
Contributor

Choose a reason for hiding this comment

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

can we unify build & install root dir for x64/86 and WSL?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

where should be that unified location?

Copy link
Contributor

Choose a reason for hiding this comment

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

the one for the x64/86 was OK IMO.

result = !requests_.empty();
}
return result;
std::lock_guard<std::mutex> lock(q_mtx_);
Copy link
Contributor

Choose a reason for hiding this comment

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

i think that this lock is redundant. the whole method seems suspicious. ideally, you want to put lock in some if statement rather then in reading bool

{
std::lock_guard<std::mutex> lock(q_mtx_);
if (is_running())
   ...
}

@@ -64,12 +70,8 @@ void request_manager::end_worker()

bool hlasm_plugin::language_server::request_manager::is_running()
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
bool hlasm_plugin::language_server::request_manager::is_running()
bool request_manager::is_running()

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jul 7, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

82.9% 82.9% Coverage
0.0% 0.0% Duplication

@michalbali256 michalbali256 merged commit 6c67153 into development Jul 7, 2020
@michalbali256 michalbali256 deleted the LS-tests branch July 7, 2020 13:19
@github-actions
Copy link

🎉 This PR is included in version 0.12.0-beta.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@github-actions
Copy link

🎉 This PR is included in version 0.12.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

SWETAS04 pushed a commit to SWETAS04/che-che4z-lsp-for-hlasm that referenced this pull request Feb 17, 2021
…4z#61)

* refactoring & dispatcher tests

* dispatcher test

* add feature launch test (so far launch, stackTrace and setBreakpoints tested)

* test: finished launch feature tests

* refactor: refactor register methods so virtual method is not called in constructors

* refactor: fix sonarcloud code smells

* refactor: fix code smells

* test: add dap server test

* test: improve dispatcher and lsp_erver tests

* test: add malformed message test for dap_server

* refactor: fix exception thowing

* test: variable initialization

* test: fix never ending test

* avoid waiting infinitely when there are no requests

* test: add finish requests test

* test: fix finish requests test

* fix possible race condition

* remove unnecessary lock

* unify visual studio build folders

* code smell fixes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants