The Wayback Machine - https://web.archive.org/web/20220707142115/https://github.com/angular/angular/pull/45521
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

refactor(platform-browser): remove obsolete shim for Map comparison in Jasmine #45521

Closed
wants to merge 1 commit into from

Conversation

toastwaffle
Copy link
Contributor

@toastwaffle toastwaffle commented Apr 4, 2022

Angular now uses Jasmine 2.8 as a minimum version (required by
protractor; most of it is using ^3.5.0 which currently resolves to
3.99.0), which makes this shim obsolete - all versions of Jasmine used
have Map comparison built in.

This shim causes problems for custom equality checkers - when using a
Map containing types needing a custom equality check, this fails
because the call to jasmine.matchersUtil.equals from the shim does not
use any of the custom equality matchers.

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.io application / infrastructure changes
  • Other... Please describe:

What is the current behavior?

Jasmine tests comparing equality of Maps containing types requiring custom equality matchers fail

What is the new behavior?

Tests will pass

Does this PR introduce a breaking change?

  • Yes
  • No

@pullapprove pullapprove bot requested a review from dylhunn Apr 4, 2022
Copy link
Contributor

@AndrewKushnir AndrewKushnir left a comment

@toastwaffle thanks for the cleanup! I've looked at the PR where the changes were introduced (see #22983) and I think we should also do a cleanup of the packages/types.d.ts and probably the packages/core/test/testing_internal_spec.ts as well.

@AndrewKushnir AndrewKushnir added action: review target: patch comp: testing labels Apr 4, 2022
@ngbot ngbot bot added this to the Backlog milestone Apr 4, 2022
@AndrewKushnir AndrewKushnir added the refactoring label Apr 4, 2022
@AndrewKushnir
Copy link
Contributor

@AndrewKushnir AndrewKushnir commented Apr 4, 2022

@toastwaffle could you please also update the commit message to make it start with refactor(platform-browser): as it would better reflect the changes.

@toastwaffle toastwaffle changed the title fix(platform-browser): remove obsolete shim for Map comparison in Jasmine refactor(platform-browser): remove obsolete shim for Map comparison in Jasmine Apr 5, 2022
@toastwaffle
Copy link
Contributor Author

@toastwaffle toastwaffle commented Apr 5, 2022

I've removed one type alias from packages/types.d.ts; the tests fail without the other one. packages/core/test/testing_internal_spec.ts was removed by #42177

@pullapprove pullapprove bot requested a review from devversion Apr 5, 2022
@toastwaffle toastwaffle requested a review from AndrewKushnir Apr 5, 2022
@AndrewKushnir AndrewKushnir added action: presubmit and removed action: review labels Apr 8, 2022
@AndrewKushnir
Copy link
Contributor

@AndrewKushnir AndrewKushnir commented Apr 8, 2022

@toastwaffle thanks for addressing the feedback. It looks like there are some legit failures in a global presubmit (see here). Could you please investigate and let us know if this may end up resulting in a breaking change? I think it'd still make sense to land this change, but we'd need to include extra info into a commit message and only land in a major version of Angular (i.e. v14.0.0).

@toastwaffle
Copy link
Contributor Author

@toastwaffle toastwaffle commented Apr 8, 2022

@AndrewKushnir those test failures are valid; I have fixes for them in this CL (sponge). Are we able to patch this PR with those fixes, or do we still need to wait for a major version (when is v14.0.0 due to land?)

@AndrewKushnir
Copy link
Contributor

@AndrewKushnir AndrewKushnir commented Apr 9, 2022

@toastwaffle thanks for the fixes! I've looked at the fixes and I'm wondering if they can be landed now without changes from this PR (if the tests would still be "green")? If yes, that'd be the best option and once the changes from your CL land, we can land this PR.

We had a discussion about these changes with the team and the custom Jasmine matchers should not be available to users outside of Google's codebase, so the changes should not be breaking and we can land them in any patch version. The matchers were made accessible in Google's codebase accidentally and we plan to do a cleanup to transition the code to use other helpers once this PR lands.

@toastwaffle
Copy link
Contributor Author

@toastwaffle toastwaffle commented Apr 11, 2022

@AndrewKushnir those fixes are still green without the changes from this PR; I've mailed them to their respective owners and will update here once they are submitted.

@toastwaffle
Copy link
Contributor Author

@toastwaffle toastwaffle commented Apr 11, 2022

@AndrewKushnir 3 CLs submitted: cl/440823458, cl/440891954, cl/440813981

@AndrewKushnir
Copy link
Contributor

@AndrewKushnir AndrewKushnir commented Apr 11, 2022

@toastwaffle great news, thanks for the update! 👍

There is a merge conflict with the master branch (due to other changes merged into the master branch). Could you please try to rebase and resolve the conflicts? It'd be great if you could also run a new TGP after that to see if there are any new failures. Thank you.

…mine

Angular now uses Jasmine 2.8 as a minimum version (required by
protractor; most of it is using ^3.5.0 which currently resolves to
3.99.0), which makes this shim obsolete - all versions of Jasmine used
have Map comparison built in.

This shim causes problems for custom equality checkers - when using a
Map containing types needing a custom equality check, this  fails
because the call to `jasmine.matchersUtil.equals` from the shim does not
use any of the custom equality matchers.
@toastwaffle
Copy link
Contributor Author

@toastwaffle toastwaffle commented Apr 12, 2022

@AndrewKushnir rebased and kicked off a TGP run in cl/441136621

@toastwaffle
Copy link
Contributor Author

@toastwaffle toastwaffle commented Apr 12, 2022

@AndrewKushnir TGP is green

@AndrewKushnir AndrewKushnir removed the request for review from dylhunn Apr 12, 2022
@AndrewKushnir
Copy link
Contributor

@AndrewKushnir AndrewKushnir commented Apr 12, 2022

@toastwaffle thanks for the cleanup! 👍

@AndrewKushnir AndrewKushnir removed the action: presubmit label Apr 12, 2022
@AndrewKushnir AndrewKushnir added the action: merge label Apr 12, 2022
@jessicajaniuk
Copy link
Contributor

@jessicajaniuk jessicajaniuk commented Apr 12, 2022

@toastwaffle This doesn't merge cleanly with 13.3.x. I'll update this to merge into target: minor. If you want this to land in patch, please create a patch PR targeting 13.3.x.

@jessicajaniuk jessicajaniuk added target: minor and removed target: patch labels Apr 12, 2022
@jessicajaniuk
Copy link
Contributor

@jessicajaniuk jessicajaniuk commented Apr 12, 2022

This PR was merged into the repository by commit c7bf75d.

@toastwaffle
Copy link
Contributor Author

@toastwaffle toastwaffle commented Apr 12, 2022

@jessicajaniuk how often do minor versions land in google3?

@AndrewKushnir
Copy link
Contributor

@AndrewKushnir AndrewKushnir commented Apr 12, 2022

@toastwaffle the changes from the master branch are synced into google3 daily. This particular change is in the sync process at this moment.

@jessicajaniuk
Copy link
Contributor

@jessicajaniuk jessicajaniuk commented Apr 12, 2022

@toastwaffle It is officially synced now.

@angular-automatic-lock-bot
Copy link

@angular-automatic-lock-bot angular-automatic-lock-bot bot commented May 13, 2022

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators May 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge comp: testing refactoring target: minor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants