Skip to content

Commit

Permalink
fixup! Add random seed to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mpalmi committed Jan 31, 2025
1 parent 953e71e commit 6ad4d93
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion vault/identity_store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1669,7 +1669,7 @@ func identityStoreLoadingIsDeterministic(t *testing.T, identityDeduplication boo
// signature without breaking enterprise. It's simpler to keep it unused
// for now until both parts of this merge.
if secondary {
entIdentityStoreSecondaryDeterminismAssert(t, i, loadedNames, nil)
entIdentityStoreDeterminismSecondaryAssert(t, i, loadedNames, nil)

Check failure on line 1672 in vault/identity_store_test.go

View workflow job for this annotation

GitHub Actions / Code checks

not enough arguments in call to entIdentityStoreDeterminismSecondaryAssert

Check failure on line 1672 in vault/identity_store_test.go

View workflow job for this annotation

GitHub Actions / Run Go tests / test-go (2)

not enough arguments in call to entIdentityStoreDeterminismSecondaryAssert

Check failure on line 1672 in vault/identity_store_test.go

View workflow job for this annotation

GitHub Actions / Run Go tests / test-go (2)

not enough arguments in call to entIdentityStoreDeterminismSecondaryAssert

Check failure on line 1672 in vault/identity_store_test.go

View workflow job for this annotation

GitHub Actions / Run Go tests tagged with testonly / test-go (0)

not enough arguments in call to entIdentityStoreDeterminismSecondaryAssert

Check failure on line 1672 in vault/identity_store_test.go

View workflow job for this annotation

GitHub Actions / Run Go tests tagged with testonly / test-go (0)

not enough arguments in call to entIdentityStoreDeterminismSecondaryAssert
}

if i > 0 {
Expand Down
7 changes: 4 additions & 3 deletions vault/identity_store_test_stubs_oss.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,21 @@ package vault

import (
"context"
"math/rand"
"testing"
)

//go:generate go run github.com/hashicorp/vault/tools/stubmaker

func entIdentityStoreDeterminismTestSetup(t *testing.T, ctx context.Context, c *Core, me, localme *MountEntry) {
func entIdentityStoreDeterminismSecondaryTestSetup(t *testing.T, ctx context.Context, c *Core, me, localme *MountEntry, seed *rand.Rand) {
// no op
}

func entIdentityStoreDeterminismAssert(t *testing.T, i int, loadedIDs, lastIDs []string) {
func entIdentityStoreDeterminismSecondaryAssert(t *testing.T, i int, loadedIDs, lastIDs []string, seed *rand.Rand) {
// no op
}

func entIdentityStoreDuplicateReportTestSetup(t *testing.T, ctx context.Context, c *Core, rootToken string) {
func entIdentityStoreDuplicateReportTestSetup(t *testing.T, ctx context.Context, c *Core, rootToken string, seed *rand.Rand) {
// no op
}

Expand Down

0 comments on commit 6ad4d93

Please sign in to comment.