proto-repl icon indicating copy to clipboard operation
proto-repl copied to clipboard

test shortcuts

Open kwladyka opened this issue 7 years ago • 3 comments

  'cmd-alt-x': 'proto-repl:run-tests-in-namespace'
  'cmd-alt-t': 'proto-repl:run-test-under-cursor'
  'cmd-alt-a': 'proto-repl:run-all-tests'

cmd-alt-x doesn't work. It run tests in current NS in REPL not in current file namepsace :( cmd-alt-t this doesn't work at all. No idea where should be my cursor... cmd-alt-a this one run also test from dependencies...

Please make stable some solution to run tests for all test in project like lein test and run tests for current file. This are two basic test shortcut.

kwladyka avatar Dec 16 '16 23:12 kwladyka

Maybe the cmd-alt-x is having problems determining the current namespace. It's just running (clojure.test/run-tests) in the current namespace. Does executing code from that file work as well?

Cmd-alt-t will run the test if you place the cursor within the name of a test var. ie (deftest this-is-the-test-var-name ...) I think there could be some better ways to pick the test to run.

Cmd-alt-a runs all the tests by running (clojure.test/run-all-tests) so it's running whatever that finds. Note that this usually doesn't run any tests in libraries because the library tests are not packaged with a library. It's just printing the names of all namespaces including ones which don't have tests. (Unless it's behaving differently than I've seen it run before.) I think this could be improved to only specifically run the tests in your current project.

The testing capabilities could be improved but they do all work. I work with a team of people who use them every day. I'm leaving this issue open as a place holder for improving them.

jasongilman avatar Dec 17 '16 04:12 jasongilman

cmd-alt-x Yes but the current namespace is:

Testing user

Ran 0 tests containing 0 assertions.
0 failures, 0 errors.

Sometimes it is different namespace. Just like that, i don't see the pattern but never the namespace which i want :) I assume it should be the namespace equal to file which i have open in the moment of press shortcut.

cmd-alt-t

ompilerException java.lang.RuntimeException: Unable to resolve var: labels-spec-test in this context, compiling:(/private/var/folders/ck/4mk4vrzn3wx7fk32bm7076jh0000gn/T/form-init6144189534993796370.clj:1:5) 

Always can't find.

cmd-alt-a Yes it will be nice. It is very confuse to see all that namespace.

Hmm but it is strange... it detects two of my namespaces but not all and don't run tests for them while lein test do it. Am i doing something wrong?

kwladyka avatar Dec 17 '16 10:12 kwladyka

It's always possible that your project may be setup differently somehow. Can you try running tests in the Proto REPL demo project? You should be able to run individual tests there. That will help determine where the problem is.

Sent from my phone

On Dec 17, 2016, at 5:41 AM, Krzysztof Władyka [email protected] wrote:

cmd-alt-x Yes but the current namespace is:

Testing user

Ran 0 tests containing 0 assertions. 0 failures, 0 errors. Sometimes it is different namespace. Just like that, i don't see the pattern but never the namespace which i want :)

cmd-alt-t

ompilerException java.lang.RuntimeException: Unable to resolve var: labels-spec-test in this context, compiling:(/private/var/folders/ck/4mk4vrzn3wx7fk32bm7076jh0000gn/T/form-init6144189534993796370.clj:1:5) Always can't find.

cmd-alt-a Yes it will be nice. It is very confuse to see all that namespace.

Hmm but it is strange... it detects two of my namespaces but not all and don't run tests for them while lein test do it. Am i doing something wrong?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

jasongilman avatar Dec 17 '16 14:12 jasongilman

not active

kwladyka avatar Nov 01 '22 21:11 kwladyka