-
Notifications
You must be signed in to change notification settings - Fork 127
Explicitly install packages on system tests #1281
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
Conversation
This will allow to earlier detect if one is not testing the version they currently have in the working copy. From 8.7.0 version, it builds and install the zip package. On older versions it installs whatever is in the configured package registry. In that case, if the version of the package is not available in the repository, test execution will fail.
| return agents, nil | ||
| } | ||
|
|
||
| func installPackage(client *kibana.Client, manifest *packages.PackageManifest, rootPath string) error { |
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 looks similar to the factory created in cmd/install.go file. Do you think it would be possible to reuse some of the code? Maybe the installer code:
- for local packages: internal/packages/installer/installer.go
- for zip packages: internal/packages/installer/zip_installer.go
https://github.com/elastic/elastic-package/tree/main/internal/packages/installer
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 have merged both codes in a single factory in the installer package, let me know what you think.
I am also passing the kibana client from the callers, I would like to have more explicit initializations of the clients we use. This is something I have WIP to be able to get the settings from the profile in this branch https://github.com/elastic/elastic-package/compare/main...jsoriano:elastic-package:clients-from-profile?expand=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.
I have merged both codes in a single factory in the installer package, let me know what you think.
It looks perfect! 💪 thanks for doing this change!
I am also passing the kibana client from the callers, I would like to have more explicit initializations of the clients we use. This is something I have WIP to be able to get the settings from the profile in this branch https://github.com/elastic/elastic-package/compare/main...jsoriano:elastic-package:clients-from-profile?expand=1.
Ok! that would also help us to add more tests if the kibana client is set as a parameter 👍
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.
Thanks! This will make easier testing changes while developing new version of packages. No need to build and restart package-registry container to get the new version of the package, nice!
Just left one minor suggestion for an error message.
| return agents, nil | ||
| } | ||
|
|
||
| func installPackage(client *kibana.Client, manifest *packages.PackageManifest, rootPath string) error { |
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 have merged both codes in a single factory in the installer package, let me know what you think.
It looks perfect! 💪 thanks for doing this change!
I am also passing the kibana client from the callers, I would like to have more explicit initializations of the clients we use. This is something I have WIP to be able to get the settings from the profile in this branch https://github.com/elastic/elastic-package/compare/main...jsoriano:elastic-package:clients-from-profile?expand=1.
Ok! that would also help us to add more tests if the kibana client is set as a parameter 👍
| if err != nil { | ||
| return result.WithError(fmt.Errorf("failed to install package: %v", err)) | ||
| } | ||
| r.deletePackageHandler = func() error { |
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 couldn't just use defer here, I needed to use a handler to play well with the tear downs here.
💚 Build Succeeded
History
cc @jsoriano |
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 will allow to earlier detect if one is not testing the version they currently have in the working copy.
From 8.7.0 version, it builds and install the zip package. On older versions it installs whatever is in the configured package registry. In that case, if the version of the package is not available in the repository, test execution will fail.
Also removes uses of
errors.Wrapin the file.It won't be tested in CI till stack version is updated to >= 8.7.0.