-
-
Notifications
You must be signed in to change notification settings - Fork 35
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
🌿 split server.vim tests #405
Conversation
- Tests can now be run separately. - Improved parallelism in CI.
WalkthroughThe recent changes introduce a suite of comprehensive tests for the Denops server functionalities, including connection, starting, stopping, and status checking. Each test file employs asynchronous patterns to ensure robust validation across various scenarios, enhancing reliability and error handling within the Denops framework. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Denops
participant Server
User->>Denops: call denops#server#start()
Denops->>Server: Check if server is disabled
alt Server Disabled
Server-->>Denops: Return falsy (status: stopped)
else Server Enabled
Denops->>Server: Start server
Server-->>Denops: Status: starting
Server-->>Denops: Status: running (DenopsReady event)
end
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (5)
- tests/denops/runtime/functions/server/close_test.ts (1 hunks)
- tests/denops/runtime/functions/server/connect_test.ts (1 hunks)
- tests/denops/runtime/functions/server/start_test.ts (1 hunks)
- tests/denops/runtime/functions/server/status_test.ts (1 hunks)
- tests/denops/runtime/functions/server/stop_test.ts (1 hunks)
Additional comments not posted (34)
tests/denops/runtime/functions/server/status_test.ts (7)
15-21
: LGTM!The test step correctly verifies that the status is 'stopped' when no server is running.
35-44
: LGTM!The test step correctly verifies that the status is 'starting' when
denops#server#start()
is called.
46-60
: LGTM!The test step correctly verifies that the status is 'preparing' before DenopsReady is fired.
62-69
: LGTM!The test step correctly verifies that the status is 'running' after DenopsReady is fired.
71-84
: LGTM!The test step correctly verifies that the status is 'closing' when
denops#server#close()
is called.
86-93
: LGTM!The test step correctly verifies that the status is 'closed' after DenopsClosed is fired.
95-103
: LGTM!The test step correctly verifies that the status is 'stopped' after
denops#server#stop()
is called.tests/denops/runtime/functions/server/stop_test.ts (6)
27-40
: LGTM!The test step correctly verifies that the status does not change from 'stopped' if the server is not yet started.
62-69
: LGTM!The test step correctly verifies that the status changes to 'closing' immediately when
denops#server#stop()
is called.
70-73
: LGTM!The test step correctly verifies that the DenopsClosed event is fired.
74-79
: LGTM!The test step correctly verifies that the DenopsProcessStopped event is fired.
81-85
: LGTM!The test step correctly verifies that the status changes to 'stopped' asynchronously.
112-119
: LGTM!The test step correctly verifies that the status does not change from 'running' when connected to a shared server.
tests/denops/runtime/functions/server/close_test.ts (6)
34-47
: LGTM!The test step correctly verifies that the status does not change from 'stopped' if the server is not yet connected.
49-60
: LGTM!The test step correctly verifies that the DenopsClosed event is not fired if the server is not yet connected.
81-87
: LGTM!The test step correctly verifies that the status changes to 'closing' immediately when
denops#server#close()
is called.
89-92
: LGTM!The test step correctly verifies that the DenopsClosed event is fired.
93-96
: LGTM!The test step correctly verifies that the status changes to 'closed' asynchronously.
98-108
: LGTM!The test step correctly verifies that the local server is not stopped when
denops#server#close()
is called.tests/denops/runtime/functions/server/connect_test.ts (7)
36-63
: LGTM! Well-structured test scenario for "if denops disabled".The test scenario thoroughly checks the behavior when
denops
is disabled, covering return values, status, and event firing.
65-216
: LGTM! Comprehensive test scenario for "if not yet connected".The test scenario thoroughly checks the behavior when the server is not yet connected, covering empty address, invalid address, and valid address sub-scenarios.
219-272
: LGTM! Well-structured test scenario for "if already connected to local-server".The test scenario thoroughly checks the behavior when already connected to a local server, covering return values, status, and event firing.
274-323
: LGTM! Well-structured test scenario for "if already connected to shared-server".The test scenario thoroughly checks the behavior when already connected to a shared server, covering return values, status, and event firing.
325-385
: LGTM! Well-structured test scenario for "if the channel is closed unexpectedly".The test scenario thoroughly checks the behavior when the channel is closed unexpectedly, covering event firing, status change, and reconnection.
387-433
: LGTM! Well-structured test scenario for "if reconnect count exceed".The test scenario thoroughly checks the behavior when the reconnect count exceeds the threshold, covering status change and warning message.
Line range hint
393-439
:
LGTM! Well-structured test scenario for "if the server is stopped with a constraint error (issue 401)".The test scenario thoroughly checks the behavior when the server is stopped with a constraint error, covering event firing, status change, and warning message.
tests/denops/runtime/functions/server/start_test.ts (8)
49-76
: LGTM! Well-structured test scenario for "if denops disabled".The test scenario thoroughly checks the behavior when
denops
is disabled, covering return values, status, and event firing.
78-120
: LGTM! Well-structured test scenario for "if not yet started".The test scenario thoroughly checks the behavior when the server is not yet started, covering return values, status, and event firing.
122-167
: LGTM! Well-structured test scenario for "if already starting".The test scenario thoroughly checks the behavior when the server is already starting, covering return values, status, and event firing.
169-214
: LGTM! Well-structured test scenario for "if already connected to shared-server".The test scenario thoroughly checks the behavior when already connected to a shared server, covering return values, status, and warning message.
216-273
: LGTM! Well-structured test scenario for "ifdeno
command is not exists".The test scenario thoroughly checks the behavior when the
deno
command is not found, covering return values, status, event firing, and warning message.
275-340
: LGTM! Well-structured test scenario for "if the server is stopped unexpectedly".The test scenario thoroughly checks the behavior when the server is stopped unexpectedly, covering event firing, status change, and restarting.
342-390
: LGTM! Well-structured test scenario for "if restart count exceed".The test scenario thoroughly checks the behavior when the restart count exceeds the threshold, covering status change and warning message.
393-439
: LGTM! Well-structured test scenario for "if the server is stopped with a constraint error (issue 401)".The test scenario thoroughly checks the behavior when the server is stopped with a constraint error, covering event firing, status change, and warning message.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #405 +/- ##
=======================================
Coverage 95.52% 95.52%
=======================================
Files 23 23
Lines 1384 1384
Branches 174 174
=======================================
Hits 1322 1322
Misses 59 59
Partials 3 3 ☔ View full report in Codecov by Sentry. |
Local testing was sped up, unfortunately Github Action didn't show any improvement due to parallelism issues. (I checked runs |
functions/plugin tests can also be split, but I have put it off because I discovered a bug in them. |
Thanks 🎉 |
Test codes are not changed.
Summary by CodeRabbit
New Features
connect()
,start()
,close()
,stop()
, andstatus()
, enhancing reliability and error handling in the Denops framework.Bug Fixes
Documentation