Closed sundarlogan closed 9 months ago
Hi @kerrykimbrough Can you pls. help me with this. Is there any workaround to try?
Hi, Sundaravel, thanks for reporting this issue. I'm investigating now.
This problem is caused by a defect in the algorithm for creating a failure case using a petPrice
value that is not a multiple of 0.01. Look for a fix soon.
Meanwhile, you can work around the problem with a change to the schema for petPrice
: define a maximum
or minimum
value with more than 2 fractional digits. For example: "maximum": 0.123
.
Thank you @kerrykimbrough will try & use this work around..
Fixed in version 4.0.3
@kerrykimbrough This fix works, able to generate tests with multipleOf.
But, when we add minimum & maximum values with multipleOf - facing issue (It keeps loading - test not generated) Any one - minimum or maximum with multipleOf, it works.
Updated OpenAPI Spec File -- petstore-multipleOf-updated.json
But, when we add minimum & maximum values with multipleOf - facing issue (It keeps loading - test not generated)
I can't reproduce this problem. Which version of Tcases are you using?
@kerrykimbrough Apologies, attached the wrong sample file. Can you pls. check with this file - payment-multipleOf-updated.json Using latest tcases version 4.0.4
Here's the problem. When a numeric schema specifies both minimum
and maximum
(i.e. a bounded range), Tcases calculates the number of possible multiples within the range. (This is for the purpose of checking consistency with other schema constraints.) But in your example, because the maximum
is so large, the number of possible multiples is enormous. Tcases isn't stuck -- it's just taking a really, really, really long time to count up all the multiples.
For now, you can work around the problem by using a smaller maximum
. Meanwhile, I'm investigating a change to speed up the counting.
Fixed in release 4.0.5
Tcases Version: 4.0.2 OpenAPI Version: 3.0.0 OpenAPI Spec File: Attached petstore-multipleOf.json
Tried to generate Junit / TestNG API tests directly from the OpenAPI spec file using the Tcases cli cmd
tcases-api-test -t=testng -p=test.petstore.testng ./Documents/petstore-multipleof.json
and also via maven goalmvn tcases:api-test
. It keeps loading - test not generated. If we remove/commentmultipleOf
in OpenAPI spec file *RequestsTest (Junit/TestNG) are generated.