-
Notifications
You must be signed in to change notification settings - Fork 192
Support test plugins with context-aware-cli-for-plugins
feature-flag enabled
#3276
Support test plugins with context-aware-cli-for-plugins
feature-flag enabled
#3276
Conversation
Codecov Report
@@ Coverage Diff @@
## main #3276 +/- ##
==========================================
- Coverage 54.21% 53.83% -0.38%
==========================================
Files 107 91 -16
Lines 10781 10019 -762
==========================================
- Hits 5845 5394 -451
+ Misses 4467 4185 -282
+ Partials 469 440 -29 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
26d36af
to
3db991d
Compare
daaf6a5
to
3a76513
Compare
context-aware-cli-for-plugins
feature-flag enabledcontext-aware-cli-for-plugins
feature-flag enabled
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.
Great work! I have a few questions though
I ran below commands, and got output as
IMO, as an end-user, I would expect more details as output! |
I ran the below commands to test plugins, but I don't see any output; it might be successful, but I think it would be better if we print output.
|
3a76513
to
aed7a58
Compare
I was looking into this and found out that as part of invocation, Tanzu CLI just invokes As part of the plugin initialization that I feel that is a plugin specific code and Tanzu CLI might not be able to show any output in that case if plugin author decide not to print anything on the terminal because the test plugin is not getting used. |
I verified and Regarding |
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 @anujc25 for the nice improvement.
It is hard for me to understand the subtleties since I don't know what was the old behaviour, so my questions may not make much sense, but I'll try anyway.
The (very small) README of the test
plugin mentions that to install all the tests plugins, we should use tanzu test fetch
. In your PR description you used tanzu plugin install all
instead. What do you prefer users to do between the two approaches? And if we use tanzu test fetch
, would it allow us to avoid installing the tests plugins when doing a tanzu plugin install
?
Sorry, by previous comment should have used |
…enabled Signed-off-by: Anuj Chaudhari <anujc@vmware.com>
Signed-off-by: Anuj Chaudhari <anujc@vmware.com>
aed7a58
to
dcb934b
Compare
Good point. I think we should not install test plugin as part of plugin installation but just install the test plugin when we do |
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.
lgtm, thanks!
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.
LGTM
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 minor comments. No blockers.
|
||
// FetchTest returns test artifact | ||
func (g *HTTPArtifact) FetchTest() ([]byte, error) { | ||
return nil, errors.New("fetching test plugin from HTTP source is not yet supported") |
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: just use fmt.Errorf
and avoid an external dependency.
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 feel it would be better to use errors
package consistently across all the files. Most of the other places we are using errors.New
, errors.Wrap
, errors.Wrapf
to handle the 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.
Now that fmt.Errorf
supports wrapping with %w
, I don't feel pkg/errors
is necessary anymore.
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 for the feedback. This is good to know.
But if you don't mind, I would prefer to do that change as a separate PR and not hold this PR for that.
Signed-off-by: Anuj Chaudhari <anujc@vmware.com>
dcb934b
to
89f80fb
Compare
What this PR does / why we need it
This PR adds support for installing test plugin along with plugin installation in local mode with
tanzu test fetch --local
command.The change also implements
FetchTest
interface forlocal
artifacts and throws error when using the same withoci
andhttp
artifacts.This change also updates
Plugin Test
pipeline to not rely on old implementation and uses newcontext-aware-cli-for-plugins: true
to deploy and run test plugins.Which issue(s) this PR fixes
Fixes #1164
Describe testing done for PR
artifacts/darwin/amd64/cli/
directorytanzu plugin install all --local artifacts/darwin/amd64/cli/
to install plugins along with test pluginstanzu test plugin --help
to verify all plugins are available under the command to run teststanzu test plugin <plugin-name>
to run the plugin testsRelease note
Additional information
Special notes for your reviewer