Skip to content
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

Adds the e2e test suite framework and a bit over 80 test scenarios #1514

Merged
merged 22 commits into from
Jan 25, 2023

Conversation

iajrz
Copy link
Contributor

@iajrz iajrz commented Dec 12, 2022

This PR has both Go code and a cucumber test suite in gherkin; I'd expect @Olshansk to look at the go side of the matter and @emedrano2112 and @AneudyM to look at the gherkin side of the matter.

Fixes #1482

Co-authored-by: Daniel Olshansky [email protected]

@jessicadaugherty jessicadaugherty added the enhancement New feature or request label Dec 14, 2022
Copy link
Member

@Olshansk Olshansk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@iajrz I've still got a long way to go (see screenshot) but figured I'd publish what I have so far so we can start working in parallel as I continue.

Screenshot 2022-12-13 at 10 10 45 PM

e2e/launcher/configuration.go Outdated Show resolved Hide resolved
e2e/launcher/configuration.go Outdated Show resolved Hide resolved
e2e/launcher/configuration.go Show resolved Hide resolved
e2e/launcher/network.go Show resolved Hide resolved
e2e/launcher/network.go Outdated Show resolved Hide resolved
e2e/launcher/pocketclient.go Outdated Show resolved Hide resolved
e2e/launcher/pocketclient.go Outdated Show resolved Hide resolved
e2e/launcher/pocketserver.go Outdated Show resolved Hide resolved
e2e/launcher/pocketserver.go Outdated Show resolved Hide resolved
e2e/launcher/pocketserver.go Outdated Show resolved Hide resolved
spacing consistency

Co-authored-by: Daniel Olshansky <[email protected]>
@Olshansk
Copy link
Member

@iajrz I'll continue reviewing once the existing comments are resolved or Once the existing comments are resolved or tended

e2e/tests/query.feature Show resolved Hide resolved
I am pretty uncomfortable about the semantics of this code; I end up declaring a ton of `err` variables for no reason other than they are the second parameter, and the first one needs to be created.

The tendency towards being terse is fighting the common code structuring patterns and the semantics in a royal rumble where the winner gets to still not be satisfactory, so I'll just keep this in a recognizable style and  call it quits until a guiding principle can show up and help us never face such mixed solutions of sometimes creating and sometimes reusing a variable.
opted for it over bytes.Buffer since it seems to be the intended upgrade path anyhow (see https://groups.google.com/g/golang-codereviews/c/6S3_B4N197E?pli=1); they seem similar in the intended use, but it never hurts to use the intended tool.
It also has some checks around escape analysis that were missing from the custom implementation, so we're winning.
@Olshansk
Copy link
Member

@iajrz I saw that you pushed some updates. Please re-request a review (see screenshot) when it's ready for another round

Screenshot 2022-12-20 at 3 50 38 PM

Copy link

@ivan-pokt ivan-pokt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to readjust this to have singular Given statements per scenario and should not have a Then statements immediately following another Then statement. See line comments.

e2e/tests/accounts.feature Outdated Show resolved Hide resolved
e2e/tests/query.feature Show resolved Hide resolved
e2e/tests/query.feature Outdated Show resolved Hide resolved
Copy link

@AneudyM AneudyM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The whole query.feature file needs to be refined. It is also too big. Consider using broader-concept steps to avoid repetitions or split them into smaller files if you are unwilling to use background.

e2e/tests/query.feature Outdated Show resolved Hide resolved
e2e/tests/query.feature Show resolved Hide resolved
e2e/tests/query.feature Show resolved Hide resolved
And the user should be able to see standard output containing "0011"
And the pocket client should have exited without error

Scenario: To get existing supported networks, Returns an error code with invalid height
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confusing scenario. What is the acceptance criterion here?

Copy link
Member

@Olshansk Olshansk Dec 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AneudyM I completely with you that this scenario, and it's title are confusing. When reviewing code, I usually try to use Github's "suggestion" feature so the reviewee can just accept/commit it or modify it if need be.; would appreciate your teams help in distributing the workload on this.

For example (I have no clue if this is clearer):

Suggested change
Scenario: To get existing supported networks, Returns an error code with invalid height
Scenario: To verify that an invalid height cannot be quried from the list of supported-networks

Re the scenario -

  1. Are we verifying we can't query an invalid height OR we can't query an unsupported network?

Re the Then - error loading store makes me think the network is not supported.
2. Is that correct?
3. If so, is there any way to make the source code (without comments) make that more explicit?

Re the And
4. Does this exit successfully because the client worked but the backing data is invalid?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. Those are good points. Mmm..., looking at the validation of the scenario it might be trying to query a network with an invalid height. In that case, I think I would rewrite it as follows:

Scenario: Return error when querying supported networks with invalid height number
  Given a “single_node_network”
    And a valid pocket client
  When querying a supported network with invalid height “99999” number
  Then an “error loading store” message should be returned
    But the pocket client should not exit with an error status

Re point 4:
That's why I am unsure of including the exit status steps here. What does the specification say about these exit statuses.

e2e/tests/query.feature Outdated Show resolved Hide resolved
e2e/tests/query.feature Outdated Show resolved Hide resolved
@Olshansk Olshansk requested a review from AneudyM January 23, 2023 22:53
@Olshansk
Copy link
Member

@iajrz I updated the documentation, added a few comments and refactored a bit of the code. I'm in favour of adopting a similar pattern (with a simpler initial implementation) in V1 using gherkin.

Lmk if you see issue with any of my changes. If not, I can go ahead and merge it in.

cc @jessicadaugherty for visibility

Copy link
Member

@Olshansk Olshansk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got an off-line 👍 from @iajrz on the changes I made so going to go ahead and merge this in:

Screenshot 2023-01-25 at 12 05 47 PM

@Olshansk Olshansk merged commit a987aa1 into staging Jan 25, 2023
@Olshansk Olshansk deleted the testy-tomato branch January 25, 2023 17:07
Olshansk added a commit that referenced this pull request Jan 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Automated e2e Testing
6 participants