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

[Uptime] Mock prototype in unit test to prevent relative date breaking snapshots. #73531

Conversation

justinkambic
Copy link
Contributor

Summary

Fixes #73522.

A call to a moment function was using relative time, and it has been two years since the date specified, so it started providing a different value, which has caused the test snapshot to break. I've mocked the moment prototype in the test file and it has resolved the problem for me locally.

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@justinkambic justinkambic added bug Fixes for quality problems that affect the customer experience v8.0.0 Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability v7.10.0 v7.9.0 labels Jul 28, 2020
@justinkambic justinkambic requested a review from a team as a code owner July 28, 2020 18:48
@justinkambic justinkambic self-assigned this Jul 28, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/uptime (Team:uptime)

@justinkambic justinkambic added the release_note:skip Skip the PR/issue when compiling release notes label Jul 28, 2020
@tylersmalley
Copy link
Contributor

I verified this fix locally and am merging to unblock CI.

@tylersmalley tylersmalley merged commit 86b60bb into elastic:master Jul 28, 2020
@tylersmalley tylersmalley changed the title [Uptime] Unskip ping histogram unit test [Uptime] Fix ping histogram unit test Jul 28, 2020
@tylersmalley tylersmalley changed the title [Uptime] Fix ping histogram unit test [Uptime] Mock prototype in unit test to prevent relative date breaking snapshots. Jul 28, 2020
@tylersmalley
Copy link
Contributor

7.x/7.10: 3c6202f
7.9: 9957fe1
7.8: 3aca2dc

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Build metrics

✅ unchanged

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create backports run node scripts/backport --pr 73531 or prevent reminders by adding the backport:skip label.

@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Jul 30, 2020
@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create backports run node scripts/backport --pr 73531 or prevent reminders by adding the backport:skip label.

1 similar comment
@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create backports run node scripts/backport --pr 73531 or prevent reminders by adding the backport:skip label.

@justinkambic justinkambic added the backport:skip This commit does not require backporting label Aug 3, 2020
@kibanamachine kibanamachine removed the backport missing Added to PRs automatically when the are determined to be missing a backport. label Aug 3, 2020
@justinkambic
Copy link
Contributor Author

I've applied backport:skip to avoid the bot notifying on this branch. Based on the comment above, the fix was ported to all necessary release branches.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting bug Fixes for quality problems that affect the customer experience release_note:skip Skip the PR/issue when compiling release notes Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability v7.9.0 v7.10.0 v8.0.0
Projects
None yet
4 participants