-
Notifications
You must be signed in to change notification settings - Fork 18
franken gen #93
base: develop
Are you sure you want to change the base?
franken gen #93
Conversation
Release 2.1.0
`franken-gen` is an interation on `spec-gen`, schemas and queries from spec-gen are fully backwards compatible. - Add support for malli and test.check.generators. - Dynamically load builtin generation functions. (if you don't need it then you don't have to include the dependency for it.) - Add ability to override the entity generation in the query - Regarding the name, I called it `franken-gen` because it stitches together different generation mechanisms, and it leans away from the "spec" and into the "monstah" motif. I am open to alternatives though.
I haven't looked at this in detail yet but this but from the description most of these are supported in the work I've done at https://github.com/donut-power/datapotato . I think only Would you like to look at datapotato together some time? |
d5cafe0
to
b05de2e
Compare
BTW I think it's really cool that you're looking at these issues! I'm just hoping we don't end up with duplicated effort |
b05de2e
to
1fa6418
Compare
Thanks, I'm struggling with boot at the moment. it's giving me a strange error that I think is related to being on an M1 mac. And that error on the CI seems like how I'm doing the dynamic loading might not work with clojurescript. I'll read through datapotato, I was hoping for something backwards compatible with spec-gen because I need to add it to a code base that already uses that :P |
It’s actually backwards compatible :) wouldn’t want to leave y’all high and dry
|
Also, datapotato doesn’t use boot, it’s just deps. The only change you’d need to make would be changing the required namespace
|
afcb798
to
a6d1aff
Compare
a6d1aff
to
93c7d8e
Compare
I like datapotato, I like the next.jdbc integration, I like the improved data generations, a few issues though, I would have to go through the whole codebase and replace This PR can be like a drop-in enhancement for spec-gen, which is really what we need for the task at hand. I appreciate you taking the time to help me; If you'd rather put your focus towards datapotato rather than this repo, I would completely understand, and we could take it from here. New pushed changes:
|
@mitchkyle-reify I think it would be really useful to get on a zoom about this. How would you feel about that? I'm not sure I understand the issue you're running into when you mention having an entity with Also, I get wanting to move forward with this so that you can meet your needs and move on. I'd like to chat about that more. If zoom doesn't work I'll try to put my thoughts together here. I'm nonrecursive on Clojurians slack, and [email protected] if you'd like to get in touch |
OK I think I see what you mean about (dc/generate potato-db {:todo [[:_ {:generate {:set {:todo-title "..."}}}]]} You can also specify other (deftest specify-generate-in-query
(testing "can specify generate options in query terms"
(let [gen (dc/generate
{:schema spec-schema
:generate {:generator spec-generator}}
{:todo-list [[1 {:generate {:schema [:map
[:id ID]
[:created-by-id ID]
[:title [:enum "todo list title"]]]
:generator malli-generator}}]]})]
(is (= "todo list title"
(get-in gen [:tl0 :title])))))) I've also addressed the |
This PR is being flagged as STALE because it has not had recent activity in the last 60 days. It will be closed if no further activity occurs in the next 14 days. If you believe this repo should be excluded from this process, please add the repo to this list. |
franken-gen
is an iteration onspec-gen
, schemas and queries from spec-gen are fully backwards compatible.Features:
:spec-gen
to:set
to make the intention more clear. the:spec-gen
key is still accepted for backwards compatibilityWhat do we think of this approach? I know it changes the intentions for visiting a bit but I think it makes using specmonstah for generating data more intuitive. Regarding the name, I called it
franken-gen
because it stitches together different generation mechanisms, and it leans away from the "spec" and into the "monstah" motif. I am open to alternatives though.PS: Some changes that are in master related to the release are included in this PR.