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
feature(CLI): Analyzer Resource Integration #2726
feature(CLI): Analyzer Resource Integration #2726
Conversation
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.
Watched the loom - looked great!
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.
🤘
func (analyzer analyzerActions) Apply(ctx context.Context, fileContent file.File) (result *file.File, err error) { | ||
result, err = analyzer.resourceClient.Update(ctx, fileContent, currentConfigID) | ||
return result, err | ||
} |
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.
func (analyzer analyzerActions) Apply(ctx context.Context, fileContent file.File) (result *file.File, err error) { | |
result, err = analyzer.resourceClient.Update(ctx, fileContent, currentConfigID) | |
return result, err | |
} | |
func (analyzer analyzerActions) Apply(ctx context.Context, fileContent file.File) (*file.File, error) { | |
return analyzer.resourceClient.Update(ctx, fileContent, currentConfigID) | |
} |
// When I try to set up a config | ||
// Then it should be applied with success |
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.
// When I try to set up a config | |
// Then it should be applied with success | |
// When I try to set up an analyzer | |
// Then it should be applied with success |
t.Run("get with no analyzer initialized", func(t *testing.T) { | ||
// Given I am a Tracetest CLI user | ||
// And I have my server recently created | ||
// And no config previously registered |
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.
// And no config previously registered | |
// And no analyzer previously registered |
// And I have my server recently created | ||
// And no config previously registered | ||
|
||
// When I try to get a config on yaml mode |
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.
// When I try to get a config on yaml mode | |
// When I try to get an analyzer on yaml mode |
// And I have a config already set | ||
|
||
// When I try to get a config on yaml mode |
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.
// And I have a config already set | |
// When I try to get a config on yaml mode | |
// And I have an analyzer already set | |
// When I try to get a analyzer on yaml mode |
// When I try to list config on pretty mode and there is no config previously registered | ||
// Then it should print an empty table | ||
// Then it should print a table with 4 lines printed: header, separator, the default config item and empty line |
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.
// When I try to list config on pretty mode and there is no config previously registered | |
// Then it should print an empty table | |
// Then it should print a table with 4 lines printed: header, separator, the default config item and empty line | |
// When I try to list an analyzer on pretty mode and there is no analyzer previously registered | |
// Then it should print an empty table | |
// Then it should print a table with 4 lines printed: header, separator, the default analyzer item and empty line |
// And I already have a config created | ||
|
||
// When I try to list a config by an invalid field |
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.
// And I already have a config created | |
// When I try to list a config by an invalid field | |
// And I already have an analyzer created | |
// When I try to list one analyzer by an invalid field |
// And I already have a config created | ||
|
||
// When I try to list config again on yaml mode |
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.
// And I already have a config created | |
// When I try to list config again on yaml mode | |
// And I already have an analyzer created | |
// When I try to list one analyzer again on yaml mode |
// And I already have a config created | ||
|
||
// When I try to list config again on json mode |
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.
// And I already have a config created | |
// When I try to list config again on json mode | |
// And I already have an analyzer created | |
// When I try to list one analyzer again on json mode |
// And I already have a config created | ||
|
||
// When I try to list config again on pretty mode | ||
// Then it should print a table with 4 lines printed: header, separator, config item and empty line |
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.
// And I already have a config created | |
// When I try to list config again on pretty mode | |
// Then it should print a table with 4 lines printed: header, separator, config item and empty line | |
// And I already have an analyzer created | |
// When I try to list one analyzer again on pretty mode | |
// Then it should print a table with 4 lines printed: header, separator, an analyzer item and empty line |
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 good, a couple of questions.
@@ -0,0 +1,30 @@ | |||
package analyzer |
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 the name of this file be delete_analyzer_test.go
?
@@ -0,0 +1,108 @@ | |||
package analyzer |
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.
same here, get_analyzer_test.go
?
@@ -0,0 +1,120 @@ | |||
package analyzer |
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.
list_analyzer_test.go
?
* feature(CLI): Analyzer Resource Integration * feature(CLI): including e2e tests * feature(CLI): including e2e tests * feature(CLI): including e2e tests * fixing comments * fixing test file names
* feature(CLI): Analyzer Resource Integration * feature(CLI): including e2e tests * feature(CLI): including e2e tests * feature(CLI): including e2e tests * fixing comments * fixing test file names
This PR adds the actions and formatter to support the analyzer resource from the CLI
Changes
Fixes
Checklist
https://www.loom.com/share/45983054b6c548b6a21ed8b9a041936a