Skip to content
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

Debug Tests: Improve connection test, and allow overrides #14740

Merged
merged 6 commits into from
Feb 24, 2020

Conversation

roccotripaldi
Copy link
Member

@roccotripaldi roccotripaldi commented Feb 19, 2020

Changes proposed in this Pull Request:

  • Allowed failing and passing tests to override the proposed defaults for the Site Health, while preserving the functionality of test messaging in the CLI and API test environments.
  • improved the messaging on the Connection test for the Site Health page.

Is this a new feature or does it add/remove features to an existing part of Jetpack?

  • This is step one in improving Jetpack's site health section
  • See: p6TEKc-3st-p2

Testing instructions:

  • Test that CLI tests still function
  • Test that all Jetpack Site Health tests still look okay ( Tools -> Site Health )
  • Take a look a the new Site Health card for a connected site:

Screen Shot 2020-02-20 at 3 06 13 PM

  • Take a look at the new Site Health card for an unconnected site:

Screen Shot 2020-02-20 at 2 57 42 PM

Proposed changelog entry for your changes:

  • n/a

- Allow successful tests to provide their own message and label for the Site Health page.
- Adjust the message and label for the `test__check_if_connected` test
- Adds the ability for tests to supply an action label and override other labels.
- Improves the failing state for `test__check_if_connected`
@jetpackbot
Copy link

jetpackbot commented Feb 19, 2020

Warnings
⚠️

pre-commit hook was skipped for one or more commits

This is an automated check which relies on PULL_REQUEST_TEMPLATE. We encourage you to follow that template as it helps Jetpack maintainers do their job. If you think 'Testing instructions' or 'Proposed changelog entry' are not needed for your PR - please explain why you think so. Thanks for cooperation 🤖

Generated by 🚫 dangerJS against 0f090d7

@jeherve jeherve added [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it Connect Flow Connection banners, buttons, ... labels Feb 20, 2020
Allow passing tests to override defaults with an HTML description.
- perserve plain text messages to use on API tests
- allow tests to override plain text with HTML for the Site Health page.
@roccotripaldi roccotripaldi changed the title In progress: update jetpack debug connection tests Debug Tests: Improver connection test, and allow overrides Feb 20, 2020
@roccotripaldi roccotripaldi added [Status] Needs Review To request a review from Crew. Label will be renamed soon. [Status] Needs Testing We need to add this change to the testing call for this month's release [Status] Needs Design Review Design has been added. Needs a review! and removed [Status] In Progress labels Feb 20, 2020
@roccotripaldi roccotripaldi added this to the 8.3 milestone Feb 20, 2020
@roccotripaldi
Copy link
Member Author

Thanks for the review @kraftbj - i had no idea that these tests were also used in CLI. I've made changes to preserve CLI functionality while allowing overrides for HTML in Site Health

sprintf(
'<p>%s</p><p>%s</p>',
__( 'A healthy connection ensures Jetpack essential services are provided to your WordPress site, such as Stats and Site Security.', 'jetpack' ),
__( '✅ Your site is connected to Jetpack.', 'jetpack' )
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should pull the emoji out of the translation and use a placeholder instead? I am not sure translators / translator tools can all handle adding emoji.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed — ideally this should reuse a Dashicon instead of being an emoji:

Green/Healthy/Good:

<span class="dashicons pass"><span class="screen-reader-text">Passed</span></span>

Read/Error/Bad:

<span class="dashicons fail"><span class="screen-reader-text">Error</span></span>

__( 'Your site is not connected to Jetpack', 'jetpack' ),
__( 'Learn more about this process', 'jetpack' ),
sprintf(
'<p>%s</p><p>%s<strong>%s</strong></p>',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a nit-pick, but I personally find it easier to read when we use numbered placeholders when we have more than a couple of them. Up to you!

*
* @return array Test results.
*/
public static function failing_test( $name, $message, $resolution = false, $action = false, $severity = 'critical' ) {
public static function failing_test( $name, $message, $resolution = false, $action = false, $severity = 'critical', $label = false, $action_label = 'Resolve', $description = false ) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can pull Resolve out of there so it can still be translated?

Suggested change
public static function failing_test( $name, $message, $resolution = false, $action = false, $severity = 'critical', $label = false, $action_label = 'Resolve', $description = false ) {
public static function failing_test( $name, $message, $resolution = false, $action = false, $severity = 'critical', $label = false, $action_label = '', $description = false ) {
if ( empty( $action_label ) ) {
$action_label = __( 'Resolve', 'jetpack' );
}

@jeherve jeherve added [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! and removed [Status] Needs Review To request a review from Crew. Label will be renamed soon. labels Feb 21, 2020
Copy link
Contributor

@keoshi keoshi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! I've changed the failed state a tiny bit in iteration no. 2 though, which will be posted shortly.

@keoshi keoshi added [Status] Design Review Complete and removed [Status] Needs Design Review Design has been added. Needs a review! labels Feb 21, 2020
@keoshi
Copy link
Contributor

keoshi commented Feb 21, 2020

Designs i2 posted p6TEKc-3t2-p2

- adds dashicons instead of emoji
- improves translation logic
@roccotripaldi roccotripaldi added [Status] Needs Review To request a review from Crew. Label will be renamed soon. and removed [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! labels Feb 21, 2020
jeherve
jeherve previously approved these changes Feb 21, 2020
Copy link
Member

@jeherve jeherve left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It tests well for me. 👍

@jeherve jeherve added [Status] Ready to Merge Go ahead, you can push that green button! and removed [Status] Needs Review To request a review from Crew. Label will be renamed soon. labels Feb 21, 2020
@roccotripaldi roccotripaldi changed the title Debug Tests: Improver connection test, and allow overrides Debug Tests: Improve connection test, and allow overrides Feb 22, 2020
@kraftbj
Copy link
Contributor

kraftbj commented Feb 24, 2020

A couple of comments:

  1. Seeing the function args grow and grow, it may make sense to migrate to passing an args array.

  2. Breaking out the HTML description from the plain text one is giving me pause. To me, it feels like a case where we would possibly be duplicating a lot of text. Using wpautop, could we do this without an extra field? Links are the one thing I'm less sure about though we can make them clickable through the filter that does that in Core already.

Having multiple strings show up in different places could complicate seeking support or answers if it isn't clear that multiple messages are referring to the same thing.

…e-added as part of next sprint when multiple action links are supported
@mdbitz
Copy link
Contributor

mdbitz commented Feb 24, 2020

Per the i2 designs the primary action text should be "Reconnect your site now" for failed connections.

@mdbitz mdbitz added [Status] Needs Review To request a review from Crew. Label will be renamed soon. and removed [Status] Ready to Merge Go ahead, you can push that green button! [Status] Needs Testing We need to add this change to the testing call for this month's release labels Feb 24, 2020
@jeherve jeherve added [Status] Ready to Merge Go ahead, you can push that green button! and removed [Status] Needs Review To request a review from Crew. Label will be renamed soon. labels Feb 24, 2020
@mdbitz mdbitz merged commit 0eb0505 into master Feb 24, 2020
@mdbitz mdbitz deleted the update/site-health-connection branch February 24, 2020 15:43
@matticbot matticbot added [Status] Needs Changelog and removed [Status] Ready to Merge Go ahead, you can push that green button! labels Feb 24, 2020
@mdbitz
Copy link
Contributor

mdbitz commented Feb 24, 2020

Note about changelog we could use something around the lines of:

Site Health Tests
Updated Connect test with detailed descriptions and actions to resolve failing tests.

jeherve added a commit that referenced this pull request Feb 25, 2020
jeherve added a commit that referenced this pull request Feb 25, 2020
* 8.3 release: changelog

* Changelog: add #14516

* Changelog: add #14574

* Bring in changes from 8.2.1 and 8.2.2

* Update stable version

* Bring in 8.2.3 changes

* Changelog: add #14714

* Changelog: add #14639

* Changelog: add #14678

* Changelog: add #14673

* Changelog: add #14687

* Changelog: add #14704

* Changelog: add #14702

* Changelog: add #14541

* Changelog: add #14657

* Changelog: add #14622

* Changelog: add #14582

* Changelog: add #14638

* Changelog: add #14633

* Changelog: add #14571

* Changelog: add #14592

* Changelog: add #14539

* Changelog: add #14514

* Changelog: add #14643

* Changelog: add #14494

* Changelog: add #13739

* Changelog: add #14707

* Changelog: add #14736

* Changelog: add #14706

* Changelog: add #14730

* Changelog: add #14685

* Changelog: add #14727

* Changelog: add #14711

* Changelog: add #14742

* Changelog: add #14746

* Changelog: add #14725

* Changelog: add #13999

* Changelog: add #14740

* Changelog: add #14759

* Changelog: add #14703

* Changelog: add #14753

* Changelog: add #14754

* Changelog: add #14645

* Cahngelog: add #14599
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Connect Flow Connection banners, buttons, ... [Status] Design Review Complete [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants