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

[Cache Proxy] add an integration test #7966

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

iain-macdonald
Copy link
Contributor

Only one test case for now that tests the bug fixed in this PR: #7852

CacheEncryptionEnabled bool
}

func WithTestRedis(t *testing.T) *Options {
Copy link
Member

Choose a reason for hiding this comment

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

nit: it'll be awkward if we want to add more functions like this later:

redisOpts := enterprise_testenv.WithTestRedis(t)
fooOpts := enterprise_testenv.WithFoo(t)
opts := &enterprise_testenv.Options{
  RedisTarget: redisOpts.RedisTarget,
  Foo: fooOpts.Foo,
}

so, I think we should avoid this pattern and let the caller manage the Options struct:

opts := &Options{
  RedisTarget: testredis.Start(t).Target,
  Foo: testfoo.New(t),
}

auth := enterprise_testauth.Configure(t, testEnv)
flags.Set(t, "auth.jwt_key", auth.GetJwtKey())
Copy link
Member

Choose a reason for hiding this comment

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

would it make sense to do this in enterprise_testauth.Configure() so that we don't have to introduce GetJwtKey() on TestAuthenticator?

@@ -18,7 +19,13 @@ import (
)

type Options struct {
RedisTarget string
RedisTarget string
CacheEncryptionEnabled bool
Copy link
Member

Choose a reason for hiding this comment

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

this CacheEncryptionEnabled field is only used in rbetest, and is unused in GetCustomTestEnv, so I think it's a bit confusing to add it here. Instead of updating this opts struct, maybe add a separate options struct to rbetest?

@@ -57,7 +57,7 @@ func Configure(t *testing.T, env *real_environment.RealEnv) *testauth.TestAuthen

// CreateRandomGroups creates several randomly generated orgs with several
// randomly generated users under each.
func CreateRandomGroups(t *testing.T, env environment.Env) []*tables.User {
func CreateRandomGroups(t *testing.T, env environment.Env, encryptionEnabled bool) []*tables.User {
Copy link
Member

Choose a reason for hiding this comment

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

The newly added test only seems to be testing GR1 - could encryption be left disabled for the random groups? The test could do something like env.GetUserDB().UpdateGroup(...) to enable encryption just for GR1.

Asking because it feels a little inconvenient for this to be a mandatory parameter, since in reality encryption is somewhat of a special case.

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.

2 participants