Skip to content

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

Merged
tylersmalley merged 1 commit into
elastic:masterfrom
justinkambic:uptime_unskip-ping-histogram-unit-test
Jul 28, 2020
Merged

[Uptime] Mock prototype in unit test to prevent relative date breaking snapshots.#73531
tylersmalley merged 1 commit into
elastic:masterfrom
justinkambic:uptime_unskip-ping-histogram-unit-test

Conversation

@justinkambic
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member

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
Copy Markdown
Member

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

@kibanamachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Build metrics

✅ unchanged

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

@kibanamachine
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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 PR 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
Copy Markdown
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.

patrykkopycinski pushed a commit to patrykkopycinski/kibana that referenced this pull request May 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR 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