tape icon indicating copy to clipboard operation
tape copied to clipboard

Support for complex (struct) arguments

Open Nova38 opened this issue 11 months ago • 6 comments

Is your proposal related to a problem?

Currently the config file only allows for the arguments to be of the following types: uuid, randomString$length, randomNumberA_B. However chain codes can also take structs as the arguments instead for using just a list of variables. I have found that using structs instead of positionall arguments is a bit more reliable way to prevent errors when passing parameters.

Describe the solution you'd like

Allow for parameters to take the shape of a yaml object using the same random types to populate the fields

Describe alternatives you've considered

I currently am using hyperledger caliper as its workflows supports arbitrary parameters types

Nova38 avatar Mar 16 '24 22:03 Nova38

tape uses golang language, hence is there any go library which supports arbitrary parameters types? fuzz?

SamYuan1990 avatar Mar 17 '24 08:03 SamYuan1990

but how to define the structure in yaml and make golang auto generate the random value via fuzz? or we want the value in a specific range or ... some thing to make the test meaningful?

SamYuan1990 avatar Mar 17 '24 08:03 SamYuan1990

@Nova38 , could you please try with comments at https://github.com/hyperledger/fabric-chaincode-go/issues/101#issuecomment-2003731587 ?

SamYuan1990 avatar Mar 18 '24 12:03 SamYuan1990

@Nova38 , as tape support json format of input https://github.com/Hyperledger-TWGC/tape/blob/master/pkg/infra/trafficGenerator/proposal_test.go#L47 , please help a try and feedback.

SamYuan1990 avatar Mar 23 '24 03:03 SamYuan1990

Fantastic thank you! I will try it out this week

Nova38 avatar Mar 24 '24 21:03 Nova38

Fantastic thank you! I will try it out this week

hi @Nova38 , any feedback or result?

SamYuan1990 avatar Mar 30 '24 05:03 SamYuan1990