-
Notifications
You must be signed in to change notification settings - Fork 470
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
update e2e helm install #10632
update e2e helm install #10632
Conversation
Signed-off-by: Jenny Shu <[email protected]>
Signed-off-by: Jenny Shu <[email protected]>
Signed-off-by: Jenny Shu <[email protected]>
Signed-off-by: Jenny Shu <[email protected]>
Signed-off-by: Jenny Shu <[email protected]>
Signed-off-by: Jenny Shu <[email protected]>
Signed-off-by: Jenny Shu <[email protected]>
Signed-off-by: Jenny Shu <[email protected]>
Signed-off-by: Jenny Shu <[email protected]>
Signed-off-by: Jenny Shu <[email protected]>
Signed-off-by: Jenny Shu <[email protected]>
Signed-off-by: Jenny Shu <[email protected]>
Signed-off-by: Jenny Shu <[email protected]>
Signed-off-by: Jenny Shu <[email protected]>
Signed-off-by: Jenny Shu <[email protected]>
Signed-off-by: Jenny Shu <[email protected]>
Signed-off-by: Jenny Shu <[email protected]>
Signed-off-by: Jenny Shu <[email protected]>
Signed-off-by: Jenny Shu <[email protected]>
Signed-off-by: Jenny Shu <[email protected]>
Signed-off-by: Jenny Shu <[email protected]>
Signed-off-by: Jenny Shu <[email protected]>
Signed-off-by: Jenny Shu <[email protected]>
Signed-off-by: Jenny Shu <[email protected]>
// InstallOpts is a set of typical options for a helm install which can be passed in | ||
// instead of requiring the caller to remember the helm cli flags. extraArgs should | ||
// always be accepted and respected when using InstallOpts. | ||
type InstallOpts struct { |
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.
moved to install.go
func (c *Client) AddGlooRepository(ctx context.Context, extraArgs ...string) error { | ||
return c.AddRepository(ctx, ChartName, ChartRepositoryUrl, extraArgs...) | ||
} | ||
|
||
func (c *Client) AddPrGlooRepository(ctx context.Context, extraArgs ...string) error { | ||
return c.AddRepository(ctx, ChartName, PrChartRepositoryUrl, extraArgs...) | ||
} |
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.
no longer needed, we now use an oci registry which doesn't require helm repo add
TestAssetDir string | ||
|
||
// Helm chart name | ||
HelmChartName string | ||
|
||
// Name of the helm index file name | ||
HelmRepoIndexFileName string |
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.
these were always hardcoded; removed
) | ||
|
||
// Default test configuration | ||
var defaults = TestConfig{ |
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.
glooctl stuff, not needed
// Function to provide/override test configuration. Default values will be passed in. | ||
type TestConfigFunc func(defaults TestConfig) TestConfig | ||
|
||
type TestConfig struct { |
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.
removed TestConfig and SoloTestHelper in favor of just passing in the options directly via the helm client InstallOptions in pkg/utils/helmutils/install.go
// there's an issue pulling the certgen docker image. | ||
// Without this timeout, it would just hang indefinitely. | ||
func glooctlInstallWithTimeout(rootDir string, opts *Options, timeout time.Duration) error { | ||
return runWithTimeout(rootDir, opts, timeout, "install") |
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 think it's unlikely we'll run into timeout issues since we don't have jobs running as part of the helm install now, but we can always add this back later if needed
ReleasedVersion string | ||
|
||
// The version of the Helm chart. Calculated from either the chart or the released version. It will not have a leading 'v' | ||
ChartVersion string | ||
|
||
// The path to the local helm chart used for testing. Based on the TestAssertDir and relative to RootDir. | ||
ChartUri string |
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.
instead of storing them on the Context (where they were never used), we just pass these in via the helm client InstallOptions
kubeGatewaySuiteRunner.Register("DirectResponse", directresponse.NewTestingSuite) | ||
kubeGatewaySuiteRunner.Register("CRDCategories", crd_categories.NewTestingSuite) | ||
kubeGatewaySuiteRunner.Register("Metrics", metrics.NewTestingSuite) | ||
// kubeGatewaySuiteRunner.Register("Deployer", deployer.NewTestingSuite) |
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.
commented out the feature tests just to get the main SuiteRunner compiling.
the feature tests will be re-enabled individually
helper.WithExtraArgs("--values", i.Metadata.ProfileValuesManifestFile), | ||
helper.WithExtraArgs("--values", i.Metadata.ValuesManifestFile), | ||
) | ||
func (i *TestInstallation) InstallKgatewayFromLocalChart(ctx context.Context) { |
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.
this replaces the previous TestHelper stuff. it simply gets the local chart path and calls the helm cli install func
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.
nit: s/InstallKgatewayFromLocalChart/InstallFromLocalChart?
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.
hmm I kind of like having the 'kgateway' in the name because there could be other things we install/uninstall during the tests (e.g. istio)
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 think the chart name is implicit based on the "FromLocalChart" naming as we don't have multiple local charts (well I guess maybe the deployer chart counts here too).
We could also have an Install method that acts as a driver / hook for other suites to DI the dependencies that need to be installed (e.g. helm charts, binaries like istioctl, etc.). In this case, this method would take a variadic parameter and delegate to sub-install functions that match the expected function signature s.t. call sites can configure which hooks are needed.
Supports #10480. |
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.
Had a couple of questions, comments, etc. but nothing that isn't immediately blocking as long as we're tracking everything in the #10480 epic properly.
Just want to wrap my head around the order of operations here. You added some context that this PR is foundational and that enabling individual feature suites will be done as a follow-up. Are we planning on enabling this suite in our GHA workflows then?
@@ -18,6 +18,7 @@ require ( | |||
github.com/golang/mock v1.6.0 | |||
github.com/google/go-cmp v0.6.0 | |||
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 | |||
github.com/hashicorp/go-multierror v1.1.1 |
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.
We should rip this dependency out in favor of other methods for aggregating errors together (e.g. utilerrors.NewAggregate or the stlib errors.Join). This can be done in a follow-up since we're removing the build ignore flag and these are issues with the existing code.
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.
filed #10643
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.
Should we move this to internal? Any reason we'd need this to live in pkg/ right now?
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.
Are we using this helmutils package anywhere outside of the test/ directory? I'm wondering whether we should move it there instead.
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 was previously outside the test pkg because our CLI used this pkg. now that we don't have a CLI we could move it back into a test pkg but not sure what the plans are for adding back a CLI or if it will live in this repo
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.
yep sgtm. let's get the main structure in place first and then revisit -- the priority is getting feedback on our extension APIs for PRs.
helper.WithExtraArgs("--values", i.Metadata.ProfileValuesManifestFile), | ||
helper.WithExtraArgs("--values", i.Metadata.ValuesManifestFile), | ||
) | ||
func (i *TestInstallation) InstallKgatewayFromLocalChart(ctx context.Context) { |
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.
nit: s/InstallKgatewayFromLocalChart/InstallFromLocalChart?
@@ -36,7 +35,7 @@ type SimpleTestCase struct { | |||
// Resources expected to be created by manifest | |||
Resources []client.Object | |||
// values file passed during an upgrade | |||
UpgradeValues string | |||
// UpgradeValues string |
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.
nit: Add TODO comment like we did with the other uncommented function/code blocks?
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.
mind if i handle that in the next PR so this one doesn't have to re-run CI again?
// Deprecated; if this is needed create a resource yaml for it. | ||
func GetHttpEchoImage() string { | ||
httpEchoImage := "hashicorp/http-echo" | ||
if runtime.GOARCH == "arm64" { | ||
httpEchoImage = "gcr.io/solo-test-236622/http-echo:0.2.4" | ||
} | ||
return httpEchoImage | ||
} |
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.
Just curious -- was this dead code from before, or dead code as a result of ripping out some code with these changes?
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 like it was dead code even in the gloo repo
|
||
func (i *TestInstallation) UninstallGlooGateway(ctx context.Context, uninstallFn func(ctx context.Context) error) { | ||
func (i *TestInstallation) UninstallKgateway(ctx context.Context) { |
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.
nit: Same comment as above. I think we can improve this name in addition to how the general install, upgrade, uninstall flow methods are implemented, but that can be done organically over time & a problem with the existing code.
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.
see my response from above
Simplify the install API used by e2e tests by removing the SoloTestHelper, removing fields that are hardcoded (e.g. test assets directory, index filename) or that can be derived (e.g. local chart uri), and calling the helm cli for install/uninstall.
Also removed the build ignore directives from all the files used by the base e2e test installation, to ensure they compile.
Enabling feature tests will be done in follow-up PRs.
other parts of this PR were previously broken out: