This repository has been archived by the owner on Dec 29, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 256
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alexheretic
force-pushed
the
alex-cmd-tests
branch
from
September 21, 2018 20:29
9d33fed
to
e9c54b0
Compare
I've been meaning to tackle the recent infer_bin failure myself, thank you! It's a lot better to see what's causing the actual failure. Could you rebase after the #1063 merge, please? |
cc @spacekookie who also wanted to tackle the integration "cmd" tests and do more structural checking |
alexheretic
force-pushed
the
alex-cmd-tests
branch
3 times, most recently
from
September 23, 2018 12:15
31b8ef4
to
7edd6d2
Compare
Hey @alexheretic, I'm sorry for the churn - could you please rebase it again and only include the testing changes (it seems that |
alexheretic
force-pushed
the
alex-cmd-tests
branch
from
September 28, 2018 15:07
7edd6d2
to
e13b694
Compare
np |
Thanks once again! bors r+ |
bors-voyager bot
added a commit
that referenced
this pull request
Sep 30, 2018
1062: Rework cmd tests r=Xanewok a=alexheretic * Rewrite all _tests/tests.rs_ "cmd" tests * <s>cargo update</s> * cmd test wait-for-rls-stdout timeout reduced 300 -> 30 The cmd tests aren't good enough because they don't fail very usefully. They either work or block for 300 seconds then say nothing. For example the build is currently failing in master, but can anyone see why? The new code has * Explicit timeouts for any blocking calls, meaning it's easy to see where we wait for stdout. * More accurate dynamic json assertions. ```rust assert_eq!(json["method"], "window/progress"); assert_eq!(json["params"]["title"], "Indexing"); ``` * Removed all but one test checking _window/progress_ messages. * Removed outer timeout/closure which obfuscates test panics & adds complexity. The `RlsHandle` now uses a thread to eagerly read stdout, and eprints that stdout when an assertion fails. This stdout allows us to debug the tests when they fail. To see the improvement here is the failure output of the tests with this change: ``` running 4 tests test cmd_test_infer_bin ... FAILED test cmd_test_complete_self_crate_name ... ok test cmd_test_simple_workspace ... ok test cmd_changing_workspace_lib_retains_bin_diagnostics ... ok failures: ---- cmd_test_infer_bin stdout ---- thread 'cmd_test_infer_bin' panicked at 'assertion failed: `(left == right)` left: `String("window/showMessage")`, right: `"textDocument/publishDiagnostics"`', tests/tests.rs:58:5 note: Run with `RUST_BACKTRACE=1` for a backtrace. ---rls-stdout--- Content-Length: 607 {"jsonrpc":"2.0","id":0,"result":{"capabilities":{"textDocumentSync":2,"hoverProvider":true,"completionProvider":{"resolveProvider":true,"triggerCharacters":[".",":"]},"definitionProvider":true,"implementationProvider":true,"referencesProvider":true,"documentHighlightProvider":true,"documentSymbolProvider":true,"workspaceSymbolProvider":true,"codeActionProvider":true,"codeLensProvider":{"resolveProvider":false},"documentFormattingProvider":true,"documentRangeFormattingProvider":false,"renameProvider":true,"executeCommandProvider":{"commands":["rls.applySuggestion-29146","rls.deglobImports-29146"]}}}}Content-Length: 92 {"jsonrpc":"2.0","method":"window/progress","params":{"id":"progress_1","title":"Building"}}Content-Length: 104 {"jsonrpc":"2.0","method":"window/progress","params":{"done":true,"id":"progress_1","title":"Building"}}Content-Length: 92 {"jsonrpc":"2.0","method":"window/progress","params":{"id":"progress_0","title":"Indexing"}}Content-Length: 157 {"jsonrpc":"2.0","method":"window/showMessage","params":{"message":"Cargo failed: failed to parse manifest at `/home/alex/project/rls/Cargo.toml`","type":1}}Content-Length: 104 {"jsonrpc":"2.0","method":"window/progress","params":{"done":true,"id":"progress_0","title":"Indexing"}} --------------- failures: cmd_test_infer_bin test result: FAILED. 3 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out ``` Once you have this output it's fairly easy to see **Cargo failed: failed to parse manifest at `/home/alex/project/rls/Cargo.toml`**. The recent update (#1058) to the main Cargo.toml <s>is</s> was interfering with the cmd tests. And all this with ~100 lines net removed :) Co-authored-by: Alex Butler <[email protected]>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
cargo updateThe cmd tests aren't good enough because they don't fail very usefully. They either work or block for 300 seconds then say nothing. For example the build is currently failing in master, but can anyone see why?
The new code has
The
RlsHandle
now uses a thread to eagerly read stdout, and eprints that stdout when an assertion fails. This stdout allows us to debug the tests when they fail. To see the improvement here is the failure output of the tests with this change:Once you have this output it's fairly easy to see Cargo failed: failed to parse manifest at
/home/alex/project/rls/Cargo.toml
. The recent update (#1058) to the main Cargo.tomliswas interfering with the cmd tests.And all this with ~100 lines net removed :)