This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-08-02
Channels
- # admin-announcements (3)
- # architecture (5)
- # beginners (10)
- # boot (223)
- # cider (13)
- # cljsjs (2)
- # cljsrn (50)
- # clojure (208)
- # clojure-austin (16)
- # clojure-belgium (1)
- # clojure-india (1)
- # clojure-poland (13)
- # clojure-russia (130)
- # clojure-spec (27)
- # clojure-uk (144)
- # clojurescript (135)
- # css (2)
- # cursive (10)
- # datavis (1)
- # datomic (29)
- # dirac (9)
- # funcool (2)
- # hoplon (41)
- # jobs (3)
- # leiningen (6)
- # om (37)
- # onyx (20)
- # pedestal (1)
- # planck (1)
- # proton (4)
- # re-frame (45)
- # reagent (17)
- # rethinkdb (16)
- # ring-swagger (19)
- # schema (5)
- # specter (93)
- # sql (16)
- # test-check (33)
- # untangled (7)
@gfredericks: I don’t know if you’re interested in adding me as a contributor to schpec, but I’d be happy to add e.g. CI and review PRs.
excl-keys PR is up: https://github.com/gfredericks/schpec/pull/6
@lvh that'd be cool
is there a test runner for specs now? the documentation for fdef
references clojure.spec.test/run-tests
but I can't seem to find that function
@jstokes: The short answer is "no". Rich has talked about this on the mailing list and in the Cognicast and it sounds like they want clojure.spec
to be test tool neutral. You can already use it with clojure.test
, Expectations
, etc however you want so you can use your existing test runner setup if you want. But clojure.spec
is kind of different to regular tests...
...you may well want to (instrument)
your application while running your normal test suite or even while just developing...
...but generative tests don't always fit in with fast-running "unit" style tests so you probably don't want to just run those in amongst your regular tests.
@seancorfield: thanks! that makes a lot of sense
i noticed that some of my specs do take a while to run, so probably dont want that included in my normal cider-test
workflow
What I’ve always wanted with test.check is a nice way to run the generative tests as part of the usual unit-test suite, but with a much smaller number of tests. And then run them separately with the full deal.
@glv: you can use times
and use an env var to change from the default : https://github.com/gfredericks/test.chuck/blob/master/src/com/gfredericks/test/chuck.cljc
how would you use test.chuck with specs? clojure.spec.test/check
returns the check results, not something you can plug in to defspec
, right?
you'd probably reimplement something similar that passes num-tests to clojure.spec.test/check
something like that could be added to schpec
I’m writing stuff that produces (s/and …)
specs and generates a pred for it; I’d like to make the error message more useful. Right now it just says something silly like:
{:clojure.spec/problems
({:path [:test-schema.root/item-0],
:pred (subset? (set (keys %)) all-props),
:val {:a 1},
:via [:test-schema/root :test-schema.root/item-1],
:in []})}
all-props
is a set. It’d be much more useful if it showed the actual set. s/and
inspects the form, so I can’t quite figure out how to do that — eval doesn’t quite work because then you get the ugly syntax-quoted formwhy does def
work here even though it's excluded in the ns form? https://github.com/clojure/clojure/blob/d920ada9fab7e9b8342d28d8295a600a814c1d8a/src/clj/clojure/spec.clj#L10-L19
bsima: def
is a special form, you can't exclude it
not that I know of
exclude is silent when the thing doesn't exist