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

Add test for parsing connection paths #4111

Merged
merged 12 commits into from
Sep 16, 2023

Conversation

Reecepbcups
Copy link
Member

@Reecepbcups Reecepbcups commented Jul 18, 2023

Description

Add test for parsing of connection path.

Commit Message / Changelog Entry

type: commit message

see the guidelines for commit messages. (view raw markdown for examples)


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (see CONTRIBUTING.md).
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards and Go style guide.
  • Wrote unit and integration tests.
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/).
  • Added relevant godoc comments.
  • Provide a commit message to be used for the changelog entry in the PR description for review.
  • Re-reviewed Files changed in the Github PR explorer.
  • Review Codecov Report in the comment section below once CI passes.

@Reecepbcups Reecepbcups changed the title Use regex to parse identifiers in a key path Use regex to parse identifiers in a key path (24-host) Jul 18, 2023
@codecov-commenter
Copy link

codecov-commenter commented Jul 18, 2023

Codecov Report

Merging #4111 (39a0270) into main (242cb9f) will increase coverage by 0.09%.
Report is 1 commits behind head on main.
The diff coverage is n/a.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4111      +/-   ##
==========================================
+ Coverage   79.56%   79.66%   +0.09%     
==========================================
  Files         188      188              
  Lines       13201    13201              
==========================================
+ Hits        10504    10517      +13     
+ Misses       2266     2253      -13     
  Partials      431      431              

see 1 file with indirect coverage changes

Copy link
Contributor

@charleenfei charleenfei left a comment

Choose a reason for hiding this comment

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

one small req otherwise lgtm! thanks!

"strconv"
"strings"

errorsmod "cosmossdk.io/errors"
)

var pathRegex = regexp.MustCompile("[^/]+")
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe a small godoc here explaining what the regex is doing?

Copy link
Member Author

Choose a reason for hiding this comment

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

Resolved in 5f8d39a

@crodriguezvega
Copy link
Contributor

@Reecepbcups We discussed internally this PR and we'd rather keep using strings.Split. However, we would like to still merge a part of this PR: the TestMustParseConnectionPath you have added. Would it be possible for you to revert the other changes, but leave the test (it should still pass)? I am happy to do this as well, if you're busy. Thank you!

@crodriguezvega crodriguezvega changed the title Use regex to parse identifiers in a key path (24-host) Add test for parsing connection paths Sep 12, 2023
@Reecepbcups
Copy link
Member Author

@crodriguezvega makes sense, completed

Copy link
Member

@damiannolan damiannolan left a comment

Choose a reason for hiding this comment

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

Nice one @Reecepbcups! Thank you

Copy link
Contributor

@crodriguezvega crodriguezvega left a comment

Choose a reason for hiding this comment

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

Thank you, @Reecepbcups!

@crodriguezvega crodriguezvega merged commit f4e1f71 into cosmos:main Sep 16, 2023
51 of 52 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants