regen-ledger icon indicating copy to clipboard operation
regen-ledger copied to clipboard

Guidelines for writing gherkin/gocuke acceptance tests

Open ryanchristo opened this issue 2 years ago • 6 comments

Summary

Related Issues: #711, #893, #894, #895, #896

We decided to use gherkin/gocuke for basic message validation and message server methods and we intend to use them in a BDD-style development approach where we would write gherkin feature files after or alongside writing protobuf definitions and before implementing new features and writing the corresponding gocuke tests.

Once we finish migrating existing tests, we should review the feature files and corresponding tests and document best practices. The guidelines could either be added to the contributing guidelines or they could live in a separate document.


For Admin Use

  • [ ] Not duplicate issue
  • [ ] Appropriate labels applied
  • [ ] Appropriate contributors tagged
  • [ ] Contributor assigned/self-assigned

ryanchristo avatar Jul 06 '22 21:07 ryanchristo

Question for tracking. Whether to mock strings when checking max length and how so. https://github.com/regen-network/regen-ledger/pull/1231#discussion_r915249764

ryanchristo avatar Jul 12 '22 16:07 ryanchristo

Question for tracking. When to refer to "user" or "signer" and when to refer to field name. https://github.com/regen-network/regen-ledger/pull/1251#discussion_r918494033

ryanchristo avatar Jul 12 '22 16:07 ryanchristo

Question for tracking. Whether each event should tested within its own scenario. https://github.com/regen-network/regen-ledger/pull/1394#discussion_r953328840

ryanchristo avatar Aug 24 '22 04:08 ryanchristo

Question for tracking. Whether basic message validation and other type methods (i.e. sign bytes) should be grouped in the same file. Also, should valid sign bytes be included at the top of the file alongside valid cases for basic message validation?

https://github.com/regen-network/regen-ledger/pull/1516#pullrequestreview-1145736042

ryanchristo avatar Oct 18 '22 12:10 ryanchristo

Would love to get updates on your current approach @ryanchristo.

Why does sign bytes need testing? Because of amino issues?

Ultimately validate basic is just part of the msg feature so maybe doesn't need to be separate

aaronc avatar Oct 18 '22 12:10 aaronc

Why does sign bytes need testing? Because of amino issues?

Looks like they are being added to ensure we have amino signing support configured. :+1:

ryanchristo avatar Oct 18 '22 13:10 ryanchristo