Repository navigation
Fix test runs that hang, misplace errors or pass with no tests - #29
Merged
Merged
Conversation
cider-nrepl's test-var-query, asked to load the project's namespaces, never answers when one of them doesn't load: orchard's namespace query throws a NullPointerException, which gets past the op without a done. So neorepl test, or the MCP test tool, without names waited for good. With cider-nrepl, neorepl now loads the project's namespaces itself first, the ones orchard finds, in a copy of the session, says which don't load and why, and has test-var-query run the loaded ones. A namespace that threw while loading is gone, but loaded as far as require goes, its ns form having said so, so a second run quietly left it out. Both that load and the one of the namespaces named now reload such a namespace, which says why again, and the latter's error says which namespaces it was loading, rather than that the server couldn't do eval.
cider-nrepl gives a test error the file of the frame that threw, and the test's line, so ERROR in demo.core-test/erroring-test (Numbers.java:9) pointed nowhere. babashka gives every failure whichever file the session loaded last, so after neorepl load they all pointed at that. From the test ops, errors now take their test's file, and on babashka every failure does. clojure.test's own report, without the test ops, has an error's file and line from the same frame, so it stays as it is.
--timeout applied to each step of a run on its own, the loading of the tests, the run and the stack traces of its errors, so a run could take several times as long, and a timeout while loading the tests came out as a connection problem, exit 3. One deadline now covers it all, evaluate taking it as :deadline, and running out while loading says so and exits 124. The stack traces get a second at least, so a run that ends near the deadline still has them.
neorepl test of a namespace without tests, like the namespace under test rather than its tests', printed No tests ran and exited 0, which reads as everything passing. It now says there are no tests in it and exits 1, unless a fixture failed before any test ran, which reports that instead.
The headings of test failures had absolute paths, long enough to wrap, for files that are in the project neorepl runs in. They're relative to that directory now, as editors and compilers write them, in text output only.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
A whole-project
neorepl testwith cider-nrepl waited forever when a project namespace didn't load: orchard's namespace query throws an NPE that never reaches adone. neorepl now loads the project's namespaces itself first, through orchard, and says which ones don't load. The real fix belongs in cider-nrepl, and it's noted in PLAN.md's open questions.The other commits place test errors at the test rather than in
Numbers.java, give a run a single timeout that covers loading the tests, fail a run of a namespace that has no tests, and show failure paths relative to the project.