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

Use DeepSSZEqual to satisfy go tests #8499

Merged
merged 6 commits into from
Feb 23, 2021
Merged

Conversation

terencechain
Copy link
Member

What type of PR is this?

Test

What does this PR do? Why is it needed?

Running go test pkg by pkg to get them to pass. This PR fixes

  • Usages should have been DeepSSZEqual
  • Configs should have been UseMinimalConfig
  • Slots should have been types.Slot

Which issues(s) does this PR fix?

N/A

Other notes for review

N/A

@@ -65,7 +66,7 @@ func TestRestore(t *testing.T) {
require.NoError(t, err)
headBlock, err := restoredDb.HeadBlock(ctx)
require.NoError(t, err)
assert.Equal(t, uint64(5000), headBlock.Block.Slot, "Restored database has incorrect data")
assert.Equal(t, types.Slot(5000), headBlock.Block.Slot, "Restored database has incorrect data")
Copy link
Member Author

Choose a reason for hiding this comment

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

@farazdagi not sure how this was passing for bazel

Copy link
Contributor

@farazdagi farazdagi Feb 23, 2021

Choose a reason for hiding this comment

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

That's really strange! Will look into it.

@@ -152,6 +152,9 @@ func TestServer_ListBlocks_Genesis_MultiBlocks(t *testing.T) {
}

func TestServer_ListBlocks_Pagination(t *testing.T) {
params.UseMinimalConfig()
Copy link
Member Author

Choose a reason for hiding this comment

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

These tests should have been minimal to begin. Only reason they were passing is because bazel leaked minimal config to here

Copy link
Contributor

@farazdagi farazdagi left a comment

Choose a reason for hiding this comment

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

Amazing catches! Will review why the heck we had a test passing while there was type inequality (really hope that we don't have some nasty bug in our assertion lib).

@prylabs-bulldozer prylabs-bulldozer bot merged commit 1db3c86 into develop Feb 23, 2021
@delete-merged-branch delete-merged-branch bot deleted the use-deep-ssz branch February 23, 2021 22:20
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.

3 participants