-
Notifications
You must be signed in to change notification settings - Fork 4
Added Group json option #300
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
base: trunk
Are you sure you want to change the base?
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.
Thanks!
|
||
public function output_group( OutputInterface $output ): void { | ||
$group = $this->get(); | ||
if ( ! array_key_exists( 'group_identifier', $group ) ) { |
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 ensure that $group is an array here and in other similar checks in order to make it more robust? Something like:
if ( is_array( $group ) && ! array_key_exists( 'group_identifier', $group ) )
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 don't need to. The function get
method on the TestGroup class returns an empty array if the group doesn't exist and everywhere else where we fetch the group directly from the cache has defensive checks in place
Thanks for creating this PR @MrJnrman! Please don't consider my questions/comments as blockers and go ahead if you're happy with Lucas' approval! Just wanted to test this PR as an opportunity to learn more about groups. Testing instruction step 2 says:
How can you do that? |
@alopezari I'm happy to share. To add a test to a group all you have to do is append You can also check the docs for more info: https://qit.woo.com/docs/managed-tests/group-tests |
This PR adds the
--json
option to thegroup:fetch
command to render the output as raw json.Changes
--json
flagTesting Instructions
qit group:fetch -i <group-identifier>
and confirm you get nicely formatted output.qit group:fetch -i <group-identifier> --json
and confirm you get raw json.