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

Updated CLI integration test to check for specific size instead of multiple of the share size #429

Conversation

nicoelzer
Copy link
Contributor

Description

Update CLI integration test to require specific size instead of multiple of the share size

closes: #245

@nicoelzer nicoelzer changed the title update cli integration test for specific size instead of multiple of the share size Updated CLIT integration test to check for specific size instead of multiple of the share size May 21, 2022
@nicoelzer nicoelzer changed the title Updated CLIT integration test to check for specific size instead of multiple of the share size Updated CLI integration test to check for specific size instead of multiple of the share size May 21, 2022
@codecov-commenter
Copy link

codecov-commenter commented May 21, 2022

Codecov Report

Merging #429 (ddda3a8) into master (35a71e1) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #429   +/-   ##
=======================================
  Coverage   25.05%   25.05%           
=======================================
  Files          14       14           
  Lines        1864     1864           
=======================================
  Hits          467      467           
  Misses       1358     1358           
  Partials       39       39           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 745bd99...ddda3a8. Read the comment docs.

Copy link
Member

@evan-forbes evan-forbes left a comment

Choose a reason for hiding this comment

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

Thanks for digging into this @nicoelzer ! pls see comment and let me know if you have any further questions.

its also worth noting that the way we are adding the default padding for messages is sort of in flux, as we are removing it in #419, and then will be adding a more proper implementation in #431 #432

s.Equal(uint64(0), msgSize%consts.ShareSize, "Message length should be multiples of const.ShareSize=%v", consts.ShareSize)
require.Equal(uint64(consts.ShareSize), msgSize, "Message length should be %v", consts.ShareSize)
Copy link
Member

Choose a reason for hiding this comment

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

while this specific message is the size of the consts.ShareSize, not all messages will be this size. The only reason that it is this size is because it gets padded. Ideally, we would have a function that calculated the padded length of the message being used in the test, and then use that to compare with the result here. I think it would also be okay to simply add a field in the test case to communicate the expected size.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey @evan-forbes, thanks for the review, appreciate it!

I added the padMessage function, which adds the padding to the provided message and uses the result for comparison on the test.

@evan-forbes
Copy link
Member

hey @nicoelzer, sorry for all the delays, we've been super busy with mamaki! in this rush, we since changed this in master

msgSize, err := strconv.ParseInt(e.GetAttributes()[1].GetValue(), 10, 64)
require.NoError(err)
require.Equal(len(msg), int(msgSize))
}

as part of a solution to some bugs in #419. This PR was still very helpful in getting us to think about #431 #432, and I hate to toss perfectly good work, but this change isn't needed any longer since our implementation changed. Again, super sorry that this contribution isn't being recognized fully by accepting this PR, it was made precisely at the time where we were already in the process of changing it. 🙁

it is good work though 🙂

@nicoelzer
Copy link
Contributor Author

Hey @evan-forbes,

no worries at all and thank you for the feedback. I will pick up some other open issues and looking forward to further contribute! And of course, congrats on the launch of the testnet!!

@nicoelzer nicoelzer closed this May 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Test for a specific size instead of multiple of the share size
4 participants