This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # adventofcode (106)
- # aleph (1)
- # announcements (1)
- # asami (14)
- # babashka (120)
- # beginners (54)
- # calva (106)
- # chlorine-clover (33)
- # clj-kondo (5)
- # cljdoc (3)
- # cljs-dev (3)
- # clojure (92)
- # clojure-android (1)
- # clojure-australia (2)
- # clojure-europe (24)
- # clojure-italy (3)
- # clojure-nl (5)
- # clojure-uk (16)
- # clojuredesign-podcast (1)
- # clojurescript (29)
- # code-reviews (58)
- # conjure (16)
- # core-logic (4)
- # cursive (9)
- # datalevin (2)
- # graphql (20)
- # gratitude (7)
- # jackdaw (11)
- # java (9)
- # jobs (2)
- # lsp (23)
- # minecraft (1)
- # missionary (28)
- # off-topic (5)
- # polylith (5)
- # react (1)
- # reagent (12)
- # releases (1)
- # remote-jobs (4)
- # reveal (7)
- # shadow-cljs (8)
- # slack-help (1)
- # tools-deps (11)
- # vim (6)
I've noticed that when I try to run tests with clover, they aren't able to be run if they're tagged with `^:integration`. They work when I remove that keyword, but this is a new-to-me codebase so I'll be running into the issue fairly frequently, I think. I'm using Sean's vscode/clover setup pasted above, and am using the built-in clover runner. Is there anything I can do besides just removing that tag when I want to run a given test?
What about running them from a REPL, outside of the editor? Just require
clojure.test and one of the test namespaces that you're having problems with and eval
The "built-in Clover runner" is just
clojure.test/run-tests and metadata on tests is ignored by that. So I think something else must be happening here.
(and I just tried the above in a scratch project and the tests marked
^:integration run as expected -- and also run via Clover -- so I suspect this is something peculiar to your codebase, perhaps in the fixtures?)
Yeah, I think you're right. Running via the repl as you suggested worked as expected
@mschmele can you run the same command that you ran in the REPL inside Clover, and see if it still fails?
okay that worked, both when I tried using the command palate and the
ctrl-; x hotkey
When I try to run them individually it seems to work via command palate, but not via the
ctrl-; t hotkey. It fails with this popup, and the
(:meta 2 "s") output mentioned above
Oh, maybe your position/selection is over the metadata. That will make Clover detect
^:integration as the var you want to run, and that will not work. Try to select the var you want to run tests, or just keep the cursor over the var, and see if it works
Ah! Yes, you can't run the current test via
ctrl-; t if it has metadata.
(p/let [block (editor/get-top-block) test-name (when (seq (:text block)) (clojure.string/replace (:text block) #"\(def[a-z]* ([^\s]*)[^]*" "$1")) here (editor/get-selection)]
replace call isn't smart enough to know how to remove the metadata prior to the test name.
I didn't realize you were trying to run a specific test.
I don't remember what that
[^]* is for at the end of the regex? I suspect it matches "everything" including newlines...
So I guess it needs an optional match for one or more metadata tags there...
#"\(def[a-z]* (\^:[-a-z]* )* ([^\s]*)[^]*" and then
"$2" is probably what it needs there?
Hmm, that's not quite right... just a sec...
Ahhh, yeah sorry if I wasn't being 100% clear - I have a bad habit of leaving details out that I just assume people will know
That looks to be the culprit, though! It seems to not be an issue when running tests for an entire namespace, so at the very least I'm happy enough knowing that tests aren't being left out when I'm running a larger batch
OK, get the updated version of
config.cljs from GitHub (and reload VS Code).
Wow you're fast! I was just about to say that I'll probably have time to try to issue a fix tomorrow
I just tested the updated version locally so I think it should be good to go now.
I think you don't need to reload VSCode to apply the latests versions from
If you do, it's probably a bug 😄
@mauricio.szabo You don't need to reload Atom, but you do need to reload VS Code in my experience.
Then I'll look at it - seems like a bug (saving the file should work by unloading the latest custom commands and loading the new ones). I'll create an issue to track it
It's never worked automatically for me -- and I'm pretty sure you said early on that VS Code needed a reload? I just tried it and it definitely doesn't work for me.
(but it's rare that I modify
config.cljs at this point so it's not a big deal)