core-command icon indicating copy to clipboard operation
core-command copied to clipboard

Add `--format` flag in `core update`

Open ernilambar opened this issue 1 year ago • 4 comments

Fixes https://github.com/wp-cli/core-command/issues/129

ernilambar avatar Mar 08 '24 09:03 ernilambar

Looks like we dont have should contain a table containing rows. Regarding table we have should be a table containing rows and should end with a table containing rows. Both conditions are not applicable in this case.

Our output would be like this:

Starting update...
Unpacking the update...
Cleaning up files...
No files found that need cleaning up.
name	old_version	new_version	status
core	6.0	6.1	Updated
Success: WordPress updated successfully.

@schlessera Any suggestion how we can implement test for table in this case?

Or, should be implement quiet logger for table also?

ernilambar avatar Mar 14 '24 09:03 ernilambar

Looks like should end with a table containing rows does not necessarily check the table in the end. May be we should introduce should contain a table containing rows and also fix this feature context.

ernilambar avatar Mar 19 '24 07:03 ernilambar

I would lean towards implementing the quiet logger for table output too.

And I can confirm ThenStepDefinitions::then_stdout_should_end_with_a_table_containing_rows() does not test that the table is at the end of the output. It searches stdout for the table header and checks the remainder of stdout for the expected rows. It would be somewhat more accurately named then_stdout_should_contain_a_table_containing_rows, but if output contained two tables, it could incorrectly pass if the second table coincidentally contained the row values that were expected in the first table.

BrianHenryIE avatar Apr 26 '24 19:04 BrianHenryIE

Anything that needs to be updated here?

ernilambar avatar Aug 14 '24 11:08 ernilambar