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

merkledb -- db_test.go cleanup #1954

Merged
merged 16 commits into from
Sep 7, 2023
Merged

merkledb -- db_test.go cleanup #1954

merged 16 commits into from
Sep 7, 2023

Conversation

danlaine
Copy link
Collaborator

Why this should be merged

Removes redundant tests and cleans up tests

How this works

See comments

How this was tested

It is tests

@danlaine danlaine added testing This primarily focuses on testing merkledb labels Aug 31, 2023
@danlaine danlaine self-assigned this Aug 31, 2023
@danlaine danlaine marked this pull request as ready for review August 31, 2023 20:50
require.Nil(value)
}

func Test_MerkleDB_InsertAndRetrieve(t *testing.T) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Covered by test_database.go

val, err := db.HealthCheck(context.Background())
require.NoError(err)
require.Nil(val)
}

func Test_MerkleDB_Overwrite(t *testing.T) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Covered by test_database.go

require.Equal([]byte("value1"), value)
}

func Test_MerkleDB_Delete(t *testing.T) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Covered by test_database.go

require.Nil(value)
}

func Test_MerkleDB_DeleteMissingKey(t *testing.T) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Covered by test_database.go

@@ -645,92 +636,126 @@ func TestDatabaseInvalidateChildrenExcept(t *testing.T) {
func Test_MerkleDB_Random_Insert_Ordering(t *testing.T) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Gonna do some more cleanup around the randomized tests in a follow up PR

@danlaine danlaine merged commit c21782e into dev Sep 7, 2023
16 checks passed
@danlaine danlaine deleted the merkledb-test-cleanup branch September 7, 2023 17:34
@danlaine danlaine added this to the v1.10.10 milestone Sep 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merkledb testing This primarily focuses on testing
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

3 participants