This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-02-06
Channels
- # announcements (2)
- # architecture (2)
- # aws (18)
- # babashka (7)
- # beginners (149)
- # bristol-clojurians (4)
- # calva (11)
- # chlorine-clover (1)
- # cider (8)
- # clj-kondo (2)
- # cljdoc (2)
- # cljsrn (2)
- # clojure (186)
- # clojure-canada (3)
- # clojure-europe (3)
- # clojure-gamedev (5)
- # clojure-italy (1)
- # clojure-nl (13)
- # clojure-norway (4)
- # clojure-spec (25)
- # clojure-uk (32)
- # clojurescript (75)
- # core-async (2)
- # cursive (16)
- # data-science (3)
- # datomic (20)
- # docker (1)
- # emacs (26)
- # fulcro (7)
- # graphql (1)
- # incanter (1)
- # leiningen (1)
- # luminus (7)
- # malli (7)
- # mount (11)
- # off-topic (19)
- # pathom (15)
- # re-frame (9)
- # reagent (9)
- # remote-jobs (4)
- # ring-swagger (4)
- # shadow-cljs (63)
- # spacemacs (11)
- # sql (2)
- # vscode (7)
in datomic cloud there is no possibility to do in-memory unit tests without a connection to the cloud instance?
there is a library which implements the client api against the peer api designed for testing, it’s name escapes me
Depending of your us-case, you can have to look to https://github.com/vvvvalvalval/datomock
@U11SJ6Q0K We wrote that library (I don't like the name but people started using it before we could change it haha). We really wanted to embrace the whole "test against the production system" but it's just too much of a pain. CI tests need to run the socks proxy to connect to the Datomic instance. IIRC, we never managed to get that set up in a stable way on CircleCI. It was almost there (again IIRC) but we needed to be able to control the hostname for the socks proxy. The Datomic team said they'd add it but that was 2 years ago or so. Further, you need a way to have developers create databases with the same name (e.g., "admin") but not trip over each other by transacting to the same database. You'll need to write something to handle that as well. You could have each dev run their own Datomic Cloud system but that gets unwieldy. If you're using Ions, you'll probably need to do that. Finally, the ability to test in memory is simply quite nice. I may not always have a stable internet connection (e.g., working in a cafe, on a plane, etc) and don't want to be blocked from developing. I wish the Datomic team would release an official in-memory implementation for testing. All that being said, we do run integration tests against the Datomic Cloud system.
yes, I really wish there was an in-memory impl for testing purposes as well... the socks proxy situation seems tricky to set up for ci
I don't see the database name as a problem though, your tests can always setup a unique name and we use $USER-dev
named databases for all developers
Yes, if you place all your data in a single database, the naming shouldn't be an issue.
that's a great idea. i'll confirm that the work is shareable and then hopefully follow up with a post.
@U11SJ6Q0K we've also had some success building and then testing against an in-memory datahike
database: https://github.com/replikativ/datahike
you won't be able to test things like Datomic query and transaction functions, but it's a fun idea and faster than querying a database value returned by d/with-db
. and of course it isn't "as real" as using Datomic itself.
Assuming I have the attribute :user/id
in my schema, is this a valid datomic/metaschema.edn
to generate a table?
{:tables {:user/id {}}}
I'm unable to see my table, although I can connect with my schema and catalog and can see the db__attrs
and db__idents
tables, and so the Troubleshooting docs suggest it's a problem with the metaschema itself. I've tried syncing and cycling my datomic-access
connection and presto connection with no luck.