-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
feat(orm): gRPC codes for save errors #11386
Conversation
@@ -9,22 +9,29 @@ require ( | |||
github.com/golang/mock v1.6.0 | |||
github.com/google/go-cmp v0.5.7 | |||
github.com/iancoleman/strcase v0.2.0 | |||
github.com/regen-network/gocuke v0.6.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't introduce new testing frameworks to the project.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no reason for it. Everything here is equally well expressed as conventional table-based Go unit tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Each new dependency added to go.mod
must be default deny. The onus is on the author to justify its value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The goal is readability. We've decided internally to try this type of testable documentation. If it doesn't provide value, we won't continue with it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be useful to get an ADR on testing up and which way things are going. We all understand there is an issue with testing in the cosmos-sdk that leads to messed up ci pipelines and not having full coverage.
I thought there was agreement on this from the Regen side, but seems there are conflicting opinions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have clearly misunderstood the purpose of PRs in this project. My apologies. I'll refrain from commenting or contributing any further.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- https://github.com/regen-network/gocuke is a repo of 62 (non-reviewed?) commits by Aaron. If we add this to the SDK, we need to reduce the bus factor first audit it (or at least understand it).
Folks on the regen ledger side have looked into this more and that is where our devs are more aligned around this approach @marbar3778. We can prepare something a bit more formal if that helps. Although the reality is we don't usually do too thorough of an audit of 3rd party test dependencies as is...
- The acceptance tests should test that code matches spec, where "spec" is generally an agreed-upon document in English language. We don't have this doc yet for ORM (Marko and I will try to work with Aaron on that), it seems now that these tests almost are the spec itself, is that what BDD precognizes?
That's the point. There is no English language spec. That's precisely what this introduces
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@marbar3778 let's continue discussion in #11356. This has two approvals but I will hold off on merging until I get your approval @AmauryM. Will be in touch with both of you around how we want to move forward
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the matter of the fact: most of the Cosmos SDK tests are not readable. Cucumber style tests are way more readable (few orders of magnitude +1).
Codecov Report
@@ Coverage Diff @@
## master #11386 +/- ##
==========================================
- Coverage 66.03% 65.99% -0.05%
==========================================
Files 719 713 -6
Lines 73920 72871 -1049
==========================================
- Hits 48813 48091 -722
+ Misses 22053 21807 -246
+ Partials 3054 2973 -81
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving an putting automerge! Let's 🥒
I think the english spec -> acceptance tests -> code process is too optimistic, and I agree with Aaron we've been more doing in practice in the past months: code -> tests -> spec/ADR. Probably gocuke will help here with the latter process.
I think this PR a good case study to see if it's useful. I still have doubts about gocuke, i'll need to see it more in action. But I also encourage other people to give feedback. The ideal feedback would be from users of the ORM (once we release it). If it's useful to them, then it's a win. If not, then let's discuss again.
Description
Ref: #11088. First PR of several to add gRPC error codes and make sure that errors are a well-defined part of the API.
Also introduces Cucumber-style BDD acceptance tests into the SDK via https://github.com/regen-network/gocuke.
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
to the type prefix if API or client breaking changeCHANGELOG.md
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...
!
in the type prefix if API or client breaking change