Improve integration tests diagnostics on error #3285
Merged
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.
cc'ing @benjamin-asdf
Hi,
could you please review follow up patch to #3274 to improve on the integration tests diagnostics on error
Changelog
eval-err
when expecting a response from the server.Currently there is a break in the jack-in shadow-cljs test due to #3282 that is very terse saying that the test timedout waiting for a response from the server.
this by itself does not provide much information on the error, we need more context. Thus the first change this patch introduces is to also poll for eval errors, which gives now back the following:
This means the nREPL server could not resolve the
*clojurescript-version*
variable that it requested to evaluate earlier with(cider-interactive-eval "(print :cljs? (some? *clojurescript-version*))" ;; ...
.The shadow repl starts it life as a
clj
REPL and then switches tocljs
. In the test we first wati for the REPL to switch tocljs
with(cider-itu-poll-until (cider-repls 'cljs nil) 120)
(i.e. polling for up to 120secs until it can retrieve the cljs repl or erroring out otherwise), and only then issue the above interactive-eval command. Thus the eval command should have worked, cider already indicated that we got a cljs repl, why is it failing then?The second change this patch introduces is to enable nREPL message logging and dump all buffers on test failure, so that the author can get more context on why things might have failed. Looking now at the nREPL tracing log produced, we can observe that the nREPL server is still reporting that the
repl-type
isclj
but the test still went ahead and evaluated the probe command:This suggests that
(cider-repls 'cljs nil)
has falsy reported that there is acljs
repl available, but is not (it is still aclj
repl). I haven't look at #3282 yet, but does it force CIDER to believe that the REPL is acljs
repl while it has not switched in reality yet fromclj
tocljs
?Nevertheless, could you please consider merging the improved diagnostics. Thanks
- [ ] You've added tests (if possible) to cover your change(s)eldev test
)eldev lint
) which is based onelisp-lint
and includescheckdoc
, check-declare, packaging metadata, indentation, and trailing whitespace checks.- [ ] You've updated the changelog (if adding/changing user-visible functionality)- [ ] You've updated the user manual (if adding/changing user-visible functionality)