Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Render example objects from any high level compatible model #162

Merged
merged 17 commits into from
Sep 1, 2023

Conversation

daveshanley
Copy link
Member

@daveshanley daveshanley commented Aug 26, 2023

Any object that supports Example or Examples and contains a Schema can be rendered into a Mock object.

By default, it will try to use existing example values. If that can't be found - it will generate random data using the available type, format, and pattern properties defined in a schema.

Will address feature request #107
It also addresses issue #156. There are a couple of minor race conditions being hit, and they have been remedied with a few tweaks.

@daveshanley daveshanley mentioned this pull request Aug 28, 2023
It seems to be crashing / hanging the runner.

Signed-off-by: Quobix <[email protected]>
@codecov
Copy link

codecov bot commented Aug 28, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (9daaecc) 99.79% compared to head (c9c0183) 99.80%.

Additional details and impacted files
@@           Coverage Diff            @@
##             main     #162    +/-   ##
========================================
  Coverage   99.79%   99.80%            
========================================
  Files         146      148     +2     
  Lines       10405    10619   +214     
========================================
+ Hits        10384    10598   +214     
  Misses         21       21            
Flag Coverage Δ
unittests 99.80% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
datamodel/high/shared.go 100.00% <ø> (ø)
datamodel/low/v2/definitions.go 100.00% <100.00%> (ø)
renderer/mock_generator.go 100.00% <100.00%> (ø)
renderer/schema_renderer.go 100.00% <100.00%> (ø)
what-changed/model/comparison_functions.go 99.42% <100.00%> (+<0.01%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@daveshanley daveshanley changed the title Render example objects from any high level Schema #107 Render example objects from any high level compatible model #107 Aug 29, 2023
Noticed that I had missed something in the burgershop. Now that we can ‘see’ the spec, it’s going to open up a whole ton of new capabilities.

Signed-off-by: Quobix <[email protected]>
@daveshanley daveshanley marked this pull request as ready for review August 30, 2023 10:34
makes more sense when using as an API.

Signed-off-by: Quobix <[email protected]>
@daveshanley daveshanley changed the title Render example objects from any high level compatible model #107 Render example objects from any high level compatible model Aug 30, 2023
@daveshanley daveshanley merged commit 1795bb5 into main Sep 1, 2023
3 checks passed
@daveshanley daveshanley deleted the v0.10.1 branch November 26, 2023 02:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant