-
Notifications
You must be signed in to change notification settings - Fork 19
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
Extract testenv #355
Extract testenv #355
Conversation
Skipping CI for Draft Pull Request. |
8eb82ab
to
3d8f379
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks ok 👌🏿 only names-related suggestions
"testing" | ||
) | ||
|
||
func SetUpTestEnv(t *testing.T) (cl client.Client, env *envtest.Environment) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name of the package contains info about the destination of the content. We don't need to keep the same info in the func name. I would suggest renaming the SetUpTestEnv
to just SetUp
or something like Configure
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The testenv_test.SetUpTestEnv(t)
looks a bit strange 😅 That's why I suggested changing it into testenv_test.SetUp(t)
or, with propositions from the comment below, even into testenv.SetUp(t)
/env_test.SetUp(t)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I propose names Start
and Stop
. Those are similar to standard envtest
package methods
@@ -0,0 +1,54 @@ | |||
package testenv_test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if the testenv_test
keeps redundant info. The _test
suffix is used to define the desire of the package, right? I would suggest renaming it into env_test
.
To be honest, I think the testenv
keeps all important information about the content under it, so maybe we even should remove this _test suffix.
But if we don't want to allow importing public methods from this pkg in a non-test file we should add the _test
suffix to the file name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not possible to use test file package in other tests I renamed the file to just envtest
.
I removed the additional test
from package as Start
and Stop
accept testing.T
which indicate that those methods should be used in test only,
/test all |
Description
Changes proposed in this pull request:
Related issue(s)
kyma-project/kyma#17562