[Erlang] add PropEr (property-based testing tool) support#1102
[Erlang] add PropEr (property-based testing tool) support#1102wing328 merged 10 commits intoOpenAPITools:masterfrom jfacorro:erlang-proper
Conversation
|
Copying the technical comittee @tsloughter |
|
This is great. Will take me a little bit to fully go over the patch but since it is just adding test code and not touching the generated logic it should be no problem. |
There was a problem hiding this comment.
-
Please use
{{{baseName}}}instead of{{baseName}}to avoid special HTML characters being escaped. -
Instead of "Body1", what about naming it as "LocalVarHttpBody"?
There was a problem hiding this comment.
Thank you for the comments.
- Fixed.
- Regarding your suggestion I would rather have a short name like
Body, I think it's closer to the Erlang style, so I renamedBody1to justBodysince the number suffix didn't make any sense.
There was a problem hiding this comment.
Used to generate PropEr generators for property-based testing
|
I guess my only question is, shouldn't this be an option on the existing Erlang generator instead of a new one? |
|
@tsloughter very good question. I think depending on similarity. Personally, I prefer adding an option if the templates are similar with minor differences. |
|
When I ran |
|
@jfacorro can you add the nowarn on export all? And can the statem go in a test or eqc directory? |
@tsloughter I thought about this but decided against it. This is because the templates get unreadable very fast when there are several conditions involved. Having different generators also gives us the freedom to evolve them separately. The HTTP client part in the
@wing328 @tsloughter I added the
@tsloughter Why do you think it would be better to put the statem in a |
|
@jfacorro thanks for the update. @tsloughter please have another look If no further question/feedback, I'll merge it on the coming weekend. |
|
@jfacorro PR merged into master. Thanks for your contribution. I've sent out a tweet to proper the enhancement: https://twitter.com/oas_generator/status/1056109614494666752 |
|
@jfacorro thanks for the PR, which is included in the v3.3.2 release: https://twitter.com/oas_generator/status/1057649626101112832 |
* Generator erlang-proper Used to generate PropEr generators for property-based testing * Fix binary/2 implementation. Add behaviour attribute. * Remove line from copyright notice * Avoid escpaing HTML and remove suffix from variable name * Update samples * Include querystring parameters * We use export_all, don't consider warnings as errors * List command sequence on failure * Use hasConsumes instead * Add nowarn_export_all, re-add warning_as_errors
Used to generate PropEr generators for property-based testing
PR checklist
./bin/to update Petstore sample so that CIs can verify the change. (For instance, only need to run./bin/{LANG}-petstore.shand./bin/security/{LANG}-petstore.shif updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in.\bin\windows\.master,3.3.x,4.0.x. Default:master.Description of the PR
Creates an Erlang project that can be used to perform property-based testing using the PropEr library. The project includes a client where the request body is generated from the OpenAPI specification.