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 runner #247

Closed
georgewfraser opened this issue Jan 20, 2014 · 18 comments
Closed

Test runner #247

georgewfraser opened this issue Jan 20, 2014 · 18 comments
Labels
new Marks issues describing new features released Marks issues which have had the fixes released in a stable build
Milestone

Comments

@georgewfraser
Copy link

It would be nice to just be able to run all the tests in the same way that lein test works. I find the repl-based test system:

  1. Requires lots of clicks. Tools -> REPL -> Run tests in current NS in REPL
  2. Provides no mechanism to run ALL tests, which is 90% of the time what I want to do.
  3. Fragile. Often I click "Run tests in current NS" and it runs 0 tests, and I have no idea why.

Perhaps I am failing to comprehend the way you are re-imagining test runners, but I end up just running lein test from the command line. It would be nice if cursive had a test runner that worked the same way as every other test runner.

@cursive-ide
Copy link
Owner

Yes, this is definitely on the roadmap. I'll hopefully get to this soon.

@rlewczuk
Copy link

+2 (see below)

I'm often reusing current REPL and I need to remember to restart it often. This results in inconsistent test results and bugs as REPL gets "dirty" over time (with previously declared symbols etc).

Test runner also should show as much error information as possible, including full stacks when errors occur, pretty much as plain old JUnit runner does. Ideally it should behave pretty closely to what Java runner does.

Having said that, I still like current REPL-based test integration as having REPL with all symbols loaded after unit test execution is very useful to me - so I'd like to have both modes available.

@georgewfraser
Copy link
Author

A bit of delayed follow-up: I've recently been using cursive's test integration a lot more and am finding it to be pretty good now that I have it figured out. I think you could do some really simple things to make it easier for users like me to figure it out:

  1. The test commands are too buried in Tools -> REPL -> CMD. Put them at top level in one of the menus.

  2. Pick some default keyboard shortcuts for 'run all tests in current ns' and 'run test under caret'. I had never added a custom keymap before, and probably a lot of other people are in the same boat.

  3. If the REPL isn't already started when the user asks to run the tests, start it automatically.

    Your test integration is a little unusual and I think these basic things would help users like me to figure it out.

@cursive-ide
Copy link
Owner

Thanks for the feedback, and I'm glad it's proving useful for you. It's definitely an unusual integration for an IntelliJ based product, but it's similar to what Emacs and other REPL-focused editors offer. It's definitely good for a particular use case (i.e. while working on a particular set of tests) but not so good for running everything. I have a bunch of improvements for this in the pipeline.

@pkozikow
Copy link

pkozikow commented Jun 3, 2014

+1

I found that adding (run-tests 'my-ns) to the end of a file with tests makes it possible to run the file as a clojure script . It would still be great to have native support.

@danielcompton
Copy link
Collaborator

This might be helpful for building a runner https://github.com/mikera/cljunit

@pkozikow
Copy link

Is this still on the roadmap? For us it would help a lot since we have many java classes tested in Clojure. The repl approach is not practical in this case since the repl needs to be reloaded every time the Java class being tested is changed.

@cursive-ide
Copy link
Owner

Yes, it is, and it's on the shortlist part of the roadmap.

@Misophistful
Copy link

My team and I are really missing not having a test runner in Cursive. lein test works, but it's a pain to view the results and navigate to the code that's causing the issue.

We were wondering if the test runner feature is getting closer to the top of your backlog?

@mikkoronkkomaki
Copy link

Is there any hope of getting a test runner into Cursive in the foreseeable future? Our team also would greatly appreciate this feature. We managed to go around this by using test2junit to generate a html document of the test results, but this still is very cumbersome. Having a runner being able to run all tests in a single project and viewing their outcome in a single report would be really handy.

@russellwstanley
Copy link

russellwstanley commented Nov 15, 2018

Would be great to see this as running tests in the REPL is not a reliable process because the REPL holds on to a bunch of state between test runs (defs, classes etc) and you have to remember to constantly clean and refresh it.

@wmatson
Copy link

wmatson commented Apr 26, 2019

Might be possible to use/integrate kaocha which can report results as junit xml

@sooheon
Copy link

sooheon commented Oct 5, 2019

Kaocha JUnit XML integration: https://github.com/lambdaisland/kaocha-junit-xml

@aneilbaboo
Copy link

Is there an ETA on this? It would be really useful.

@rutchkiwi
Copy link

Ohh @cursive-ide does the close mean this is coming? Exciting if so

@cursive-ide
Copy link
Owner

@rutchkiwi Yes indeed! It should be out soon.

@cursive-ide cursive-ide added this to the 1.10.0 milestone Dec 2, 2020
@cursive-ide cursive-ide added the new Marks issues describing new features label Dec 2, 2020
@cursive-ide cursive-ide modified the milestones: 1.10.0, 1.10.0-eap1 Dec 2, 2020
@aneilbaboo
Copy link

Hi @cursive-ide - What happened to this one? It was tracked by the 1.10.0-eap1 milestone, but never got delivered.

@cursive-ide
Copy link
Owner

@aneilbaboo Yes, this has been in for a while now. See: https://cursive-ide.com/userguide/testing.html#test-runner.

@cursive-ide cursive-ide added the released Marks issues which have had the fixes released in a stable build label Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new Marks issues describing new features released Marks issues which have had the fixes released in a stable build
Projects
None yet
Development

No branches or pull requests